MCPcopy Create free account
hub / github.com/ElementsProject/lightning / rune_restr_decode

Function rune_restr_decode

ccan/ccan/rune/coding.c:259–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259static struct rune_restr *rune_restr_decode(const tal_t *ctx,
260 const char **data, size_t *len)
261{
262 struct rune_restr *restr = tal(ctx, struct rune_restr);
263 size_t num_alts = 0;
264 bool more;
265
266 /* Must have at least one! */
267 restr->alterns = tal_arr(restr, struct rune_altern *, 0);
268 do {
269 struct rune_altern *alt;
270
271 alt = rune_altern_decode(restr, data, len, &more);
272 if (!alt)
273 return tal_free(restr);
274 tal_resize(&restr->alterns, num_alts+1);
275 restr->alterns[num_alts++] = alt;
276 } while (more);
277 return restr;
278}
279
280static struct rune *from_string(const tal_t *ctx,
281 const char *str,

Callers 2

from_stringFunction · 0.85
rune_restr_from_stringFunction · 0.85

Calls 2

rune_altern_decodeFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected