| 440 | } |
| 441 | |
| 442 | static void fl_add(file_list_t *fl, const char *abs_path, const char *rel_path, CBMLanguage lang, |
| 443 | int64_t size) { |
| 444 | if (fl->count >= fl->capacity) { |
| 445 | int new_cap = fl->capacity ? fl->capacity * PAIR_LEN : CBM_SZ_256; |
| 446 | cbm_file_info_t *new_files = realloc(fl->files, new_cap * sizeof(cbm_file_info_t)); |
| 447 | if (!new_files) { |
| 448 | return; |
| 449 | } |
| 450 | fl->files = new_files; |
| 451 | fl->capacity = new_cap; |
| 452 | } |
| 453 | |
| 454 | cbm_file_info_t *fi = &fl->files[fl->count++]; |
| 455 | fi->path = strdup(abs_path); |
| 456 | fi->rel_path = strdup(rel_path); |
| 457 | fi->language = lang; |
| 458 | fi->size = size; |
| 459 | } |
| 460 | |
| 461 | /* ── Recursive walk ─────────────────────────────── */ |
| 462 |
no outgoing calls
no test coverage detected