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

Function json_skip_object_depth

ds4_server.c:333–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331 json_ws(p);
332 if (**p != '[') return false;
333 (*p)++;
334 json_ws(p);
335 if (**p == ']') {
336 (*p)++;
337 return true;
338 }
339 for (;;) {
340 if (!json_skip_value_depth(p, depth + 1)) return false;
341 json_ws(p);
342 if (**p == ']') {
343 (*p)++;
344 return true;
345 }
346 if (**p != ',') return false;
347 (*p)++;
348 }
349}
350
351static bool json_skip_object_depth(const char **p, int depth) {
352 if (depth >= JSON_MAX_NESTING) return false;
353 json_ws(p);
354 if (**p != '{') return false;
355 (*p)++;
356 json_ws(p);
357 if (**p == '}') {
358 (*p)++;
359 return true;
360 }
361 for (;;) {
362 char *key = NULL;

Callers 1

json_skip_value_depthFunction · 0.85

Calls 3

json_wsFunction · 0.85
json_stringFunction · 0.85
json_skip_value_depthFunction · 0.85

Tested by

no test coverage detected