35 const uInt max = (uInt)-1;
49 stream.next_in = (
z_const Bytef *)source;
51 stream.zalloc = (alloc_func)0;
52 stream.zfree = (free_func)0;
53 stream.opaque = (voidpf)0;
56 if (err !=
Z_OK)
return err;
58 stream.next_out = dest;
62 if (stream.avail_out == 0) {
63 stream.avail_out = left > (uLong)max ? max : (uInt)left;
64 left -= stream.avail_out;
66 if (stream.avail_in == 0) {
67 stream.avail_in = len > (uLong)max ? max : (uInt)len;
68 len -= stream.avail_in;
71 }
while (err ==
Z_OK);
73 *sourceLen -= len + stream.avail_in;
75 *destLen = stream.total_out;
92 return uncompress2(dest, destLen, source, &sourceLen);
int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong *sourceLen)
#define inflateInit(strm)