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

Function param_label

common/json_param.c:513–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511}
512
513struct command_result *param_label(struct command *cmd, const char *name,
514 const char * buffer, const jsmntok_t *tok,
515 struct json_escape **label)
516{
517 /* We accept both strings and number literals here. */
518 *label = json_escape_string_(cmd, buffer + tok->start, tok->end - tok->start);
519 if (*label && (tok->type == JSMN_STRING || json_tok_is_num(buffer, tok)))
520 return NULL;
521
522 return command_fail_badparam(cmd, name, buffer, tok,
523 "should be a string or number");
524}
525
526struct command_result *param_number(struct command *cmd, const char *name,
527 const char *buffer, const jsmntok_t *tok,

Callers

nothing calls this directly

Calls 3

json_escape_string_Function · 0.85
command_fail_badparamFunction · 0.70
json_tok_is_numFunction · 0.50

Tested by

no test coverage detected