/** Compressed resources in the WIM use XPRESS compression. */
WIMLIB_COMPRESSION_TYPE_XPRESS = 2,
+
+ /** TODO */
+ WIMLIB_COMPRESSION_TYPE_LZMS = 3,
};
/** @} */
*/
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. */
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
*
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,