aboutsummaryrefslogtreecommitdiff
path: root/include/xfrm/stream.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-12-13 09:15:19 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-01-19 16:24:56 +0100
commit551dd3879c288a2b6b6fbaca5c09c04fbe994ff4 (patch)
treef3437139699edffd034168999854258f30c4023b /include/xfrm/stream.h
parent722ecf27eaf83685dfc6e92adc9d66f0107da5ea (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 'include/xfrm/stream.h')
-rw-r--r--include/xfrm/stream.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/xfrm/stream.h b/include/xfrm/stream.h
new file mode 100644
index 0000000..01639cd
--- /dev/null
+++ b/include/xfrm/stream.h
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later */
+/*
+ * stream.h
+ *
+ * Copyright (C) 2021 David Oberhollenzer <goliath@infraroot.at>
+ */
+#ifndef XFRM_STREAM_H
+#define XFRM_STREAM_H
+
+#include "sqfs/predef.h"
+
+typedef enum {
+ XFRM_STREAM_FLUSH_NONE = 0,
+ XFRM_STREAM_FLUSH_SYNC,
+ XFRM_STREAM_FLUSH_FULL,
+
+ XFRM_STREAM_FLUSH_COUNT,
+} XFRM_STREAM_FLUSH;
+
+typedef enum {
+ XFRM_STREAM_ERROR = -1,
+ XFRM_STREAM_OK = 0,
+ XFRM_STREAM_END = 1,
+ XFRM_STREAM_BUFFER_FULL = 2,
+} XFRM_STREAM_RESULT;
+
+typedef struct xfrm_stream_t xfrm_stream_t;
+
+struct xfrm_stream_t {
+ sqfs_object_t base;
+
+ int (*process_data)(xfrm_stream_t *stream,
+ const void *in, sqfs_u32 in_size,
+ void *out, sqfs_u32 out_size,
+ sqfs_u32 *in_read, sqfs_u32 *out_written,
+ int flush_mode);
+};
+
+#endif /* XFRM_STREAM_H */