Extract a string or a json array */
| 464 | |
| 465 | /* Extract a string or a json array */ |
| 466 | struct command_result *param_string_or_array(struct command *cmd, const char *name, |
| 467 | const char * buffer, const jsmntok_t *tok, |
| 468 | struct str_or_arr **result) |
| 469 | { |
| 470 | *result = tal(cmd, struct str_or_arr); |
| 471 | (*result)->arr = NULL; |
| 472 | (*result)->str = NULL; |
| 473 | if (tok->type == JSMN_ARRAY) { |
| 474 | (*result)->arr = tok; |
| 475 | return NULL; |
| 476 | } |
| 477 | |
| 478 | return param_string(cmd, name, buffer, tok, &(*result)->str); |
| 479 | } |
| 480 | |
| 481 | struct command_result *param_string_array(struct command *cmd, const char *name, |
| 482 | const char *buffer, const jsmntok_t *tok, |
nothing calls this directly
no test coverage detected