summaryrefslogtreecommitdiffstats
path: root/linux_lunzip.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 14:27:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 14:27:35 +0000
commit78f0e21e4be26a0792535ede952c5836d66d1965 (patch)
tree4d43dd4ea1e336065ba7208e974f29afe542b7d2 /linux_lunzip.h
parentInitial commit. (diff)
downloadxlunzip-upstream.tar.xz
xlunzip-upstream.zip
Adding upstream version 0.7.upstream/0.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--linux_lunzip.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/linux_lunzip.h b/linux_lunzip.h
new file mode 100644
index 0000000..5518d30
--- /dev/null
+++ b/linux_lunzip.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef LINUX_DECOMPRESS_LUNZIP_H
+#define LINUX_DECOMPRESS_LUNZIP_H
+
+int lunzip(unsigned char *inbuf, long in_len,
+ long (*fill)(void*, unsigned long),
+ long (*flush)(void*, unsigned long),
+ unsigned char *outbuf,
+ long *in_posp,
+ void (*error)(char *x));
+
+/* This internal function is required because the decompress_fn above
+ * (see include/linux/decompress/generic.h) should have an out_size
+ * argument to prevent overflowing outbuf in case of corruption of the
+ * compressed data.
+ */
+int __lunzip(unsigned char *inbuf, long in_len,
+ long (*fill)(void*, unsigned long),
+ long (*flush)(void*, unsigned long),
+ unsigned char *outbuf, long out_size,
+ long *in_posp, long *out_posp,
+ void (*error)(char *x));
+#endif