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

Function json_to_bool

common/json_parse_simple.c:105–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105bool json_to_bool(const char *buffer, const jsmntok_t *tok, bool *b)
106{
107 if (tok->type != JSMN_PRIMITIVE)
108 return false;
109 if (memeqstr(buffer + tok->start, tok->end - tok->start, "true")) {
110 *b = true;
111 return true;
112 }
113 if (memeqstr(buffer + tok->start, tok->end - tok->start, "false")) {
114 *b = false;
115 return true;
116 }
117 return false;
118}
119
120
121bool json_tok_is_num(const char *buffer, const jsmntok_t *tok)

Callers 7

param_boolFunction · 0.70
param_reserve_numFunction · 0.50
plugin_opt_addFunction · 0.50
plugin_rpcmethod_addFunction · 0.50
param_chanhintsFunction · 0.50
mainFunction · 0.50

Calls 1

memeqstrFunction · 0.85

Tested by 1

mainFunction · 0.40