]> wimlib.net Git - wimlib/blob - include/wimlib/compressor_ops.h
4c36bb3600597f991e9a69434a516c9ddff60498
[wimlib] / include / wimlib / compressor_ops.h
1 /*
2  * compressor_ops.h
3  *
4  * Interface implemented by compressors for specific formats.
5  */
6
7 #ifndef _WIMLIB_COMPRESSOR_OPS_H
8 #define _WIMLIB_COMPRESSOR_OPS_H
9
10 #include <stddef.h>
11
12 struct compressor_ops {
13
14         int (*create_compressor)(size_t max_block_size,
15                                  const struct wimlib_compressor_params_header *extra_params,
16                                  void **private_ret);
17
18         size_t (*compress)(const void *uncompressed_data,
19                            size_t uncompressed_size,
20                            void *compressed_data,
21                            size_t compressed_size_avail,
22                            void *private);
23
24         void (*free_compressor)(void *private);
25 };
26
27 extern const struct compressor_ops lzx_compressor_ops;
28 extern const struct compressor_ops xpress_compressor_ops;
29 extern const struct compressor_ops lzms_compressor_ops;
30
31 extern void
32 cleanup_compressor_params(void);
33
34 #endif /* _WIMLIB_COMPRESSOR_OPS_H */