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:815–844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

813}
814
815static int agent_json_scan_array(agent_json_scanner_t *scanner, unsigned depth) {
816 if (depth >= AGENT_JSON_MAX_DEPTH) {
817 return -1;
818 }
819 scanner->position++;
820 if (agent_json_skip_space(scanner) != 0) {
821 return -1;
822 }
823 if (scanner->position < scanner->length && scanner->data[scanner->position] == ']') {
824 scanner->position++;
825 return 0;
826 }
827 for (;;) {
828 if (agent_json_scan_value(scanner, depth + 1U) != 0 ||
829 agent_json_skip_space(scanner) != 0 || scanner->position >= scanner->length) {
830 return -1;
831 }
832 char separator = scanner->data[scanner->position++];
833 if (separator == ']') {
834 return 0;
835 }
836 if (separator != ',' || agent_json_skip_space(scanner) != 0) {
837 return -1;
838 }
839 if (scanner->position < scanner->length && scanner->data[scanner->position] == ']') {
840 scanner->position++;
841 return 0;
842 }
843 }
844}
845
846static int agent_json_scan_value(agent_json_scanner_t *scanner, unsigned depth) {
847 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