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

Source from the content-addressed store, hash-verified

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 ||
863 scanner->position >= scanner->length) {
864 return -1;
865 }
866 char first = scanner->data[scanner->position];
867 if (first == '{') {
868 return agent_json_scan_object(scanner, depth);
869 }
870 if (first == '[') {
871 return agent_json_scan_array(scanner, depth);
872 }
873 if (first == '"' || first == '\'') {
874 return agent_json_scan_string(scanner, NULL, NULL);
875 }
876 size_t start = scanner->position;
877 while (scanner->position < scanner->length &&
878 !isspace((unsigned char)scanner->data[scanner->position]) &&
879 !strchr(",]}", scanner->data[scanner->position])) {
880 scanner->position++;
881 }
882 return scanner->position > start ? 0 : -1;
883}
884
885static bool agent_json_key_equals(const char *data, size_t start, size_t end, const char *key) {
886 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