X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Flookup_table.c;h=2a313060ef357717af18ed8f7087209e34d43a41;hp=998eb185f1586e8af2791a58d9bb11fd82247cc9;hb=e8c3ca2d1d0cac3d64985b45a9f654d2029a7518;hpb=726f9bbd0bd664294fce8a50be1d5b6881df8d16 diff --git a/src/lookup_table.c b/src/lookup_table.c index 998eb185..2a313060 100644 --- a/src/lookup_table.c +++ b/src/lookup_table.c @@ -24,16 +24,28 @@ * along with wimlib; if not, see http://www.gnu.org/licenses/. */ -#include "wimlib_internal.h" -#include "lookup_table.h" -#include "buffer_io.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "wimlib/buffer_io.h" +#include "wimlib/error.h" +#include "wimlib/file_io.h" +#include "wimlib/lookup_table.h" +#include "wimlib/metadata.h" +#include "wimlib/paths.h" +#include "wimlib/resource.h" +#include "wimlib/util.h" + #include #include - #ifdef WITH_FUSE -#include +# include /* for unlink() */ #endif +/* Size of each lookup table entry in the WIM file. */ +#define WIM_LOOKUP_TABLE_ENTRY_DISK_SIZE 50 + struct wim_lookup_table * new_lookup_table(size_t capacity) { @@ -58,7 +70,7 @@ new_lookup_table(size_t capacity) } struct wim_lookup_table_entry * -new_lookup_table_entry() +new_lookup_table_entry(void) { struct wim_lookup_table_entry *lte; @@ -824,6 +836,19 @@ out: } #endif +/* + * XXX Probably should store the compression type directly in the lookup table + * entry + */ +int +wim_resource_compression_type(const struct wim_lookup_table_entry *lte) +{ + if (!(lte->resource_entry.flags & WIM_RESHDR_FLAG_COMPRESSED) + || lte->resource_location != RESOURCE_IN_WIM) + return WIMLIB_COMPRESSION_TYPE_NONE; + return wimlib_get_compression_type(lte->wim); +} + /* Resolve an inode's lookup table entries * * This replaces the SHA1 hash fields (which are used to lookup an entry in the