4 * Interface implemented by compressors for specific formats.
7 #ifndef _WIMLIB_COMPRESSOR_OPS_H
8 #define _WIMLIB_COMPRESSOR_OPS_H
10 #include <wimlib/types.h>
12 struct compressor_ops {
14 bool (*params_valid)(const struct wimlib_compressor_params_header *params);
16 u64 (*get_needed_memory)(size_t max_block_size,
17 const struct wimlib_compressor_params_header *params);
19 int (*create_compressor)(size_t max_block_size,
20 const struct wimlib_compressor_params_header *params,
23 size_t (*compress)(const void *uncompressed_data,
24 size_t uncompressed_size,
25 void *compressed_data,
26 size_t compressed_size_avail,
29 void (*free_compressor)(void *private);
32 extern const struct compressor_ops lzx_compressor_ops;
33 extern const struct compressor_ops xpress_compressor_ops;
34 extern const struct compressor_ops lzms_compressor_ops;
37 cleanup_compressor_params(void);
39 #endif /* _WIMLIB_COMPRESSOR_OPS_H */