param: make json_tok_ handlers all return command_result, rename to param_

Handers of a specific form are both designed to be used as callbacks
for param(), and also dispose of the command if something goes wrong.

Make them return the 'struct command_result *' from command_failed(),
or NULL.  

Renaming them just makes sense: json_tok_XXX is used for non-command-freeing
parsers too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-12-16 15:20:06 +10:30
parent 93bf7c4839
commit bc41ab2cb9
26 changed files with 630 additions and 588 deletions

View File

@@ -1056,7 +1056,7 @@ static void json_listconfigs(struct command *cmd,
const jsmntok_t *configtok;
if (!param(cmd, buffer, params,
p_opt("config", json_tok_tok, &configtok),
p_opt("config", param_tok, &configtok),
NULL))
return;