aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/duplicate_finder.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/duplicate_finder.c b/src/duplicate_finder.c
index bd679e9..714fd96 100644
--- a/src/duplicate_finder.c
+++ b/src/duplicate_finder.c
@@ -21,7 +21,7 @@
#include "options.h"
#include "kv_manager.h"
#include "directory_scanner.h"
-
+#include "database_interaction.h"
/*=========== DEFINES, CONSTANTS AND TYPES ===========*/
@@ -36,13 +36,28 @@ int main(int argc, char **argv) {
path_index = parse_arguments(argc, argv);
}
- /* TODO: as option */
- kv_open_storage("/tmp/duplicate_finder.gdbm");
- process_directory((path_index == argc) ? argv[path_index] : ".");
+ /* TODO: name as option */
+ if ( ! kv_open_storage("/tmp/duplicate_finder.gdbm") ) {
+ return EXIT_FAILURE;
+ }
+
+ /* TODO: name as option */
+ dbi_open("/tmp/duplicate_finder.sqlite");
+ traverse_directory_tree((path_index == argc) ? argv[path_index] : ".");
+
+#ifdef DEBUGBUILD
+ kv_dump(stdout);
+#endif
+
+ process_gdbm_content();
+#ifdef DEBUGBUILD
kv_dump(stdout);
+#endif
+ /* TODO: Implement signal handlers and add the close for sqlite and gdbm dbs there */
kv_close_storage();
+ dbi_close();
return EXIT_SUCCESS;
}