From f8f3159f9b98b024043bd8de2c5e15dd2adf03ca Mon Sep 17 00:00:00 2001 From: nirav Date: Sat, 20 Oct 2018 18:47:23 +0530 Subject: Switched to gtk_init and gtk_main from gtk_application --- src/file.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/file.c') diff --git a/src/file.c b/src/file.c index 3a6b005..423725c 100644 --- a/src/file.c +++ b/src/file.c @@ -1,6 +1,5 @@ #define _DEFAULT_SOURCE -#include "file.h" -#include "image.h" + #include #include #include @@ -9,6 +8,9 @@ #include #include +#include "file.h" +#include "image.h" + static int curr_file_index, file_list_count; static char **file_list; static char **extensions = NULL; @@ -69,14 +71,15 @@ int image_filter(const struct dirent *dir) return 0; } -int scan(const char *file_name) +void scan(const char *file_name) { scan_supported_formats(); struct dirent **name_list; char *dir_name = dirname(strdup(file_name)); file_list_count = scandir(dir_name, &name_list, image_filter, alphasort); if (file_list_count < 0) { - return -1; + g_printerr("failed to read direcory %s for image files", dir_name); + return; } file_list = malloc(file_list_count * sizeof(char *)); @@ -90,8 +93,6 @@ int scan(const char *file_name) i++; } free(name_list); - - return 0; } void next_file() -- cgit v1.2.3