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

Function tokenize_path

src/pipeline/fqn.c:88–105  ·  view source on GitHub ↗

Tokenize path by '/' into segments array. Returns number of segments added. */

Source from the content-addressed store, hash-verified

86
87/* Tokenize path by '/' into segments array. Returns number of segments added. */
88static int tokenize_path(char *path, const char **segments, int max_segs) {
89 int count = 0;
90 if (path[0] == '\0') {
91 return 0;
92 }
93 char *tok = path;
94 while (tok && *tok && count < max_segs) {
95 char *slash = strchr(tok, '/');
96 if (slash) {
97 *slash = '\0';
98 }
99 if (tok[0] != '\0') {
100 segments[count++] = tok;
101 }
102 tok = slash ? slash + SKIP_ONE : NULL;
103 }
104 return count;
105}
106
107/* Strip __init__ (Python) / index (JS/TS) from the last segment when a
108 * symbol name is provided. Keeps it when no name is given to avoid QN

Callers 1

cbm_pipeline_fqn_computeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected