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

Function count_defs_at

tests/test_extraction.c:7493–7505  ·  view source on GitHub ↗

Defs of `r` with this label, name and start line; `*qn` gets the last one's QN. */

Source from the content-addressed store, hash-verified

7491
7492/* Defs of `r` with this label, name and start line; `*qn` gets the last one's QN. */
7493static int count_defs_at(const CBMFileResult *r, const char *label, const char *name, uint32_t line,
7494 const char **qn) {
7495 int n = 0;
7496 for (int i = 0; i < r->defs.count; i++) {
7497 const CBMDefinition *d = &r->defs.items[i];
7498 if (d->label && d->name && strcmp(d->label, label) == 0 && strcmp(d->name, name) == 0 &&
7499 d->start_line == line) {
7500 *qn = d->qualified_name;
7501 n++;
7502 }
7503 }
7504 return n;
7505}
7506
7507/* A macro-generated struct body (the kernel's lib/tests/randstruct_kunit.c:
7508 * `struct s { DO_MANY_MEMBERS(m) };`, `struct t { mixed_members };`) opens a

Callers 1

test_extraction.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected