| 511 | } |
| 512 | |
| 513 | struct 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 | |
| 526 | struct command_result *param_number(struct command *cmd, const char *name, |
| 527 | const char *buffer, const jsmntok_t *tok, |
nothing calls this directly
no test coverage detected