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

Function is_pkgmap_manifest_basename

src/pipeline/pass_pkgmap.c:1037–1050  ·  view source on GitHub ↗

Returns true if basename is a package manifest we know how to parse. * Used by the filesystem walker; cbm_pkgmap_try_parse is the source of * truth for which basenames produce entries. */

Source from the content-addressed store, hash-verified

1035 * Used by the filesystem walker; cbm_pkgmap_try_parse is the source of
1036 * truth for which basenames produce entries. */
1037static bool is_pkgmap_manifest_basename(const char *basename) {
1038 if (!basename) {
1039 return false;
1040 }
1041 if (strcmp(basename, "package.json") == 0 || strcmp(basename, "go.mod") == 0 ||
1042 strcmp(basename, "Cargo.toml") == 0 || strcmp(basename, "pyproject.toml") == 0 ||
1043 strcmp(basename, "composer.json") == 0 || strcmp(basename, "pubspec.yaml") == 0 ||
1044 strcmp(basename, "pom.xml") == 0 || strcmp(basename, "build.gradle") == 0 ||
1045 strcmp(basename, "build.gradle.kts") == 0 || strcmp(basename, "mix.exs") == 0 ||
1046 strcmp(basename, "Package.swift") == 0) {
1047 return true;
1048 }
1049 return ends_with(basename, ".gemspec");
1050}
1051
1052/* Stat a path, skipping symlinks. Returns 0 on success, -1 to skip.
1053 * On POSIX, lstat + S_ISLNK avoids following symlink cycles. On Windows

Callers 3

pkgmap_walk_dirFunction · 0.85

Calls 1

ends_withFunction · 0.70

Tested by

no test coverage detected