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

Function member_node_at

src/pipeline/doc_links_cs.c:2121–2135  ·  view source on GitHub ↗

The node a member's own qualified name has, when it is one a reference to * a member of this kind can bind. */

Source from the content-addressed store, hash-verified

2119/* The node a member's own qualified name has, when it is one a reference to
2120 * a member of this kind can bind. */
2121static const cbm_gbuf_node_t *member_node_at(const cbm_gbuf_t *g, const cs_member_t *m, char *qn,
2122 size_t type_len, size_t cap) {
2123 size_t nl = strlen(m->name);
2124 if (m->kind == 'o' || m->kind == 'x' || type_len + nl + PAIR_LEN > cap) {
2125 return NULL; /* operators and indexers have no node */
2126 }
2127 qn[type_len] = '.';
2128 memcpy(qn + type_len + SKIP_ONE, m->name, nl + SKIP_ONE);
2129 const cbm_gbuf_node_t *n = cbm_gbuf_find_by_qn(g, qn);
2130 qn[type_len] = '\0';
2131 if (!n) {
2132 return NULL;
2133 }
2134 return (m->kind == 'c' ? label_is_callable(n->label) : label_is_value(n->label)) ? n : NULL;
2135}
2136
2137/* Scratch tables of the node pass: emptied for every file. */
2138typedef struct {

Callers 1

bind_nodesFunction · 0.85

Calls 3

cbm_gbuf_find_by_qnFunction · 0.85
label_is_callableFunction · 0.85
label_is_valueFunction · 0.85

Tested by

no test coverage detected