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

Function param_escaped_string

common/json_param.c:414–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414struct command_result *param_escaped_string(struct command *cmd,
415 const char *name,
416 const char * buffer,
417 const jsmntok_t *tok,
418 const char **str)
419{
420 if (tok->type == JSMN_STRING) {
421 struct json_escape *esc;
422 /* jsmn always gives us ~ well-formed strings. */
423 esc = json_escape_string_(cmd, buffer + tok->start,
424 tok->end - tok->start);
425 *str = json_escape_unescape(cmd, esc);
426 if (*str)
427 return NULL;
428 }
429 return command_fail_badparam(cmd, name, buffer, tok,
430 "should be a string (without \\u)");
431}
432
433struct command_result *param_string(struct command *cmd, const char *name,
434 const char * buffer, const jsmntok_t *tok,

Callers

nothing calls this directly

Calls 3

json_escape_string_Function · 0.85
json_escape_unescapeFunction · 0.85
command_fail_badparamFunction · 0.85

Tested by

no test coverage detected