MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / agent_json_scan_array

Function agent_json_scan_array

src/cli/agent_clients.c:830–859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

828}
829
830static int agent_json_scan_array(agent_json_scanner_t *scanner, unsigned depth) {
831 if (depth >= AGENT_JSON_MAX_DEPTH) {
832 return -1;
833 }
834 scanner->position++;
835 if (agent_json_skip_space(scanner) != 0) {
836 return -1;
837 }
838 if (scanner->position < scanner->length && scanner->data[scanner->position] == ']') {
839 scanner->position++;
840 return 0;
841 }
842 for (;;) {
843 if (agent_json_scan_value(scanner, depth + 1U) != 0 ||
844 agent_json_skip_space(scanner) != 0 || scanner->position >= scanner->length) {
845 return -1;
846 }
847 char separator = scanner->data[scanner->position++];
848 if (separator == ']') {
849 return 0;
850 }
851 if (separator != ',' || agent_json_skip_space(scanner) != 0) {
852 return -1;
853 }
854 if (scanner->position < scanner->length && scanner->data[scanner->position] == ']') {
855 scanner->position++;
856 return 0;
857 }
858 }
859}
860
861static int agent_json_scan_value(agent_json_scanner_t *scanner, unsigned depth) {
862 if (depth > AGENT_JSON_MAX_DEPTH || agent_json_skip_space(scanner) != 0 ||

Callers 1

agent_json_scan_valueFunction · 0.85

Calls 2

agent_json_skip_spaceFunction · 0.85
agent_json_scan_valueFunction · 0.85

Tested by

no test coverage detected