wimlib-imagex: Allow specifying LZMS compression
[wimlib] / src / compress_chunk.c
1 #ifdef HAVE_CONFIG_H
2 #  include "config.h"
3 #endif
4
5 #include "wimlib.h"
6 #include "wimlib/compress_chunks.h"
7 #include "wimlib/error.h"
8 #include "wimlib/assert.h"
9
10 unsigned
11 compress_chunk(const void * uncompressed_data,
12                unsigned uncompressed_len,
13                void *compressed_data,
14                int out_ctype,
15                struct wimlib_lzx_context *comp_ctx)
16 {
17         switch (out_ctype) {
18         case WIMLIB_COMPRESSION_TYPE_XPRESS:
19                 return wimlib_xpress_compress(uncompressed_data,
20                                               uncompressed_len,
21                                               compressed_data);
22         case WIMLIB_COMPRESSION_TYPE_LZX:
23                 return wimlib_lzx_compress2(uncompressed_data,
24                                             uncompressed_len,
25                                             compressed_data,
26                                             comp_ctx);
27         case WIMLIB_COMPRESSION_TYPE_LZMS:
28                 return 0;
29
30         default:
31                 wimlib_assert(0);
32                 WARNING("Unknown compression type!");
33                 return 0;
34         }
35 }