]> wimlib.net Git - wimlib/blobdiff - src/wim.c
Removed deprecated stuff
[wimlib] / src / wim.c
index febc68aac69bfd122dc55084ab173c1ebfc201e8..ce55444b233372117118411b8f869593002d1ded 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -40,6 +40,7 @@
 #include "wimlib/xml.h"
 #include "wimlib/compressor_ops.h"
 #include "wimlib/decompressor_ops.h"
+#include "wimlib/version.h"
 
 #ifdef __WIN32__
 #  include "wimlib/win32.h" /* for realpath() replacement */
@@ -129,8 +130,9 @@ wim_chunk_size_valid(u32 chunk_size, int ctype)
                return order >= 15 && order <= 21;
 
        case WIMLIB_COMPRESSION_TYPE_XPRESS:
+               return order >= 12 && order <= 26;
        case WIMLIB_COMPRESSION_TYPE_LZMS:
-               return order >= 15 && order <= 26;
+               return order >= 15 && order <= 30;
        }
        return false;
 }
@@ -223,6 +225,8 @@ out_free:
        return ret;
 }
 
+/* Load the metadata for the specified WIM image into memory and set it as the
+ * WIMStruct's currently selected WIM image.  */
 int
 select_wim_image(WIMStruct *wim, int image)
 {
@@ -252,8 +256,8 @@ select_wim_image(WIMStruct *wim, int image)
                return WIMLIB_ERR_METADATA_NOT_FOUND;
        }
 
-       /* If a valid image is currently selected, it can be freed if it is not
-        * modified.  */
+       /* If a valid image is currently selected, its metadata can be freed if
+        * it has not been modified.  */
        if (wim->current_image != WIMLIB_NO_IMAGE) {
                imd = wim_get_current_image_metadata(wim);
                if (!imd->modified) {
@@ -350,13 +354,6 @@ wimlib_print_available_images(const WIMStruct *wim, int image)
                print_image_info(wim->wim_info, i);
 }
 
-/* TODO: Deprecated; remove this.  */
-WIMLIBAPI int
-wimlib_print_metadata(WIMStruct *wim, int image)
-{
-       return WIMLIB_ERR_UNSUPPORTED;
-}
-
 /* API function documented in wimlib.h  */
 WIMLIBAPI int
 wimlib_get_wim_info(WIMStruct *wim, struct wimlib_wim_info *info)
@@ -617,7 +614,8 @@ begin_read(WIMStruct *wim, const void *wim_filename_or_fd,
        if (wim->hdr.flags & WIM_HDR_FLAG_COMPRESSION) {
                if (wim->hdr.flags & WIM_HDR_FLAG_COMPRESS_LZX) {
                        wim->compression_type = WIMLIB_COMPRESSION_TYPE_LZX;
-               } else if (wim->hdr.flags & WIM_HDR_FLAG_COMPRESS_XPRESS) {
+               } else if (wim->hdr.flags & (WIM_HDR_FLAG_COMPRESS_XPRESS |
+                                            WIM_HDR_FLAG_COMPRESS_XPRESS_2)) {
                        wim->compression_type = WIMLIB_COMPRESSION_TYPE_XPRESS;
                } else if (wim->hdr.flags & WIM_HDR_FLAG_COMPRESS_LZMS) {
                        wim->compression_type = WIMLIB_COMPRESSION_TYPE_LZMS;
@@ -977,6 +975,13 @@ test_locale_ctype_utf8(void)
 #endif
 }
 
+/* API function documented in wimlib.h  */
+WIMLIBAPI u32
+wimlib_get_version(void)
+{
+       return WIMLIB_VERSION_CODE;
+}
+
 /* API function documented in wimlib.h  */
 WIMLIBAPI int
 wimlib_global_init(int init_flags)