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

Function gi_parse

src/discover/gitignore_checked_parse.c:101–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101static cbm_ignore_checked_status_t gi_parse(cbm_ignore_checked_t *owner, const void *bytes,
102 size_t length,
103 const cbm_ignore_checked_control_t *control,
104 unsigned fault, cbm_ignore_checked_parse_result_t *out,
105 cbm_ignore_checked_error_t *error) {
106 if (out) {
107 *out = (cbm_ignore_checked_parse_result_t){0};
108 }
109 gi_error(error, CBM_IGNORE_CHECKED_OK, CBM_IGNORE_CAP_NONE, SIZE_MAX);
110 if (!owner || (!bytes && length) || !control || !control->deadline_ms || !out ||
111 fault > GI_FAULT_PATTERN) {
112 gi_error(error, CBM_IGNORE_CHECKED_INVALID, CBM_IGNORE_CAP_NONE, SIZE_MAX);
113 return CBM_IGNORE_CHECKED_INVALID;
114 }
115 gi_guard_t guard;
116 if (!gi_begin(owner, control, &guard) || !gi_bytes(&guard, length)) {
117 return gi_finish(owner, error);
118 }
119 gi_parse_t parse = {.guard = &guard, .bytes = bytes, .length = length, .fault = fault};
120 if (gi_parse_pass(&parse) && gi_parse_storage(&parse) && gi_parse_pass(&parse) &&
121 gi_poll(&guard)) {
122 out->program = parse.program;
123 out->pattern_count = parse.count;
124 }
125 return gi_finish(owner, error);
126}
127
128cbm_ignore_checked_status_t cbm_ignore_checked_parse(cbm_ignore_checked_t *owner, const void *bytes,
129 size_t length,

Calls 7

gi_errorFunction · 0.85
gi_beginFunction · 0.85
gi_bytesFunction · 0.85
gi_finishFunction · 0.85
gi_parse_passFunction · 0.85
gi_parse_storageFunction · 0.85
gi_pollFunction · 0.85

Tested by

no test coverage detected