From 55d4d6adc4c7e9e849229b24bcf75910d548ff44 Mon Sep 17 00:00:00 2001 From: Thorsten Töpper Date: Sat, 28 Feb 2026 22:01:40 +0100 Subject: dump: fullpath and fileinfos --- src/duplicate_finder.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'src/duplicate_finder.c') diff --git a/src/duplicate_finder.c b/src/duplicate_finder.c index c6843f0..51bac49 100644 --- a/src/duplicate_finder.c +++ b/src/duplicate_finder.c @@ -16,6 +16,7 @@ */ #include +#include #include "trace_macros.h" #include "options.h" @@ -30,6 +31,8 @@ /*=========== FUNCTIONS ===========*/ int analyze_db_content(); int scan (const char *path); +int dump(int argc, char **argv, int pos); + /** * The wrapper around automated DB content analysis. @@ -71,9 +74,46 @@ int analyze_db_content() { } +/** + * dump requested database content + * @param argv argv array from main() + * @param pos The position where to begin in the array + * @param argc The array size from main() + * + * @return EXIT_SUCCESS on success + * EXIT_FAILURE on failure + */ +int dump(int argc, char **argv, int pos) { + int i = pos; + + if (pos >= argc) { + LOGERR("ERROR: Missing parameter\n"); + return EXIT_FAILURE; + } + + if ( ! dbi_open(option_sqlite_db_name) ) { + return EXIT_FAILURE; + } + + for (i=pos; i