MCPcopy Index your code
hub / github.com/IBM/Project_CodeNet / lookfor_value_of_key

Function lookfor_value_of_key

tools/json-graph/src/jgflib.c:428–442  ·  view source on GitHub ↗

We have an object and are looking for a specific key, ignoring all others. If the key is not found, the object itself is considered the value. Returns the first token of the value. */

Source from the content-addressed store, hash-verified

426 Returns the first token of the value.
427*/
428static jsmntok_t *lookfor_value_of_key(jsmntok_t *tok, const char *s)
429{
430 assert(tok->type == JSMN_OBJECT);
431 jsmntok_t *save_tok = tok;
432 int keys = tok->size; /* this many keys */
433 tok++;
434 while (keys--) {
435 /*key*/
436 if (string_eq(tok, s))
437 return ++tok;
438 /*value*/
439 tok = skip(tok+1);
440 }
441 return save_tok;
442}
443
444Graph jgf_parse(void)
445{

Callers 1

jgf_parseFunction · 0.85

Calls 2

string_eqFunction · 0.85
skipFunction · 0.85

Tested by

no test coverage detected