- sl_t *holding_files;
- sle_t *he;
- sl_t *matching_files = new_sl();
-
- holding_set_verbosity(0);
- holding_files = holding_get_files(NULL, NULL, 1);
-
- for (he = holding_files->first; he != NULL; he = he->next) {
- filetype = holding_file_read_header(he->name, &host, &disk, NULL, &datestamp);
- if (filetype != F_DUMPFILE) continue;
- for (de = (dumpspec_t *)dumpspec_list; de != NULL; de = de->next) {
- if (de->host && !match_host(de->host, host)) continue;
- if (de->disk && !match_disk(de->disk, disk)) continue;
- if (de->datestamp && !match_datestamp(de->datestamp, datestamp)) continue;
- matching_files = insert_sort_sl(matching_files, he->name);
+ GSList *li, *hi;
+ GSList *holding_files;
+ GSList *matching_files = NULL;
+ dumpfile_t file;
+
+ holding_files = holding_get_files(NULL, 1);
+
+ for (hi = holding_files; hi != NULL; hi = hi->next) {
+ /* TODO add level */
+ if (!holding_file_get_dumpfile((char *)hi->data, &file)) continue;
+ if (file.type != F_DUMPFILE) {
+ dumpfile_free_data(&file);
+ continue;
+ }
+ for (li = dumpspec_list; li != NULL; li = li->next) {
+ de = (dumpspec_t *)(li->data);
+ if (de->host && de->host[0] && !match_host(de->host, file.name)) continue;
+ if (de->disk && de->disk[0] && !match_disk(de->disk, file.disk)) continue;
+ if (de->datestamp && de->datestamp[0] && !match_datestamp(de->datestamp, file.datestamp)) continue;
+ matching_files = g_slist_append(matching_files, g_strdup((char *)hi->data));