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

Source from the content-addressed store, hash-verified

695} agent_json_scanner_t;
696
697static int agent_json_skip_space(agent_json_scanner_t *scanner) {
698 for (;;) {
699 while (scanner->position < scanner->length &&
700 isspace((unsigned char)scanner->data[scanner->position])) {
701 scanner->position++;
702 }
703 if (scanner->position + 1U >= scanner->length || scanner->data[scanner->position] != '/') {
704 return 0;
705 }
706 if (scanner->data[scanner->position + 1U] == '/') {
707 scanner->position += 2U;
708 while (scanner->position < scanner->length &&
709 scanner->data[scanner->position] != '\n') {
710 scanner->position++;
711 }
712 } else if (scanner->data[scanner->position + 1U] == '*') {
713 scanner->position += 2U;
714 while (scanner->position + 1U < scanner->length &&
715 !(scanner->data[scanner->position] == '*' &&
716 scanner->data[scanner->position + 1U] == '/')) {
717 scanner->position++;
718 }
719 if (scanner->position + 1U >= scanner->length) {
720 return -1;
721 }
722 scanner->position += 2U;
723 } else {
724 return 0;
725 }
726 }
727}
728
729static int agent_json_scan_string(agent_json_scanner_t *scanner, size_t *start_out,
730 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