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

Function agent_json_skip_space

src/cli/agent_clients.c:712–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

710} agent_json_scanner_t;
711
712static int agent_json_skip_space(agent_json_scanner_t *scanner) {
713 for (;;) {
714 while (scanner->position < scanner->length &&
715 isspace((unsigned char)scanner->data[scanner->position])) {
716 scanner->position++;
717 }
718 if (scanner->position + 1U >= scanner->length || scanner->data[scanner->position] != '/') {
719 return 0;
720 }
721 if (scanner->data[scanner->position + 1U] == '/') {
722 scanner->position += 2U;
723 while (scanner->position < scanner->length &&
724 scanner->data[scanner->position] != '\n') {
725 scanner->position++;
726 }
727 } else if (scanner->data[scanner->position + 1U] == '*') {
728 scanner->position += 2U;
729 while (scanner->position + 1U < scanner->length &&
730 !(scanner->data[scanner->position] == '*' &&
731 scanner->data[scanner->position + 1U] == '/')) {
732 scanner->position++;
733 }
734 if (scanner->position + 1U >= scanner->length) {
735 return -1;
736 }
737 scanner->position += 2U;
738 } else {
739 return 0;
740 }
741 }
742}
743
744static int agent_json_scan_string(agent_json_scanner_t *scanner, size_t *start_out,
745 size_t *end_out) {

Callers 5

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

Calls

no outgoing calls

Tested by

no test coverage detected