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

Function agent_json_scan_value

src/cli/agent_clients.c:846–868  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 ||
848 scanner->position >= scanner->length) {
849 return -1;
850 }
851 char first = scanner->data[scanner->position];
852 if (first == '{') {
853 return agent_json_scan_object(scanner, depth);
854 }
855 if (first == '[') {
856 return agent_json_scan_array(scanner, depth);
857 }
858 if (first == '"' || first == '\'') {
859 return agent_json_scan_string(scanner, NULL, NULL);
860 }
861 size_t start = scanner->position;
862 while (scanner->position < scanner->length &&
863 !isspace((unsigned char)scanner->data[scanner->position]) &&
864 !strchr(",]}", scanner->data[scanner->position])) {
865 scanner->position++;
866 }
867 return scanner->position > start ? 0 : -1;
868}
869
870static bool agent_json_key_equals(const char *data, size_t start, size_t end, const char *key) {
871 if (end < start) {

Callers 4

agent_json_scan_objectFunction · 0.85
agent_json_scan_arrayFunction · 0.85
agent_json_find_memberFunction · 0.85
agent_json_find_entryFunction · 0.85

Calls 4

agent_json_skip_spaceFunction · 0.85
agent_json_scan_objectFunction · 0.85
agent_json_scan_arrayFunction · 0.85
agent_json_scan_stringFunction · 0.85

Tested by

no test coverage detected