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

Function find_def

tests/repro/repro_issue382.c:84–95  ·  view source on GitHub ↗

Return the first definition whose label AND name both match (either may be * NULL to wildcard). Mirrors the helper in repro_extraction.c. */

Source from the content-addressed store, hash-verified

82/* Return the first definition whose label AND name both match (either may be
83 * NULL to wildcard). Mirrors the helper in repro_extraction.c. */
84static CBMDefinition *find_def(CBMFileResult *r, const char *label,
85 const char *name) {
86 for (int i = 0; i < r->defs.count; i++) {
87 CBMDefinition *d = &r->defs.items[i];
88 if (label && (!d->label || strcmp(d->label, label) != 0))
89 continue;
90 if (name && (!d->name || strcmp(d->name, name) != 0))
91 continue;
92 return d;
93 }
94 return NULL;
95}
96
97/* Return 1 if any entry in the NULL-terminated decorators array contains
98 * needle as a substring. */

Callers 1

repro_issue382.cFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected