aboutsummaryrefslogtreecommitdiff
path: root/lib/fstream/internal.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-09-14 16:17:15 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-09-16 09:34:35 +0200
commit5f637f97c3427dc6e1a68678aefee1f62ca34d62 (patch)
tree75254191b93adce81e188069d54de383c0123984 /lib/fstream/internal.h
parent0a0cbefc6ebb6174aad3e6f0b8a6dea87aed49da (diff)
Implement ostream compressor wrapper
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstream/internal.h')
-rw-r--r--lib/fstream/internal.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/fstream/internal.h b/lib/fstream/internal.h
index e8b0c07..ae6a29a 100644
--- a/lib/fstream/internal.h
+++ b/lib/fstream/internal.h
@@ -22,4 +22,31 @@
#define BUFSZ (262144)
+typedef struct ostream_comp_t {
+ ostream_t base;
+
+ ostream_t *wrapped;
+
+ size_t inbuf_used;
+
+ sqfs_u8 inbuf[BUFSZ];
+ sqfs_u8 outbuf[BUFSZ];
+
+ int (*flush_inbuf)(struct ostream_comp_t *ostrm, bool finish);
+
+ void (*cleanup)(struct ostream_comp_t *ostrm);
+} ostream_comp_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SQFS_INTERNAL ostream_comp_t *ostream_gzip_create(const char *filename);
+
+SQFS_INTERNAL ostream_comp_t *ostream_xz_create(const char *filename);
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* INTERNAL_H */