+wimlib_set_default_compression_level(int ctype, unsigned int compression_level);
+
+/**
+ * Returns the approximate number of bytes needed to allocate a compressor with
+ * wimlib_create_compressor() for the specified compression type, maximum block
+ * size, and compression level. @p compression_level may be 0, in which case
+ * the current default compression level for @p ctype is used. Returns 0 if the
+ * compression type is invalid, or the @p max_block_size for that compression
+ * type is invalid.
+ */
+extern uint64_t
+wimlib_get_compressor_needed_memory(enum wimlib_compression_type ctype,
+ size_t max_block_size,
+ unsigned int compression_level);
+
+/**
+ * Allocate a compressor for the specified compression type using the specified
+ * parameters. This function is part of wimlib's compression API; it is not
+ * necessary to call this to process a WIM file.
+ *
+ * @param ctype
+ * Compression type for which to create the compressor, as one of the
+ * ::wimlib_compression_type constants.
+ * @param max_block_size
+ * The maximum compression block size to support. This specifies the
+ * maximum allowed value for the @p uncompressed_size parameter of
+ * wimlib_compress() when called using this compressor.
+ * <br/>
+ * Usually, the amount of memory used by the compressor will scale in
+ * proportion to the @p max_block_size parameter.
+ * wimlib_get_compressor_needed_memory() can be used to query the specific
+ * amount of memory that will be required.
+ * <br/>
+ * This parameter must be at least 1 and must be less than or equal to a
+ * compression-type-specific limit.
+ * <br/>
+ * In general, the same value of @p max_block_size must be passed to
+ * wimlib_create_decompressor() when the data is later decompressed.
+ * However, some compression types have looser requirements regarding this.
+ * @param compression_level
+ * The compression level to use. If 0, the default compression level (50,
+ * or another value as set through wimlib_set_default_compression_level())
+ * is used. Otherwise, a higher value indicates higher compression. The
+ * values are scaled so that 10 is low compression, 50 is medium
+ * compression, and 100 is high compression. This is not a percentage;
+ * values above 100 are also valid.
+ * <br/>
+ * Using a higher-than-default compression level can result in a better
+ * compression ratio, but can significantly reduce performance. Similarly,
+ * using a lower-than-default compression level can result in better
+ * performance, but can significantly worsen the compression ratio. The
+ * exact results will depend heavily on the compression type and what
+ * algorithms are implemented for it. If you are considering using a
+ * non-default compression level, you should run benchmarks to see if it is
+ * worthwhile for your application.
+ * <br/>
+ * The compression level does not affect the format of the compressed data.
+ * Therefore, it is a compressor-only parameter and does not need to be
+ * passed to the decompressor.
+ * @param compressor_ret
+ * A location into which to return the pointer to the allocated compressor.
+ * The allocated compressor can be used for any number of calls to
+ * wimlib_compress() before being freed with wimlib_free_compressor().
+ *
+ * @return 0 on success; nonzero on error.
+ *
+ * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE
+ * @p ctype was not a supported compression type.
+ * @retval ::WIMLIB_ERR_INVALID_PARAM
+ * @p max_block_size was invalid for the compression type, or @p
+ * compressor_ret was @c NULL.
+ * @retval ::WIMLIB_ERR_NOMEM
+ * Insufficient memory to allocate the compressor.
+ */
+extern int
+wimlib_create_compressor(enum wimlib_compression_type ctype,
+ size_t max_block_size,
+ unsigned int compression_level,
+ struct wimlib_compressor **compressor_ret);
+
+/**
+ * Compress a buffer of data.
+ *
+ * @param uncompressed_data
+ * Buffer containing the data to compress.
+ * @param uncompressed_size
+ * Size, in bytes, of the data to compress. This cannot be greater than
+ * the @p max_block_size with which wimlib_create_compressor() was called.
+ * (If it is, the data will not be compressed and 0 will be returned.)
+ * @param compressed_data
+ * Buffer into which to write the compressed data.
+ * @param compressed_size_avail
+ * Number of bytes available in @p compressed_data.
+ * @param compressor
+ * A compressor previously allocated with wimlib_create_compressor().
+ *
+ * @return
+ * The size of the compressed data, in bytes, or 0 if the data could not be
+ * compressed to @p compressed_size_avail or fewer bytes.
+ */
+extern size_t
+wimlib_compress(const void *uncompressed_data, size_t uncompressed_size,
+ void *compressed_data, size_t compressed_size_avail,
+ struct wimlib_compressor *compressor);
+
+/**
+ * Free a compressor previously allocated with wimlib_create_compressor().
+ *
+ * @param compressor
+ * The compressor to free. If @c NULL, no action is taken.
+ */
+extern void
+wimlib_free_compressor(struct wimlib_compressor *compressor);
+
+/**
+ * Allocate a decompressor for the specified compression type. This function is
+ * part of wimlib's compression API; it is not necessary to call this to process
+ * a WIM file.
+ *
+ * @param ctype
+ * Compression type for which to create the decompressor, as one of the
+ * ::wimlib_compression_type constants.
+ * @param max_block_size
+ * The maximum compression block size to support. This specifies the
+ * maximum allowed value for the @p uncompressed_size parameter of
+ * wimlib_decompress().
+ * <br/>
+ * In general, this parameter must be the same as the @p max_block_size
+ * that was passed to wimlib_create_compressor() when the data was
+ * compressed. However, some compression types have looser requirements
+ * regarding this.
+ * @param decompressor_ret
+ * A location into which to return the pointer to the allocated
+ * decompressor. The allocated decompressor can be used for any number of
+ * calls to wimlib_decompress() before being freed with
+ * wimlib_free_decompressor().
+ *
+ * @return 0 on success; nonzero on error.
+ *
+ * @retval ::WIMLIB_ERR_INVALID_COMPRESSION_TYPE
+ * @p ctype was not a supported compression type.
+ * @retval ::WIMLIB_ERR_INVALID_PARAM
+ * @p max_block_size was invalid for the compression type, or @p
+ * decompressor_ret was @c NULL.
+ * @retval ::WIMLIB_ERR_NOMEM
+ * Insufficient memory to allocate the decompressor.
+ */
+extern int
+wimlib_create_decompressor(enum wimlib_compression_type ctype,
+ size_t max_block_size,
+ struct wimlib_decompressor **decompressor_ret);
+
+/**
+ * Decompress a buffer of data.
+ *
+ * @param compressed_data
+ * Buffer containing the data to decompress.
+ * @param compressed_size
+ * Size, in bytes, of the data to decompress.
+ * @param uncompressed_data
+ * Buffer into which to write the uncompressed data.
+ * @param uncompressed_size
+ * Size, in bytes, of the data when uncompressed. This cannot exceed the
+ * @p max_block_size with which wimlib_create_decompressor() was called.
+ * (If it does, the data will not be decompressed and a nonzero value will
+ * be returned.)
+ * @param decompressor
+ * A decompressor previously allocated with wimlib_create_decompressor().
+ *
+ * @return 0 on success; nonzero on error.
+ *
+ * No specific error codes are defined; any nonzero value indicates that the
+ * decompression failed. This can only occur if the data is truly invalid;
+ * there will never be transient errors like "out of memory", for example.
+ *
+ * This function requires that the exact uncompressed size of the data be passed
+ * as the @p uncompressed_size parameter. If this is not done correctly,
+ * decompression may fail or the data may be decompressed incorrectly.
+ */
+extern int
+wimlib_decompress(const void *compressed_data, size_t compressed_size,
+ void *uncompressed_data, size_t uncompressed_size,
+ struct wimlib_decompressor *decompressor);
+
+/**
+ * Free a decompressor previously allocated with wimlib_create_decompressor().
+ *
+ * @param decompressor
+ * The decompressor to free. If @c NULL, no action is taken.
+ */
+extern void
+wimlib_free_decompressor(struct wimlib_decompressor *decompressor);
+
+
+/**
+ * @}
+ */
+