X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwim.c;h=ce55444b233372117118411b8f869593002d1ded;hp=292f4cd7b92622c8e2583c2389ed2d956d1c8799;hb=9d73a0741204345c60ce51901f191cd62533526f;hpb=f95716e01e9237f722b52edfff5638755ace3007 diff --git a/src/wim.c b/src/wim.c index 292f4cd7..ce55444b 100644 --- a/src/wim.c +++ b/src/wim.c @@ -130,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; } @@ -224,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) { @@ -253,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) { @@ -351,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) @@ -618,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;