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

Function path_dirname

src/pipeline/pass_pkgmap.c:142–148  ·  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

140/* Get the directory part of a relative path (without trailing slash).
141 * Returns heap-allocated string. For "foo.json" returns "". */
142static char *path_dirname(const char *rel_path) {
143 const char *last = strrchr(rel_path, '/');
144 if (!last) {
145 return strdup("");
146 }
147 return cbm_strndup(rel_path, (size_t)(last - rel_path));
148}
149
150/* Strip file extension from a path. Returns heap-allocated string.
151 * "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