]> wimlib.net Git - wimlib/blobdiff - include/wimlib/decompressor_ops.h
New compression/decompression API
[wimlib] / include / wimlib / decompressor_ops.h
diff --git a/include/wimlib/decompressor_ops.h b/include/wimlib/decompressor_ops.h
new file mode 100644 (file)
index 0000000..9e64285
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * decompressor_ops.h
+ *
+ * Interface implemented by decompressors for specific formats.
+ */
+
+#ifndef _WIMLIB_DECOMPRESSOR_OPS_H
+#define _WIMLIB_DECOMPRESSOR_OPS_H
+
+#include <stddef.h>
+
+struct decompressor_ops {
+
+       int (*create_decompressor)(size_t max_block_size,
+                                  const struct wimlib_decompressor_params_header *extra_params,
+                                  void **private_ret);
+
+       int (*decompress)(const void *compressed_data,
+                         size_t compressed_size,
+                         void *uncompressed_data,
+                         size_t uncompressed_size,
+                         void *private);
+
+       void (*free_decompressor)(void *private);
+};
+
+extern const struct decompressor_ops lzx_decompressor_ops;
+extern const struct decompressor_ops xpress_decompressor_ops;
+extern const struct decompressor_ops lzms_decompressor_ops;
+
+extern void
+cleanup_decompressor_params(void);
+
+#endif /* _WIMLIB_DECOMPRESSOR_OPS_H */