mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
param: make json_tok_label non-static
Needed to do this so I could remove the implementation in the run-param test. Signed-off-by: Mark Beckwith <wythe@intrig.com>
This commit is contained in:
committed by
Rusty Russell
parent
4f81cd3852
commit
8590dbedfb
@@ -129,6 +129,25 @@ bool json_tok_double(struct command *cmd, const char *name,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool json_tok_label(struct command *cmd, const char *name,
|
||||
const char * buffer, const jsmntok_t *tok,
|
||||
struct json_escaped **label)
|
||||
{
|
||||
if ((*label = json_tok_escaped_string(cmd, buffer, tok)))
|
||||
return true;
|
||||
|
||||
/* Allow literal numbers */
|
||||
if (json_tok_is_num(buffer, tok) &&
|
||||
((*label = json_escaped_string_(cmd, buffer + tok->start,
|
||||
tok->end - tok->start))))
|
||||
return true;
|
||||
|
||||
command_fail(cmd, JSONRPC2_INVALID_PARAMS,
|
||||
"'%s' should be a string or number, not '%.*s'",
|
||||
name, tok->end - tok->start, buffer + tok->start);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool json_tok_number(struct command *cmd, const char *name,
|
||||
const char *buffer, const jsmntok_t *tok,
|
||||
unsigned int **num)
|
||||
|
||||
Reference in New Issue
Block a user