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

Function param_string_or_array

common/json_param.c:466–479  ·  view source on GitHub ↗

Extract a string or a json array */

Source from the content-addressed store, hash-verified

464
465/* Extract a string or a json array */
466struct 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
481struct command_result *param_string_array(struct command *cmd, const char *name,
482 const char *buffer, const jsmntok_t *tok,

Callers

nothing calls this directly

Calls 1

param_stringFunction · 0.85

Tested by

no test coverage detected