diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2022-12-13 09:15:19 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-01-19 16:24:56 +0100 |
commit | 551dd3879c288a2b6b6fbaca5c09c04fbe994ff4 (patch) | |
tree | f3437139699edffd034168999854258f30c4023b /lib/io/internal.h | |
parent | 722ecf27eaf83685dfc6e92adc9d66f0107da5ea (diff) |
Split stream compression out of libio
Move it to a separate libxfrm library, where it can be independently
tested as well. The bulk of the new code is also mainly test cases
for the compressors.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/io/internal.h')
-rw-r--r-- | lib/io/internal.h | 52 |
1 files changed, 1 insertions, 51 deletions
diff --git a/lib/io/internal.h b/lib/io/internal.h index 4ac38f5..25a0196 100644 --- a/lib/io/internal.h +++ b/lib/io/internal.h @@ -14,6 +14,7 @@ #include "io/file.h" #include "io/xfrm.h" #include "io/std.h" +#include "xfrm/compress.h" #include <string.h> #include <stdlib.h> @@ -27,55 +28,4 @@ #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; - -typedef struct istream_comp_t { - istream_t base; - - istream_t *wrapped; - - sqfs_u8 uncompressed[BUFSZ]; - - bool eof; - - void (*cleanup)(struct istream_comp_t *strm); -} istream_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); - -SQFS_INTERNAL ostream_comp_t *ostream_zstd_create(const char *filename); - -SQFS_INTERNAL ostream_comp_t *ostream_bzip2_create(const char *filename); - -SQFS_INTERNAL istream_comp_t *istream_gzip_create(const char *filename); - -SQFS_INTERNAL istream_comp_t *istream_xz_create(const char *filename); - -SQFS_INTERNAL istream_comp_t *istream_zstd_create(const char *filename); - -SQFS_INTERNAL istream_comp_t *istream_bzip2_create(const char *filename); - -#ifdef __cplusplus -} -#endif - #endif /* INTERNAL_H */ |