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

Function contains_segment

internal/cbm/service_patterns.c:680–693  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

678}
679
680static bool contains_segment(const char *path, const char *segment) {
681 if (!path || !segment) {
682 return false;
683 }
684 size_t seg_len = strlen(segment);
685 const char *p = path;
686 while ((p = strchr(p, '/')) != NULL) {
687 p++;
688 if (strncmp(p, segment, seg_len) == 0 && (p[seg_len] == '\0' || p[seg_len] == '/')) {
689 return true;
690 }
691 }
692 return false;
693}
694
695static bool has_http_route_marker(const char *path) {
696 if (starts_with_segment(path, "api") || starts_with_segment(path, "apis") ||

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected