]> wimlib.net Git - wimlib/blobdiff - include/wimlib/resource.h
mount_image.c: add fallback definitions of RENAME_* constants
[wimlib] / include / wimlib / resource.h
index 05ceed70b88b7b24e96f45296e324698cd14321c..8924b80716232b0e7489fd6ea8d9f7273954323f 100644 (file)
@@ -72,7 +72,7 @@ struct wim_reshdr_disk {
 
        /* Uncompressed size of the resource, in bytes.  */
        le64 uncompressed_size;
-} _packed_attribute;
+} __attribute__((packed));
 
 /* In-memory version of a WIM resource header (`struct wim_reshdr_disk').  */
 struct wim_reshdr {
@@ -119,20 +119,20 @@ zero_reshdr(struct wim_reshdr *reshdr)
        memset(reshdr, 0, sizeof(struct wim_reshdr));
 }
 
-extern void
+void
 wim_reshdr_to_desc(const struct wim_reshdr *reshdr, WIMStruct *wim,
                   struct wim_resource_descriptor *rdesc);
 
-extern void
+void
 wim_reshdr_to_desc_and_blob(const struct wim_reshdr *reshdr, WIMStruct *wim,
                            struct wim_resource_descriptor *rdesc,
                            struct blob_descriptor *blob);
 
-extern void
+void
 get_wim_reshdr(const struct wim_reshdr_disk *disk_reshdr,
               struct wim_reshdr *reshdr);
 
-extern void
+void
 put_wim_reshdr(const struct wim_reshdr *reshdr,
               struct wim_reshdr_disk *disk_reshdr);
 
@@ -158,7 +158,7 @@ struct alt_chunk_table_header_disk {
 
        /* This header is directly followed by a table of compressed sizes of
         * the chunks (4 bytes per entry).  */
-} _packed_attribute;
+} __attribute__((packed));
 
 static inline unsigned int
 get_chunk_entry_size(u64 res_size, bool is_alt)
@@ -171,25 +171,25 @@ get_chunk_entry_size(u64 res_size, bool is_alt)
 
 /* Functions to read blobs  */
 
-extern int
+int
 read_partial_wim_blob_into_buf(const struct blob_descriptor *blob,
                               u64 offset, size_t size, void *buf);
 
-extern int
+int
 read_blob_into_buf(const struct blob_descriptor *blob, void *buf);
 
-extern int
+int
 read_blob_into_alloc_buf(const struct blob_descriptor *blob, void **buf_ret);
 
-extern int
+int
 wim_reshdr_to_data(const struct wim_reshdr *reshdr, WIMStruct *wim,
                   void **buf_ret);
 
-extern int
+int
 wim_reshdr_to_hash(const struct wim_reshdr *reshdr, WIMStruct *wim,
                   u8 hash[SHA1_HASH_SIZE]);
 
-extern int
+int
 skip_wim_resource(const struct wim_resource_descriptor *rdesc);
 
 /*
@@ -273,37 +273,39 @@ call_end_blob(struct blob_descriptor *blob, int status,
 #define VERIFY_BLOB_HASHES             0x1
 #define COMPUTE_MISSING_BLOB_HASHES    0x2
 #define BLOB_LIST_ALREADY_SORTED       0x4
+#define RECOVER_DATA                   0x8
 
-extern int
+int
 read_blob_list(struct list_head *blob_list, size_t list_head_offset,
               const struct read_blob_callbacks *cbs, int flags);
 
-extern int
+int
 read_blob_with_cbs(struct blob_descriptor *blob,
-                  const struct read_blob_callbacks *cbs);
+                  const struct read_blob_callbacks *cbs, bool recover_data);
 
-extern int
+int
 read_blob_with_sha1(struct blob_descriptor *blob,
-                   const struct read_blob_callbacks *cbs);
+                   const struct read_blob_callbacks *cbs, bool recover_data);
 
-extern int
+int
 extract_blob_prefix_to_fd(struct blob_descriptor *blob, u64 size,
                          struct filedes *fd);
 
-extern int
-extract_blob_to_fd(struct blob_descriptor *blob, struct filedes *fd);
+int
+extract_blob_to_fd(struct blob_descriptor *blob, struct filedes *fd,
+                  bool recover_data);
 
 /* Miscellaneous blob functions.  */
 
-extern int
+int
 sha1_blob(struct blob_descriptor *blob);
 
 /* Functions to read/write metadata resources.  */
 
-extern int
+int
 read_metadata_resource(struct wim_image_metadata *imd);
 
-extern int
+int
 write_metadata_resource(WIMStruct *wim, int image, int write_resource_flags);
 
 /* Definitions specific to pipable WIM resources.  */
@@ -319,12 +321,12 @@ struct pwm_blob_hdr {
        u8 hash[SHA1_HASH_SIZE];        /* +16  */
        le32 flags;                     /* +36  */
                                        /* +40  */
-} _packed_attribute;
+} __attribute__((packed));
 
 /* Header that precedes each chunk of a compressed resource in a pipable WIM.
  */
 struct pwm_chunk_hdr {
        le32 compressed_size;
-} _packed_attribute;
+} __attribute__((packed));
 
 #endif /* _WIMLIB_RESOURCE_H */