MCPcopy Create free account
hub / github.com/antirez/ds4 / web_json_get_string

Function web_json_get_string

ds4_web.c:750–762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

748}
749
750static 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
764static char *web_cdp_eval_string(cdp_ws *ws, const char *expr,
765 char *err, size_t err_len) {

Callers 3

web_cdp_eval_stringFunction · 0.85
web_browser_ws_urlFunction · 0.85
web_open_tabFunction · 0.85

Calls 1

web_json_parse_string_atFunction · 0.85

Tested by

no test coverage detected