]> wimlib.net Git - wimlib/blobdiff - include/wimlib/resource.h
WIMBoot: Update WimOverlay.dat directly when WOF not running
[wimlib] / include / wimlib / resource.h
index 3b863f4654d66d1146c6070e42cd79810ddc1c1b..2eab7bee0cd0a04c7f3c03834cbfa1f058dff628 100644 (file)
@@ -52,6 +52,13 @@ struct wim_resource_spec {
 
        /* Temporary flag.  */
        u32 raw_copy_ok : 1;
+
+       /* Compression type of this resource.  */
+       u32 compression_type : 22;
+
+       /* Compression chunk size of this resource.  Irrelevant if the resource
+        * is uncompressed.  */
+       u32 chunk_size;
 };
 
 /* On-disk version of a WIM resource header.  */
@@ -170,6 +177,15 @@ struct alt_chunk_table_header_disk {
         * the chunks (4 bytes per entry).  */
 } _packed_attribute;
 
+static inline unsigned int
+get_chunk_entry_size(u64 res_size, bool is_alt)
+{
+       if (res_size <= UINT32_MAX || is_alt)
+               return 4;
+       else
+               return 8;
+}
+
 /* Functions to read streams  */
 
 extern int
@@ -187,6 +203,10 @@ extern int
 wim_reshdr_to_data(const struct wim_reshdr *reshdr,
                   WIMStruct *wim, void **buf_ret);
 
+extern int
+wim_reshdr_to_hash(const struct wim_reshdr *reshdr, WIMStruct *wim,
+                  u8 hash[SHA1_HASH_SIZE]);
+
 extern int
 skip_wim_stream(struct wim_lookup_table_entry *lte);