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

Function param_escape_format

plugins/bkpr/report.c:373–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373struct command_result *param_escape_format(struct command *cmd,
374 const char *name,
375 const char *buffer,
376 const jsmntok_t *tok,
377 enum escape_format **escape)
378{
379 *escape = tal(cmd, enum escape_format);
380 if (json_tok_streq(buffer, tok, "csv")) {
381 **escape = REPORT_FMT_CSV;
382 } else if (json_tok_streq(buffer, tok, "none")) {
383 **escape = REPORT_FMT_NONE;
384 } else
385 return command_fail_badparam(cmd, name, buffer, tok,
386 "should be `csv` or `none`");
387 return NULL;
388}
389
390static char *escape_value(const tal_t *ctx,
391 const char *val TAKES,

Callers

nothing calls this directly

Calls 2

json_tok_streqFunction · 0.85
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected