| 947 | /* ── Public: manifest detection + parsing ──────────────────────── */ |
| 948 | |
| 949 | bool cbm_pkgmap_try_parse(const char *basename, const char *rel_path, const char *source, |
| 950 | int source_len, cbm_pkg_entries_t *entries) { |
| 951 | if (!basename || !source || source_len <= 0) { |
| 952 | return false; |
| 953 | } |
| 954 | |
| 955 | if (strcmp(basename, "package.json") == 0) { |
| 956 | parse_package_json(source, source_len, rel_path, entries); |
| 957 | return true; |
| 958 | } |
| 959 | if (strcmp(basename, "go.mod") == 0) { |
| 960 | parse_go_mod(source, source_len, rel_path, entries); |
| 961 | return true; |
| 962 | } |
| 963 | if (strcmp(basename, "Cargo.toml") == 0) { |
| 964 | parse_cargo_toml(source, source_len, rel_path, entries); |
| 965 | return true; |
| 966 | } |
| 967 | if (strcmp(basename, "pyproject.toml") == 0) { |
| 968 | parse_pyproject_toml(source, source_len, rel_path, entries); |
| 969 | return true; |
| 970 | } |
| 971 | if (strcmp(basename, "composer.json") == 0) { |
| 972 | parse_composer_json(source, source_len, rel_path, entries); |
| 973 | return true; |
| 974 | } |
| 975 | if (strcmp(basename, "pubspec.yaml") == 0) { |
| 976 | parse_pubspec_yaml(source, source_len, rel_path, entries); |
| 977 | return true; |
| 978 | } |
| 979 | if (strcmp(basename, "pom.xml") == 0) { |
| 980 | parse_pom_xml(source, source_len, rel_path, entries); |
| 981 | return true; |
| 982 | } |
| 983 | if (strcmp(basename, "build.gradle") == 0 || strcmp(basename, "build.gradle.kts") == 0) { |
| 984 | parse_build_gradle(source, source_len, rel_path, entries); |
| 985 | return true; |
| 986 | } |
| 987 | if (strcmp(basename, "mix.exs") == 0) { |
| 988 | parse_mix_exs(source, source_len, rel_path, entries); |
| 989 | return true; |
| 990 | } |
| 991 | if (ends_with(basename, ".gemspec")) { |
| 992 | parse_gemspec(source, source_len, rel_path, entries); |
| 993 | return true; |
| 994 | } |
| 995 | if (strcmp(basename, "Package.swift") == 0) { |
| 996 | parse_package_swift(source, source_len, rel_path, entries); |
| 997 | return true; |
| 998 | } |
| 999 | return false; |
| 1000 | } |
| 1001 | |
| 1002 | /* ── Merge: per-worker entries → hash table ────────────────────── */ |
| 1003 |
no test coverage detected