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

Function path_dirname

src/pipeline/pass_pkgmap.c:146–152  ·  view source on GitHub ↗

Get the directory part of a relative path (without trailing slash). * Returns heap-allocated string. For "foo.json" returns "". */

Source from the content-addressed store, hash-verified

144/* Get the directory part of a relative path (without trailing slash).
145 * Returns heap-allocated string. For "foo.json" returns "". */
146static char *path_dirname(const char *rel_path) {
147 const char *last = strrchr(rel_path, '/');
148 if (!last) {
149 return strdup("");
150 }
151 return cbm_strndup(rel_path, (size_t)(last - rel_path));
152}
153
154/* Strip file extension from a path. Returns heap-allocated string.
155 * "src/index.ts" → "src/index", "lib/main" → "lib/main" */

Callers 11

parse_package_jsonFunction · 0.85
parse_go_modFunction · 0.85
build_entry_pathFunction · 0.85
parse_composer_jsonFunction · 0.85
parse_pubspec_yamlFunction · 0.85
parse_pom_xmlFunction · 0.85
parse_build_gradleFunction · 0.85
parse_mix_exsFunction · 0.85
parse_gemspecFunction · 0.85
resolve_header_includeFunction · 0.85
resolve_sibling_fileFunction · 0.85

Calls 1

cbm_strndupFunction · 0.85

Tested by

no test coverage detected