diff --git a/file_extract.c b/file_extract.c index d2f0025702..232f475558 100644 --- a/file_extract.c +++ b/file_extract.c @@ -570,21 +570,3 @@ struct string_list *zlib_get_file_list(const char *path, const char *valid_exts) return list; } - -struct string_list *compressed_file_list_new(const char *path, - const char* ext) -{ -#ifdef HAVE_COMPRESSION - const char* file_ext = path_get_extension(path); -#ifdef HAVE_7ZIP - if (strcasecmp(file_ext,"7z") == 0) - return compressed_7zip_file_list_new(path,ext); -#endif -#ifdef HAVE_ZLIB - if (strcasecmp(file_ext,"zip") == 0) - return zlib_get_file_list(path, ext); -#endif - -#endif - return NULL; -} diff --git a/file_extract.h b/file_extract.h index f6e5c0caf6..cc20eeb8a2 100644 --- a/file_extract.h +++ b/file_extract.h @@ -21,14 +21,6 @@ #include #include -#ifdef HAVE_7ZIP -#include "decompress/7zip_support.h" -#endif - -#ifdef HAVE_ZLIB -#include "decompress/zip_support.h" -#endif - /* Returns true when parsing should continue. False to stop. */ typedef int (*zlib_file_cb)(const char *name, const char *valid_exts, const uint8_t *cdata, unsigned cmode, uint32_t csize, uint32_t size, diff --git a/file_ops.c b/file_ops.c index 5cd31e952e..6a9a13ed7a 100644 --- a/file_ops.c +++ b/file_ops.c @@ -29,6 +29,14 @@ #include "file_extract.h" #endif +#ifdef HAVE_7ZIP +#include "decompress/7zip_support.h" +#endif + +#ifdef HAVE_ZLIB +#include "decompress/zip_support.h" +#endif + #ifdef __HAIKU__ #include #endif @@ -235,3 +243,21 @@ int read_file(const char *path, void **buf, ssize_t *length) #endif return read_generic_file(path, buf, length); } + +struct string_list *compressed_file_list_new(const char *path, + const char* ext) +{ +#ifdef HAVE_COMPRESSION + const char* file_ext = path_get_extension(path); +#ifdef HAVE_7ZIP + if (strcasecmp(file_ext,"7z") == 0) + return compressed_7zip_file_list_new(path,ext); +#endif +#ifdef HAVE_ZLIB + if (strcasecmp(file_ext,"zip") == 0) + return zlib_get_file_list(path, ext); +#endif + +#endif + return NULL; +}