22int ZEXPORT
compress2(Bytef *dest, uLongf *destLen,
const Bytef *source,
23 uLong sourceLen,
int level) {
26 const uInt max = (uInt)-1;
37 if (err !=
Z_OK)
return err;
41 stream.
next_in = (z_const Bytef *)source;
46 stream.
avail_out = left > (uLong)max ? max : (uInt)left;
50 stream.
avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
54 }
while (err ==
Z_OK);
63int ZEXPORT
compress(Bytef *dest, uLongf *destLen,
const Bytef *source,
73 return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
74 (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)
void(* free_func)(voidpf opaque, voidpf address)
voidpf(* alloc_func)(voidpf opaque, uInt items, uInt size)
ZEXTERN int ZEXPORT deflateEnd(z_streamp strm)
struct z_stream_s z_stream
ZEXTERN int ZEXPORT deflate(z_streamp strm, int flush)
#define deflateInit(strm, level)
#define Z_DEFAULT_COMPRESSION