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

Function pr_add_root

src/pipeline/doc_links_php.c:315–325  ·  view source on GitHub ↗

The namespace root of a qualified name ("" for a global one). */

Source from the content-addressed store, hash-verified

313
314/* The namespace root of a qualified name ("" for a global one). */
315static void pr_add_root(pr_index_t *ix, const char *name) {
316 const char *bs = name ? strchr(name, '\\') : NULL;
317 size_t n = bs ? (size_t)(bs - name) : (name ? strlen(name) : 0);
318 if (!n) {
319 return;
320 }
321 const char *key = pr_lower(ix, name, n);
322 if (key && !cbm_ht_get(ix->roots, key)) {
323 cbm_ht_set(ix->roots, key, (void *)(uintptr_t)SKIP_ONE);
324 }
325}
326
327/* Chain every type and function into its name's list, and collect the
328 * namespace roots. */

Callers 1

pr_linkFunction · 0.85

Calls 3

pr_lowerFunction · 0.85
cbm_ht_getFunction · 0.85
cbm_ht_setFunction · 0.85

Tested by

no test coverage detected