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

Function json_parse_simple

common/json_parse_simple.c:494–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492}
493
494jsmntok_t *json_parse_simple(const tal_t *ctx, const char *input, int len)
495{
496 bool complete;
497 jsmn_parser parser;
498 jsmntok_t *toks = toks_alloc(ctx);
499
500 jsmn_init(&parser);
501
502 if (!json_parse_input(&parser, &toks, input, len, &complete)
503 || !complete)
504 return tal_free(toks);
505 return toks;
506}
507
508const char *jsmntype_to_string(jsmntype_t t)
509{

Callers 7

mainFunction · 0.50
mainFunction · 0.50
test_json_tok_sizeFunction · 0.50
test_json_bad_utf8Function · 0.50
mainFunction · 0.50
json_parseFunction · 0.50
runtestFunction · 0.50

Calls 3

tal_freeFunction · 0.85
toks_allocFunction · 0.70
json_parse_inputFunction · 0.70

Tested by 5

mainFunction · 0.40
test_json_tok_sizeFunction · 0.40
test_json_bad_utf8Function · 0.40
mainFunction · 0.40
json_parseFunction · 0.40