]> wimlib.net Git - wimlib/blobdiff - include/wimlib/lookup_table.h
update; add lzms_decompress() stub
[wimlib] / include / wimlib / lookup_table.h
index b5b3830fcbde38ac13ee876aaec39ccf23aaf753..a22ed3d1b0c4c490221b8b815fe1dc4d65b0a43b 100644 (file)
@@ -115,10 +115,10 @@ struct wim_lookup_table_entry {
        struct hlist_node hash_list;
 
        /* Uncompressed size of the stream.  */
-       u64 size : 56;
+       u64 size;
 
        /* Stream flags (WIM_RESHDR_FLAG_*).  */
-       u64 flags : 8;
+       u16 flags : 8;
 
        /* One of the `enum resource_location' values documented above. */
        u16 resource_location : 5;
@@ -185,7 +185,10 @@ struct wim_lookup_table_entry {
        /* Pointers to somewhere where the stream is actually located.  See the
         * comments for the @resource_location field above. */
        union {
-               struct wim_resource_spec *rspec;
+               struct {
+                       struct wim_resource_spec *rspec;
+                       u64 offset_in_res;
+               };
                tchar *file_on_disk;
                void *attached_buffer;
        #ifdef WITH_FUSE
@@ -283,6 +286,13 @@ lte_cchunk_size(const struct wim_lookup_table_entry * lte)
                return 32768;
 }
 
+static inline bool
+lte_is_partial(const struct wim_lookup_table_entry * lte)
+{
+       return lte->resource_location == RESOURCE_IN_WIM &&
+              lte->size != lte->rspec->uncompressed_size;
+}
+
 static inline bool
 lte_filename_valid(const struct wim_lookup_table_entry *lte)
 {
@@ -388,9 +398,7 @@ lte_bind_wim_resource_spec(struct wim_lookup_table_entry *lte,
 {
        lte->resource_location = RESOURCE_IN_WIM;
        lte->rspec = rspec;
-       list_add(&lte->wim_resource_list, &rspec->lte_list);
-       lte->flags = rspec->flags;
-       lte->size = rspec->uncompressed_size;
+       list_add_tail(&lte->wim_resource_list, &rspec->lte_list);
 }
 
 static inline void