| 338 | /* ── Public filter functions ─────────────────────── */ |
| 339 | |
| 340 | bool cbm_should_skip_dir(const char *dirname, cbm_index_mode_t mode) { |
| 341 | if (!dirname) { |
| 342 | return false; |
| 343 | } |
| 344 | |
| 345 | if (str_in_list(dirname, ALWAYS_SKIP_DIRS)) { |
| 346 | return true; |
| 347 | } |
| 348 | |
| 349 | /* Fast discovery applies to both MODERATE and FAST — only FULL keeps everything. */ |
| 350 | if (mode != CBM_MODE_FULL) { |
| 351 | if (str_in_list(dirname, FAST_SKIP_DIRS)) { |
| 352 | return true; |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | return false; |
| 357 | } |
| 358 | |
| 359 | bool cbm_has_ignored_suffix(const char *filename, cbm_index_mode_t mode) { |
| 360 | if (!filename) { |
no test coverage detected