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

Function match_qn

internal/cbm/service_patterns.c:541–551  ·  view source on GitHub ↗

Check if any library identifier appears as a substring in the QN. * Case-sensitive: "requests" matches "project.venv.requests.api.get" * but not "Requests". Library names are specific enough to avoid * false positives even with substring matching. */

Source from the content-addressed store, hash-verified

539 * but not "Requests". Library names are specific enough to avoid
540 * false positives even with substring matching. */
541static const lib_pattern_t *match_qn(const char *qn, const lib_pattern_t *patterns) {
542 if (!qn || !qn[0]) {
543 return NULL;
544 }
545 for (int i = 0; patterns[i].library_id != NULL; i++) {
546 if (strstr(qn, patterns[i].library_id) != NULL) {
547 return &patterns[i];
548 }
549 }
550 return NULL;
551}
552
553static bool starts_with_segment(const char *path, const char *segment) {
554 if (!path || path[0] != '/' || !segment) {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected