]> wimlib.net Git - wimlib/blobdiff - include/wimlib.h
Use read_stream_list() for extraction
[wimlib] / include / wimlib.h
index 49bbffed1729ccc3b2885fcd59c71bb25b8b5a39..930422a87075e853fe582a9429aaf1d9cf186e26 100644 (file)
@@ -425,6 +425,9 @@ enum wimlib_compression_type {
 
        /** Compressed resources in the WIM use XPRESS compression. */
        WIMLIB_COMPRESSION_TYPE_XPRESS = 2,
+
+       /** TODO  */
+       WIMLIB_COMPRESSION_TYPE_LZMS = 3,
 };
 
 /** @} */
@@ -984,8 +987,15 @@ struct wimlib_resource_entry {
         */
        uint32_t is_missing : 1;
 
-       uint32_t reserved_flags : 27;
-       uint64_t reserved[4];
+       uint32_t is_partial : 1;
+
+       uint32_t reserved_flags : 26;
+
+       uint64_t raw_resource_offset_in_wim;
+       uint64_t raw_resource_uncompressed_size;
+       uint64_t raw_resource_compressed_size;
+
+       uint64_t reserved[1];
 };
 
 /** A stream of a file in the WIM.  */
@@ -2714,6 +2724,45 @@ wimlib_join(const wimlib_tchar * const *swms,
            int wim_write_flags,
            wimlib_progress_func_t progress_func);
 
+/**
+ * @ingroup G_compression
+ *
+ * Decompresses a block of LZMS-compressed data.
+ *
+ * This function is exported for convenience only and should only be used by
+ * library clients looking to make use of wimlib's compression code for another
+ * purpose.
+ *
+ * This decompressor only implements "raw" decompression, which decompresses a
+ * single LZMS-compressed block.  This behavior is the same as that of
+ * Decompress() in the Windows 8 compression API when using a compression handle
+ * created with CreateDecompressor() with the Algorithm parameter specified as
+ * COMPRESS_ALGORITHM_LZMS | COMPRESS_RAW.  Presumably, non-raw LZMS data
+ * is a container format from which the locations and sizes (both compressed and
+ * uncompressed) of the constituent blocks can be determined.
+ *
+ * This function should not be called for blocks with compressed size equal to
+ * uncompressed size, since such blocks are actually stored uncompressed.
+ *
+ * @param compressed_data
+ *     Pointer to the compressed data.
+ *
+ * @param compressed_len
+ *     Length of the compressed data, in bytes.
+ *
+ * @param uncompressed_data
+ *     Pointer to the buffer into which to write the uncompressed data.
+ *
+ * @param uncompressed_len
+ *     Length of the uncompressed data.
+ *
+ * @return
+ *     0 on success; non-zero on failure.
+ */
+extern int
+wimlib_lzms_decompress(const void *compressed_data, unsigned compressed_len,
+                      void *uncompressed_data, unsigned uncompressed_len);
+
 /**
  * @ingroup G_compression
  *
@@ -2817,6 +2866,13 @@ extern int
 wimlib_lzx_decompress(const void *compressed_data, unsigned compressed_len,
                      void *uncompressed_data, unsigned uncompressed_len);
 
+/**
+ * @ingroup G_compression
+ *
+ * Equivalent to wimlib_lzx_decompress(), except the window size is specified in
+ * @p max_window_size as any power of 2 between 2^15 and 2^21, inclusively, and
+ * @p uncompressed_len may be any size less than or equal to @p max_window_size.
+ */
 extern int
 wimlib_lzx_decompress2(const void *compressed_data, unsigned compressed_len,
                       void *uncompressed_data, unsigned uncompressed_len,