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