24 int ZEXPORT
uncompress (Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen)
29 stream.next_in = (z_const Bytef*)source;
30 stream.avail_in = (uInt)sourceLen;
32 if ((uLong)stream.avail_in != sourceLen)
return Z_BUF_ERROR;
34 stream.next_out = dest;
35 stream.avail_out = (uInt)*destLen;
36 if ((uLong)stream.avail_out != *destLen)
return Z_BUF_ERROR;
38 stream.zalloc = (alloc_func)0;
39 stream.zfree = (free_func)0;
41 err = inflateInit(&stream);
42 if (err != Z_OK)
return err;
44 err =
inflate(&stream, Z_FINISH);
45 if (err != Z_STREAM_END) {
47 if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
51 *destLen = stream.total_out;
int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
int ZEXPORT inflateEnd(z_streamp strm)
int ZEXPORT inflate(z_streamp strm, int flush)