]> wimlib.net Git - wimlib/blobdiff - include/wimlib/wim.h
Add support for unsafe in-place compaction of WIM files
[wimlib] / include / wimlib / wim.h
index cb330a21fed44e9f316d2428567271e3ab4f2f0c..4cf6779f93830cf4227773b046f87de5130b1983 100644 (file)
@@ -11,7 +11,7 @@
 #include "wimlib/list.h"
 
 struct wim_image_metadata;
 #include "wimlib/list.h"
 
 struct wim_image_metadata;
-struct wim_info;
+struct wim_xml_info;
 struct blob_table;
 
 /*
 struct blob_table;
 
 /*
@@ -42,10 +42,14 @@ struct WIMStruct {
 
        /* Information from the header of the WIM file.
         *
 
        /* Information from the header of the WIM file.
         *
-        * This is also maintained for a WIMStruct not backed by a file, but the
-        * 'reshdr' fields have no meaning.  */
+        * This is also maintained for a WIMStruct not backed by a file, but in
+        * that case the 'reshdr' fields are left zeroed.  */
        struct wim_header hdr;
 
        struct wim_header hdr;
 
+       /* If the library is currently writing this WIMStruct out to a file,
+        * then this is the header being created for that file.  */
+       struct wim_header out_hdr;
+
        /* Array of image metadata, one for each image in the WIM (array length
         * hdr.image_count).  Or, this will be NULL if this WIM does not contain
         * metadata, which implies that this WIMStruct either represents part of
        /* Array of image metadata, one for each image in the WIM (array length
         * hdr.image_count).  Or, this will be NULL if this WIM does not contain
         * metadata, which implies that this WIMStruct either represents part of
@@ -55,7 +59,7 @@ struct WIMStruct {
 
        /* Information from the XML data of the WIM file.  This information is
         * also maintained for a WIMStruct not backed by a file.  */
 
        /* Information from the XML data of the WIM file.  This information is
         * also maintained for a WIMStruct not backed by a file.  */
-       struct wim_info *wim_info;
+       struct wim_xml_info *xml_info;
 
        /* The blob table for this WIMStruct.  If this WIMStruct has a backing
         * file, then this table will index the blobs contained in that file.
 
        /* The blob table for this WIMStruct.  If this WIMStruct has a backing
         * file, then this table will index the blobs contained in that file.
@@ -120,6 +124,10 @@ struct WIMStruct {
        /* 1 if the WIM file has been locked for appending, otherwise 0  */
        u8 locked_for_append : 1;
 
        /* 1 if the WIM file has been locked for appending, otherwise 0  */
        u8 locked_for_append : 1;
 
+       /* 1 if the WIM file is currently being compacted by wimlib_overwrite()
+        * with WIMLIB_WRITE_FLAG_UNSAFE_COMPACT  */
+       u8 being_compacted : 1;
+
        /* If this WIM is backed by a file, then this is the compression type
         * for non-solid resources in that file.  */
        u8 compression_type;
        /* If this WIM is backed by a file, then this is the compression type
         * for non-solid resources in that file.  */
        u8 compression_type;
@@ -185,21 +193,12 @@ static inline bool wim_is_pipable(const WIMStruct *wim)
 extern bool
 wim_has_solid_resources(const WIMStruct *wim);
 
 extern bool
 wim_has_solid_resources(const WIMStruct *wim);
 
-extern int
-set_wim_hdr_cflags(int ctype, struct wim_header *hdr);
-
-extern int
-init_wim_header(struct wim_header *hdr, int ctype, u32 chunk_size);
-
 extern int
 read_wim_header(WIMStruct *wim, struct wim_header *hdr);
 
 extern int
 extern int
 read_wim_header(WIMStruct *wim, struct wim_header *hdr);
 
 extern int
-write_wim_header(const struct wim_header *hdr, struct filedes *out_fd);
-
-extern int
-write_wim_header_at_offset(const struct wim_header *hdr, struct filedes *out_fd,
-                          off_t offset);
+write_wim_header(const struct wim_header *hdr, struct filedes *out_fd,
+                off_t offset);
 
 extern int
 write_wim_header_flags(u32 hdr_flags, struct filedes *out_fd);
 
 extern int
 write_wim_header_flags(u32 hdr_flags, struct filedes *out_fd);