| 39 | } |
| 40 | |
| 41 | bool json_tok_startswith(const char *buffer, const jsmntok_t *tok, |
| 42 | const char *prefix) |
| 43 | { |
| 44 | if (tok->type != JSMN_STRING) |
| 45 | return false; |
| 46 | if (tok->end - tok->start < strlen(prefix)) |
| 47 | return false; |
| 48 | return memcmp(buffer + tok->start, |
| 49 | prefix, strlen(prefix)) == 0; |
| 50 | } |
| 51 | |
| 52 | bool json_tok_endswith(const char *buffer, const jsmntok_t *tok, |
| 53 | const char *suffix) |
no outgoing calls
no test coverage detected