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

Function pr_fields

src/pipeline/doc_links_perl.c:106–118  ·  view source on GitHub ↗

One record line of a blob: its fields, split at tabs (at most `cap`). */

Source from the content-addressed store, hash-verified

104
105/* One record line of a blob: its fields, split at tabs (at most `cap`). */
106static int pr_fields(const char *b, const char *e, const char **f, size_t *fl, int cap) {
107 int n = 0;
108 const char *s = b;
109 for (const char *p = b; p <= e && n < cap; p++) {
110 if (p == e || *p == '\t') {
111 f[n] = s;
112 fl[n] = (size_t)(p - s);
113 n++;
114 s = p + SKIP_ONE;
115 }
116 }
117 return n;
118}
119
120enum { PR_MAX_FIELDS = 4, PR_F_TAG = 0, PR_F_A = 1, PR_F_B = 2 };
121

Callers 1

pr_read_blobFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected