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

Function gi_line

src/discover/gitignore_checked_parse.c:13–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11} gi_parse_t;
12
13static bool gi_line(gi_parse_t *parse, size_t *cursor, gi_view_t *view) {
14 size_t start = *cursor;
15 while (*cursor < parse->length) {
16 parse->guard->offset = *cursor;
17 /* Both exact-byte validation and line splitting visit this byte. */
18 if (!gi_work(parse->guard, 2)) {
19 return false;
20 }
21 char byte = parse->bytes[*cursor];
22 if (!byte) {
23 return gi_fail(parse->guard, CBM_IGNORE_CHECKED_UNSUPPORTED, CBM_IGNORE_CAP_NONE);
24 }
25 if (byte == '\n') {
26 break;
27 }
28 (*cursor)++;
29 if (*cursor - start > INT_MAX) {
30 return gi_fail(parse->guard, CBM_IGNORE_CHECKED_LIMIT, CBM_IGNORE_CAP_REPRESENTATION);
31 }
32 }
33 size_t length = *cursor - start;
34 if (*cursor < parse->length) {
35 (*cursor)++;
36 }
37 parse->guard->offset = start;
38 return gi_normalize(parse->bytes + start, length, view, parse->guard);
39}
40
41static bool gi_store_pattern(gi_parse_t *parse, const gi_view_t *view) {
42 bool fault = parse->fault == GI_FAULT_PATTERN && parse->count == 0;

Callers 1

gi_parse_passFunction · 0.85

Calls 3

gi_workFunction · 0.85
gi_failFunction · 0.85
gi_normalizeFunction · 0.85

Tested by

no test coverage detected