b24413180f560 (Greg Kroah-Hartman 2017-11-01 15:07:57 +0100 1) // SPDX-License-Identifier: GPL-2.0
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 2) #ifdef STATIC
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 3) #define PREBOOT
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 4) /* Pre-boot environment: included */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 5)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 6) /* prevent inclusion of _LINUX_KERNEL_H in pre-boot environment: lots
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 7) * errors about console_printk etc... on ARM */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 8) #define _LINUX_KERNEL_H
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 9)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 10) #include "zlib_inflate/inftrees.c"
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 11) #include "zlib_inflate/inffast.c"
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 12) #include "zlib_inflate/inflate.c"
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 13) #ifdef CONFIG_ZLIB_DFLTCC
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 14) #include "zlib_dfltcc/dfltcc.c"
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 15) #include "zlib_dfltcc/dfltcc_inflate.c"
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 16) #endif
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 17)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 18) #else /* STATIC */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 19) /* initramfs et al: linked */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 20)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 21) #include <linux/zutil.h>
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 22)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 23) #include "zlib_inflate/inftrees.h"
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 24) #include "zlib_inflate/inffast.h"
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 25) #include "zlib_inflate/inflate.h"
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 26)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 27) #include "zlib_inflate/infutil.h"
af661e836039c (Rashika Kheria 2014-04-03 14:49:10 -0700 28) #include <linux/decompress/inflate.h>
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 29)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 30) #endif /* STATIC */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 31)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 32) #include <linux/decompress/mm.h>
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 33)
daeb6b6fbe270 (Phillip Lougher 2009-08-06 15:09:30 -0700 34) #define GZIP_IOBUF_SIZE (16*1024)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 35)
d97b07c54f34e (Yinghai Lu 2014-08-08 14:23:14 -0700 36) static long INIT nofill(void *buffer, unsigned long len)
6a8811629e9aa (Phillip Lougher 2009-09-23 15:57:37 -0700 37) {
6a8811629e9aa (Phillip Lougher 2009-09-23 15:57:37 -0700 38) return -1;
6a8811629e9aa (Phillip Lougher 2009-09-23 15:57:37 -0700 39) }
6a8811629e9aa (Phillip Lougher 2009-09-23 15:57:37 -0700 40)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 41) /* Included from initramfs et al code */
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 42) STATIC int INIT __gunzip(unsigned char *buf, long len,
d97b07c54f34e (Yinghai Lu 2014-08-08 14:23:14 -0700 43) long (*fill)(void*, unsigned long),
d97b07c54f34e (Yinghai Lu 2014-08-08 14:23:14 -0700 44) long (*flush)(void*, unsigned long),
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 45) unsigned char *out_buf, long out_len,
d97b07c54f34e (Yinghai Lu 2014-08-08 14:23:14 -0700 46) long *pos,
93685ad247ef6 (Lasse Collin 2011-01-12 17:01:14 -0800 47) void(*error)(char *x)) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 48) u8 *zbuf;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 49) struct z_stream_s *strm;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 50) int rc;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 51)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 52) rc = -1;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 53) if (flush) {
5619448fc5565 (H. Peter Anvin 2009-01-08 15:09:12 -0800 54) out_len = 0x8000; /* 32 K */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 55) out_buf = malloc(out_len);
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 56) } else {
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 57) if (!out_len)
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 58) out_len = ((size_t)~0) - (size_t)out_buf; /* no limit */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 59) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 60) if (!out_buf) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 61) error("Out of memory while allocating output buffer");
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 62) goto gunzip_nomem1;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 63) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 64)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 65) if (buf)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 66) zbuf = buf;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 67) else {
daeb6b6fbe270 (Phillip Lougher 2009-08-06 15:09:30 -0700 68) zbuf = malloc(GZIP_IOBUF_SIZE);
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 69) len = 0;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 70) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 71) if (!zbuf) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 72) error("Out of memory while allocating input buffer");
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 73) goto gunzip_nomem2;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 74) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 75)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 76) strm = malloc(sizeof(*strm));
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 77) if (strm == NULL) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 78) error("Out of memory while allocating z_stream");
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 79) goto gunzip_nomem3;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 80) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 81)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 82) strm->workspace = malloc(flush ? zlib_inflate_workspacesize() :
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 83) #ifdef CONFIG_ZLIB_DFLTCC
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 84) /* Always allocate the full workspace for DFLTCC */
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 85) zlib_inflate_workspacesize());
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 86) #else
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 87) sizeof(struct inflate_state));
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 88) #endif
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 89) if (strm->workspace == NULL) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 90) error("Out of memory while allocating workspace");
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 91) goto gunzip_nomem4;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 92) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 93)
6a8811629e9aa (Phillip Lougher 2009-09-23 15:57:37 -0700 94) if (!fill)
6a8811629e9aa (Phillip Lougher 2009-09-23 15:57:37 -0700 95) fill = nofill;
6a8811629e9aa (Phillip Lougher 2009-09-23 15:57:37 -0700 96)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 97) if (len == 0)
daeb6b6fbe270 (Phillip Lougher 2009-08-06 15:09:30 -0700 98) len = fill(zbuf, GZIP_IOBUF_SIZE);
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 99)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 100) /* verify the gzip header */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 101) if (len < 10 ||
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 102) zbuf[0] != 0x1f || zbuf[1] != 0x8b || zbuf[2] != 0x08) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 103) if (pos)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 104) *pos = 0;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 105) error("Not a gzip file");
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 106) goto gunzip_5;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 107) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 108)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 109) /* skip over gzip header (1f,8b,08... 10 bytes total +
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 110) * possible asciz filename)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 111) */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 112) strm->next_in = zbuf + 10;
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 113) strm->avail_in = len - 10;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 114) /* skip over asciz filename */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 115) if (zbuf[3] & 0x8) {
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 116) do {
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 117) /*
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 118) * If the filename doesn't fit into the buffer,
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 119) * the file is very probably corrupt. Don't try
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 120) * to read more data.
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 121) */
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 122) if (strm->avail_in == 0) {
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 123) error("header error");
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 124) goto gunzip_5;
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 125) }
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 126) --strm->avail_in;
1da914e0648ac (Lasse Collin 2011-01-12 17:01:25 -0800 127) } while (*strm->next_in++);
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 128) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 129)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 130) strm->next_out = out_buf;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 131) strm->avail_out = out_len;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 132)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 133) rc = zlib_inflateInit2(strm, -MAX_WBITS);
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 134)
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 135) #ifdef CONFIG_ZLIB_DFLTCC
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 136) /* Always keep the window for DFLTCC */
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 137) #else
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 138) if (!flush) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 139) WS(strm)->inflate_state.wsize = 0;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 140) WS(strm)->inflate_state.window = NULL;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 141) }
1261961000637 (Mikhail Zaslonko 2020-01-30 22:16:23 -0800 142) #endif
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 143)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 144) while (rc == Z_OK) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 145) if (strm->avail_in == 0) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 146) /* TODO: handle case where both pos and fill are set */
daeb6b6fbe270 (Phillip Lougher 2009-08-06 15:09:30 -0700 147) len = fill(zbuf, GZIP_IOBUF_SIZE);
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 148) if (len < 0) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 149) rc = -1;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 150) error("read error");
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 151) break;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 152) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 153) strm->next_in = zbuf;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 154) strm->avail_in = len;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 155) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 156) rc = zlib_inflate(strm, 0);
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 157)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 158) /* Write any data generated */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 159) if (flush && strm->next_out > out_buf) {
d97b07c54f34e (Yinghai Lu 2014-08-08 14:23:14 -0700 160) long l = strm->next_out - out_buf;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 161) if (l != flush(out_buf, l)) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 162) rc = -1;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 163) error("write error");
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 164) break;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 165) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 166) strm->next_out = out_buf;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 167) strm->avail_out = out_len;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 168) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 169)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 170) /* after Z_FINISH, only Z_STREAM_END is "we unpacked it all" */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 171) if (rc == Z_STREAM_END) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 172) rc = 0;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 173) break;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 174) } else if (rc != Z_OK) {
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 175) error("uncompression error");
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 176) rc = -1;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 177) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 178) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 179)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 180) zlib_inflateEnd(strm);
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 181) if (pos)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 182) /* add + 8 to skip over trailer */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 183) *pos = strm->next_in - zbuf+8;
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 184)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 185) gunzip_5:
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 186) free(strm->workspace);
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 187) gunzip_nomem4:
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 188) free(strm);
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 189) gunzip_nomem3:
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 190) if (!buf)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 191) free(zbuf);
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 192) gunzip_nomem2:
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 193) if (flush)
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 194) free(out_buf);
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 195) gunzip_nomem1:
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 196) return rc; /* returns Z_OK (0) if successful */
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 197) }
bc22c17e12c13 (Alain Knaff 2009-01-04 22:46:16 +0100 198)
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 199) #ifndef PREBOOT
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 200) STATIC int INIT gunzip(unsigned char *buf, long len,
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 201) long (*fill)(void*, unsigned long),
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 202) long (*flush)(void*, unsigned long),
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 203) unsigned char *out_buf,
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 204) long *pos,
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 205) void (*error)(char *x))
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 206) {
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 207) return __gunzip(buf, len, fill, flush, out_buf, 0, pos, error);
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 208) }
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 209) #else
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 210) STATIC int INIT __decompress(unsigned char *buf, long len,
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 211) long (*fill)(void*, unsigned long),
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 212) long (*flush)(void*, unsigned long),
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 213) unsigned char *out_buf, long out_len,
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 214) long *pos,
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 215) void (*error)(char *x))
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 216) {
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 217) return __gunzip(buf, len, fill, flush, out_buf, out_len, pos, error);
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 218) }
2d3862d26e67a (Yinghai Lu 2015-09-09 15:39:12 -0700 219) #endif