MCPcopy Create free account
hub / github.com/IBM/Project_CodeNet / token_startsWith

Function token_startsWith

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

Checks whether token start with s. */

Source from the content-addressed store, hash-verified

334
335/** Checks whether token start with s. */
336int token_startsWith(jsmntok_t *tok, const char *s) {
337 int len1 = tok->end - tok->start;
338 int len2 = strlen(s);
339 return len2 <= len1 && !strncmp(input + tok->start, s, len2);
340}
341
342/** Checks whether tokens are equal (same text). */
343int token_eq(jsmntok_t *tok1, jsmntok_t *tok2) {

Callers 1

show_tokens_auxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected