| 32 | } |
| 33 | |
| 34 | bool 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 | |
| 45 | bool json_tok_endswith(const char *buffer, const jsmntok_t *tok, |
| 46 | const char *suffix) |
no outgoing calls