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

Function json_tok_startswith

common/json_parse_simple.c:34–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34bool json_tok_startswith(const char *buffer, const jsmntok_t *tok,
35 const char *prefix)
36{
37 if (tok->type != JSMN_STRING)
38 return false;
39 if (tok->end - tok->start < strlen(prefix))
40 return false;
41 return memcmp(buffer + tok->start,
42 prefix, strlen(prefix)) == 0;
43}
44
45bool json_tok_endswith(const char *buffer, const jsmntok_t *tok,
46 const char *suffix)

Callers 3

json_to_enctlvsFunction · 0.85
tok_pullFunction · 0.85

Calls

no outgoing calls

Tested by 1

json_to_enctlvsFunction · 0.68