Take dependencies out of file_extract.h

This commit is contained in:
twinaphex 2015-03-28 18:09:40 +01:00
parent 84b9898934
commit ed933aab05
3 changed files with 26 additions and 26 deletions

View File

@ -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;
}

View File

@ -21,14 +21,6 @@
#include <stddef.h>
#include <stdint.h>
#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,

View File

@ -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 <kernel/image.h>
#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;
}