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

Function cbm_misnested_raw_parent

internal/cbm/cbm.c:2211–2223  ·  view source on GitHub ↗

The raw type def whose QN is `r`'s scope (`scope_len` bytes of r's QN) and * whose span holds r, or NULL. */

Source from the content-addressed store, hash-verified

2209/* The raw type def whose QN is `r`'s scope (`scope_len` bytes of r's QN) and
2210 * whose span holds r, or NULL. */
2211static const CBMDefinition *cbm_misnested_raw_parent(const CBMDefinition *defs, int raw_count,
2212 const CBMDefinition *r, size_t scope_len) {
2213 for (int k = 0; k < raw_count; k++) {
2214 const CBMDefinition *p = &defs[k];
2215 if (p != r && p->qualified_name && p->name && cbm_def_label_is_type(p->label) &&
2216 p->start_line <= r->start_line && p->end_line >= r->end_line &&
2217 strncmp(p->qualified_name, r->qualified_name, scope_len) == 0 &&
2218 p->qualified_name[scope_len] == '\0') {
2219 return p;
2220 }
2221 }
2222 return NULL;
2223}
2224
2225/* Index just past a preprocessor directive starting at `i` (its continuation
2226 * lines included), and the lines it spans added to *line. */

Callers 1

cbm_misnested_raw_twinFunction · 0.85

Calls 1

cbm_def_label_is_typeFunction · 0.85

Tested by

no test coverage detected