PHP: composer.json — name + PSR-4 autoload */
| 471 | |
| 472 | /* PHP: composer.json — name + PSR-4 autoload */ |
| 473 | static void parse_composer_json(const char *source, int source_len, const char *rel_path, |
| 474 | cbm_pkg_entries_t *entries) { |
| 475 | yyjson_doc *doc = yyjson_read(source, (size_t)source_len, 0); |
| 476 | if (!doc) { |
| 477 | return; |
| 478 | } |
| 479 | yyjson_val *root = yyjson_doc_get_root(doc); |
| 480 | if (!yyjson_is_obj(root)) { |
| 481 | yyjson_doc_free(doc); |
| 482 | return; |
| 483 | } |
| 484 | |
| 485 | char *dir = path_dirname(rel_path); |
| 486 | |
| 487 | /* Register package name → directory */ |
| 488 | yyjson_val *name_val = yyjson_obj_get(root, "name"); |
| 489 | if (yyjson_is_str(name_val)) { |
| 490 | const char *name = yyjson_get_str(name_val); |
| 491 | if (name && name[0] != '\0') { |
| 492 | pkg_entries_push(entries, strdup(name), strdup(dir)); |
| 493 | } |
| 494 | } |
| 495 | |
| 496 | extract_psr4(root, dir, entries); |
| 497 | |
| 498 | free(dir); |
| 499 | yyjson_doc_free(doc); |
| 500 | } |
| 501 | |
| 502 | /* Dart: pubspec.yaml — name */ |
| 503 | static void parse_pubspec_yaml(const char *source, int source_len, const char *rel_path, |
no test coverage detected