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

Function cbm_service_pattern_match

internal/cbm/service_patterns.c:1118–1156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1116}
1117
1118cbm_svc_kind_t cbm_service_pattern_match(const char *resolved_qn) {
1119 if (!resolved_qn || !resolved_qn[0]) {
1120 return CBM_SVC_NONE;
1121 }
1122
1123 if (_svc_cache) {
1124 void *cached = cbm_ht_get(_svc_cache, resolved_qn);
1125 if (cached) {
1126 return svc_ptr_to_enum(cached);
1127 }
1128 }
1129
1130 cbm_svc_kind_t result = CBM_SVC_NONE;
1131 const lib_pattern_t *p;
1132
1133 /* Route registration checked first — prevents gin/echo from matching
1134 * as HTTP clients (both have .get/.post suffixes). */
1135 if ((p = match_qn(resolved_qn, route_reg_libraries)))
1136 result = p->kind;
1137 else if ((p = match_qn(resolved_qn, http_libraries)))
1138 result = p->kind;
1139 else if ((p = match_qn(resolved_qn, async_libraries)))
1140 result = p->kind;
1141 else if ((p = match_qn(resolved_qn, config_libraries)))
1142 result = p->kind;
1143 else if ((p = match_qn(resolved_qn, grpc_libraries)))
1144 result = p->kind;
1145 else if ((p = match_qn(resolved_qn, graphql_libraries)))
1146 result = p->kind;
1147 else if ((p = match_qn(resolved_qn, trpc_libraries)))
1148 result = p->kind;
1149
1150 if (_svc_cache) {
1151 char *kdup = strdup(resolved_qn);
1152 if (kdup)
1153 cbm_ht_set(_svc_cache, kdup, svc_enum_to_ptr(result));
1154 }
1155 return result;
1156}
1157
1158const char *cbm_service_pattern_http_method(const char *callee_name) {
1159 if (!callee_name) {

Callers 10

url_context_getFunction · 0.85
emit_classified_edgeFunction · 0.85
resolve_single_callFunction · 0.85
detect_url_in_argsFunction · 0.85
emit_service_edgeFunction · 0.85
emit_xlang_refused_routeFunction · 0.85
resolve_file_callsFunction · 0.85
svc_case_mismatchesFunction · 0.85

Calls 5

cbm_ht_getFunction · 0.85
svc_ptr_to_enumFunction · 0.85
match_qnFunction · 0.85
cbm_ht_setFunction · 0.85
svc_enum_to_ptrFunction · 0.85

Tested by 1

svc_case_mismatchesFunction · 0.68