aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-04-30 10:50:13 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-02 12:40:06 +0200
commita85c6025903a2b6e97e1938b201b3361a0cbed66 (patch)
treecf92df4ba782c4b9c4a49dcf1cc3e25f849723a9 /include
parentfa7f378bf627ddcfd7a93a000149e4d8c3810bf5 (diff)
Add compressor library
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/compress.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/compress.h b/include/compress.h
new file mode 100644
index 0000000..d527307
--- /dev/null
+++ b/include/compress.h
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later */
+#ifndef COMPRESS_H
+#define COMPRESS_H
+
+#include <sys/types.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
+#include "squashfs.h"
+
+typedef struct compressor_t compressor_t;
+
+struct compressor_t {
+ ssize_t (*do_block)(compressor_t *cmp, uint8_t *block, size_t outsize);
+
+ void (*destroy)(compressor_t *stream);
+};
+
+bool compressor_exists(E_SQFS_COMPRESSOR id);
+
+compressor_t *compressor_create(E_SQFS_COMPRESSOR id, bool compress,
+ size_t block_size);
+
+#endif /* COMPRESS_H */