/* if file is not DUPE_CANDIDATE then send it to session->tables->other_lint and * return 1; else return 0 */ static gboolean rm_pp_handle_other_lint(RmFile *file, const RmSession *session) { if(file->lint_type == RM_LINT_TYPE_DUPE_CANDIDATE) { return FALSE; } if(session->cfg->filter_mtime && file->mtime < session->cfg->min_mtime) { rm_file_destroy(file); } else if((session->cfg->keep_all_tagged && file->is_prefd) || (session->cfg->keep_all_untagged && !file->is_prefd)) { /* "Other" lint protected by --keep-all-{un,}tagged */ rm_file_destroy(file); } else { session->tables->other_lint[file->lint_type] = g_list_prepend(session->tables->other_lint[file->lint_type], file); } return TRUE; }
int rm_tm_destroy_iter(_U RmTrie *self, RmNode *node, _U int level, _U void *user_data) { RmDirectory *directory = node->data; for(GList *iter = directory->known_files.head; iter; iter = iter->next) { rm_file_destroy((RmFile *)iter->data); } rm_directory_free(directory); return 0; }
void rm_file_tables_clear(const RmSession *session) { GHashTableIter iter; gpointer key; g_hash_table_iter_init(&iter, session->tables->node_table); while(g_hash_table_iter_next(&iter, &key, NULL)) { RmFile *file = key; if(file) { rm_file_destroy(file); } } }
static gboolean rm_pp_check_path_double(RmFile *file, GHashTable *unique_paths_table) { RmPathDoubleKey *key = rm_path_double_new(file); /* Lookup if there is a file with the same path */ RmPathDoubleKey *match_double_key = g_hash_table_lookup(unique_paths_table, key); if(match_double_key == NULL) { g_hash_table_add(unique_paths_table, key); return FALSE; } RmFile *match_double = match_double_key->file; rm_assert_gentle(match_double != file); rm_path_double_free(key); rm_file_destroy(file); return TRUE; }