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

Function ns_make_path

src/pipeline/doc_links_cs.c:858–870  ·  view source on GitHub ↗

The namespace the dotted `path` names under `from`, every segment created * on the way; CS_NONE for a bad name, when memory ran out, and past the * scanner's nesting limit: a scope read back from the store is held to the * limit its writer keeps (every enclosing namespace is a lookup step). */

Source from the content-addressed store, hash-verified

856 * scanner's nesting limit: a scope read back from the store is held to the
857 * limit its writer keeps (every enclosing namespace is a lookup step). */
858static int ns_make_path(cs_index_t *ix, int from, const char *path) {
859 int ns = from;
860 for (const char *p = path; ns >= 0 && *p;) {
861 if (ix->nss[ns].depth >= CS_MAX_NEST) {
862 return CS_NONE;
863 }
864 const char *dot = strchr(p, '.');
865 size_t n = dot ? (size_t)(dot - p) : strlen(p);
866 ns = ns_make(ix, ns, p, n);
867 p = dot ? dot + SKIP_ONE : p + n;
868 }
869 return ns;
870}
871
872/* ── Scope blob parsing ──────────────────────────────────────────── */
873

Callers 1

parse_regionFunction · 0.85

Calls 1

ns_makeFunction · 0.85

Tested by

no test coverage detected