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

Function pr_read_blob

src/pipeline/doc_links_php.c:273–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273static void pr_read_blob(pr_index_t *ix, pr_file_t *f, int fi, const char *blob) {
274 const char *line = strchr(blob, '\n'); /* the tag line */
275 while (line && !ix->oom) {
276 const char *b = line + SKIP_ONE;
277 const char *e = strchr(b, '\n');
278 if (!e) {
279 e = b + strlen(b);
280 }
281 const char *fl[PR_FIELDS];
282 size_t ln[PR_FIELDS];
283 int n = 0;
284 const char *s = b;
285 for (const char *p = b; p <= e && n < PR_FIELDS; p++) {
286 if (p == e || *p == '\t') {
287 fl[n] = s;
288 ln[n] = (size_t)(p - s);
289 n++;
290 s = p + SKIP_ONE;
291 }
292 }
293 if (n > 0 && ln[0] == SKIP_ONE) {
294 pr_read_record(ix, f, fi, fl, ln, n);
295 }
296 line = *e ? e : NULL;
297 }
298}
299
300static void pr_destroy(void *index) {
301 pr_index_t *ix = (pr_index_t *)index;

Callers 1

pr_buildFunction · 0.70

Calls 1

pr_read_recordFunction · 0.85

Tested by

no test coverage detected