31 const uInt max = (uInt)-1;
37 stream.zalloc = (alloc_func)0;
38 stream.zfree = (free_func)0;
39 stream.opaque = (voidpf)0;
42 if (err !=
Z_OK)
return err;
44 stream.next_out = dest;
46 stream.next_in = (
z_const Bytef *)source;
50 if (stream.avail_out == 0) {
51 stream.avail_out = left > (uLong)max ? max : (uInt)left;
52 left -= stream.avail_out;
54 if (stream.avail_in == 0) {
55 stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
56 sourceLen -= stream.avail_in;
59 }
while (err ==
Z_OK);
61 *destLen = stream.total_out;
84 return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
85 (sourceLen >> 25) + 13;
uLong ZEXPORT compressBound(uLong sourceLen)
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level)
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
#define deflateInit(strm, level)
#define Z_DEFAULT_COMPRESSION