| 257 | } |
| 258 | |
| 259 | static 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 | |
| 280 | static struct rune *from_string(const tal_t *ctx, |
| 281 | const char *str, |
no test coverage detected