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

Function build_binds

src/pipeline/doc_links_cs.c:2296–2315  ·  view source on GitHub ↗

Every entity's declarations by (class, path). */

Source from the content-addressed store, hash-verified

2294
2295/* Every entity's declarations by (class, path). */
2296static bool build_binds(cs_index_t *ix) {
2297 for (int i = 0; i < ix->nents; i++) {
2298 cs_entity_t *e = &ix->ents[i];
2299 e->binds = (cs_bind_t *)ix_alloc(ix, (size_t)e->ndecls * sizeof(cs_bind_t));
2300 if (!e->binds) {
2301 return false;
2302 }
2303 for (int d = 0; d < e->ndecls; d++) {
2304 const cs_file_t *f = &ix->files[e->decls[d].file];
2305 e->binds[d] =
2306 (cs_bind_t){.file = e->decls[d].file,
2307 .type = e->decls[d].type,
2308 .cls = decl_class(f, f->types[e->decls[d].type].node != NULL)};
2309 }
2310 if (e->ndecls > 1) {
2311 qsort(e->binds, (size_t)e->ndecls, sizeof(cs_bind_t), bind_cmp);
2312 }
2313 }
2314 return true;
2315}
2316
2317/* ── Members by entity and name ──────────────────────────────────── */
2318

Callers 1

cs_buildFunction · 0.85

Calls 2

decl_classFunction · 0.85
ix_allocFunction · 0.70

Tested by

no test coverage detected