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

Function aligned_member_qn

src/pipeline/registry.c:2053–2069  ·  view source on GitHub ↗

Namespace/path alignment: the one " . " candidate that sits * where its namespace says. NULL when none or several do. */

Source from the content-addressed store, hash-verified

2051/* Namespace/path alignment: the one "<Class>.<member>" candidate that sits
2052 * where its namespace says. NULL when none or several do. */
2053static const char *aligned_member_qn(const cbm_registry_t *r, const char *fqn, size_t ns_len,
2054 const char *cls, size_t cls_len, const char *member) {
2055 const qn_array_t *arr = cbm_ht_get(r->by_name, member);
2056 const char *match = NULL;
2057 for (int i = 0; arr && i < arr->count; i++) {
2058 const char *qn = arr->items[i];
2059 int tail = qn_class_member_tail(qn, cls, cls_len, member);
2060 if (tail == CBM_NOT_FOUND || !namespace_matches_dirs(qn, tail, fqn, ns_len)) {
2061 continue;
2062 }
2063 if (match) {
2064 return NULL; /* ambiguous */
2065 }
2066 match = qn;
2067 }
2068 return match;
2069}
2070
2071cbm_resolution_t cbm_registry_resolve_handler(const cbm_registry_t *r, const char *handler_ref,
2072 const char *module_qn, const char **import_map_keys,

Callers 1

Calls 3

cbm_ht_getFunction · 0.85
qn_class_member_tailFunction · 0.85
namespace_matches_dirsFunction · 0.85

Tested by

no test coverage detected