+#include "wimlib.h"
+#include "wimlib/assert.h"
+#include "wimlib/blob_table.h"
+#include "wimlib/dentry.h"
+#include "wimlib/encoding.h"
+#include "wimlib/file_io.h"
+#include "wimlib/integrity.h"
+#include "wimlib/metadata.h"
+#include "wimlib/security.h"
+#include "wimlib/wim.h"
+#include "wimlib/xml.h"
+#include "wimlib/win32.h"
+
+/* Information about the available compression types for the WIM format. */
+static const struct {
+ const tchar *name;
+ u32 min_chunk_size;
+ u32 max_chunk_size;
+ u32 default_nonsolid_chunk_size;
+ u32 default_solid_chunk_size;
+} wim_ctype_info[] = {
+ [WIMLIB_COMPRESSION_TYPE_NONE] = {
+ .name = T("None"),
+ .min_chunk_size = 0,
+ .max_chunk_size = 0,
+ .default_nonsolid_chunk_size = 0,
+ .default_solid_chunk_size = 0,
+ },
+ [WIMLIB_COMPRESSION_TYPE_XPRESS] = {
+ .name = T("XPRESS"),
+ .min_chunk_size = 4096,
+ .max_chunk_size = 65536,
+ .default_nonsolid_chunk_size = 32768,
+ .default_solid_chunk_size = 32768,
+ },
+ [WIMLIB_COMPRESSION_TYPE_LZX] = {
+ .name = T("LZX"),
+ .min_chunk_size = 32768,
+ .max_chunk_size = 2097152,
+ .default_nonsolid_chunk_size = 32768,
+ .default_solid_chunk_size = 32768,
+ },
+ [WIMLIB_COMPRESSION_TYPE_LZMS] = {
+ .name = T("LZMS"),
+ .min_chunk_size = 32768,
+ .max_chunk_size = 1073741824,
+ .default_nonsolid_chunk_size = 131072,
+ .default_solid_chunk_size = 67108864,
+ },
+};
+
+/* Is the specified compression type valid? */
+static bool
+wim_compression_type_valid(enum wimlib_compression_type ctype)
+{
+ return (unsigned)ctype < ARRAY_LEN(wim_ctype_info) &&
+ wim_ctype_info[(unsigned)ctype].name != NULL;
+}