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

Function json_to_bool

common/json_parse_simple.c:146–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146bool json_to_bool(const char *buffer, const jsmntok_t *tok, bool *b)
147{
148 if (tok->type != JSMN_PRIMITIVE)
149 return false;
150 if (memeqstr(buffer + tok->start, tok->end - tok->start, "true")) {
151 *b = true;
152 return true;
153 }
154 if (memeqstr(buffer + tok->start, tok->end - tok->start, "false")) {
155 *b = false;
156 return true;
157 }
158 return false;
159}
160
161bool json_hex_to_be32(const char *buffer, const jsmntok_t *tok, be32 *val)
162{

Callers

nothing calls this directly

Calls 1

memeqstrFunction · 0.85

Tested by

no test coverage detected