| 748 | } |
| 749 | |
| 750 | static char *web_json_get_string(const char *json, const char *key) { |
| 751 | char pat[128]; |
| 752 | snprintf(pat, sizeof(pat), "\"%s\"", key); |
| 753 | const char *p = json; |
| 754 | while ((p = strstr(p, pat)) != NULL) { |
| 755 | p += strlen(pat); |
| 756 | while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n') p++; |
| 757 | if (*p++ != ':') continue; |
| 758 | while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n') p++; |
| 759 | if (*p == '"') return web_json_parse_string_at(p, NULL); |
| 760 | } |
| 761 | return NULL; |
| 762 | } |
| 763 | |
| 764 | static char *web_cdp_eval_string(cdp_ws *ws, const char *expr, |
| 765 | char *err, size_t err_len) { |
no test coverage detected