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

Function count_defs_named

tests/repro/repro_issue495.c:59–70  ·  view source on GitHub ↗

Count how many defs in r have exactly this label AND name. */

Source from the content-addressed store, hash-verified

57
58/* Count how many defs in r have exactly this label AND name. */
59static int count_defs_named(CBMFileResult *r, const char *label, const char *name) {
60 int n = 0;
61 for (int i = 0; i < r->defs.count; i++) {
62 CBMDefinition *d = &r->defs.items[i];
63 if (label && (!d->label || strcmp(d->label, label) != 0))
64 continue;
65 if (name && (!d->name || strcmp(d->name, name) != 0))
66 continue;
67 n++;
68 }
69 return n;
70}
71
72/* Return the Nth (0-based) def matching label + name, or NULL. */
73static CBMDefinition *nth_def_named(CBMFileResult *r, const char *label, const char *name, int nth) {

Callers 1

repro_issue495.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected