uInt
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) {
const uInt max = (uInt)-1;
stream.avail_out = left > (z_size_t)max ? max : (uInt)left;
(uInt)sourceLen;
uLong ZEXPORT crc32(uLong crc, const unsigned char FAR *buf, uInt len) {
uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8;
uInt level_flags;
putShortMSB(s, (uInt)(strm->adler >> 16));
putShortMSB(s, (uInt)(strm->adler & 0xffff));
putShortMSB(s, (uInt)(strm->adler >> 16));
putShortMSB(s, (uInt)(strm->adler & 0xffff));
local uInt longest_match(deflate_state *s, IPos cur_match) {
uInt wmask = s->w_mask;
if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
local uInt longest_match(deflate_state *s, IPos cur_match) {
return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
uInt wsize = s->w_size;
uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
uInt prev; /* byte at distance one to match */
s->match_length = MAX_MATCH - (uInt)(strend - scan);
Assert(scan <= s->window + (uInt)(s->window_size - 1),
uInt wsize = s->w_size;
uInt str = s->strstart - s->insert;
s->w_bits = (uInt)windowBits;
s->hash_bits = (uInt)memLevel + 7;
uInt dictLength) {
uInt str, n;
uInt *dictLength) {
uInt len;
s->good_match = (uInt)good_length;
s->max_lazy_match = (uInt)max_lazy;
s->max_chain_length = (uInt)max_chain;
local void putShortMSB(deflate_state *s, uInt b) {
uInt w_size; /* LZ77 window size (32K by default) */
uInt w_bits; /* log2(w_size) (8..16) */
uInt w_mask; /* w_size - 1 */
uInt ins_h; /* hash index of string to be inserted */
uInt hash_size; /* number of elements in hash table */
uInt hash_bits; /* log2(hash_size) */
uInt hash_mask; /* hash_size-1 */
uInt hash_shift;
uInt match_length; /* length of best match */
uInt strstart; /* start of string to insert */
uInt match_start; /* start of matching string */
uInt lookahead; /* number of valid bytes ahead in window */
uInt prev_length;
uInt max_chain_length;
uInt max_lazy_match;
uInt good_match;
uInt lit_bufsize;
uInt sym_next; /* running index in symbol buffer */
uInt sym_end; /* symbol table full when sym_next reaches this */
uInt matches; /* number of string matches in current block */
uInt insert; /* bytes at end of window left to insert */
extern voidp malloc(uInt size);
state->wbits = (uInt)windowBits;
uInt *dictLength) {
uInt dictLength) {
if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR;
state->bits += (uInt)bits;
const uInt max = (uInt)-1;
stream.avail_out = left > (z_size_t)max ? max : (uInt)left;
stream.avail_in = len > (z_size_t)max ? max : (uInt)len;
typedef uInt FAR uIntf;
uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
uInt extra_max; /* space at extra (only when reading header) */
uInt name_max; /* space at name (only when reading header) */
uInt comm_max; /* space at comment (only when reading header) */
ZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len);
ZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len);
uInt dictLength);
uInt *dictLength);
typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size);
uInt dictLength);
uInt avail_in; /* number of bytes available at next_in */
uInt *dictLength);
uInt avail_out; /* remaining free space at next_out */
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) {
extern voidp malloc(uInt size);
extern voidp calloc(uInt items, uInt size);
switch ((int)(sizeof(uInt))) {
c_stream.avail_out = (uInt)comprLen;
c_stream.avail_in = (uInt)uncomprLen;
c_stream.avail_in = (uInt)uncomprLen/2;
c_stream.avail_in = (uInt)uncomprLen;
d_stream.avail_in = (uInt)comprLen;
d_stream.avail_out = (uInt)uncomprLen;
uInt len = (uInt)strlen(hello)+1;
c_stream.avail_out = (uInt)*comprLen;
d_stream.avail_out = (uInt)uncomprLen;
d_stream.avail_in = (uInt)comprLen-2; /* read all compressed data */
c_stream.avail_out = (uInt)comprLen;
c_stream.avail_in = (uInt)strlen(hello)+1;
d_stream.avail_in = (uInt)comprLen;
d_stream.avail_out = (uInt)uncomprLen;
compr = (Byte*)calloc((uInt)comprLen, 1);
uncompr = (Byte*)calloc((uInt)uncomprLen, 1);
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) {
const uInt max = (uInt)-1;
stream.avail_out = left > (z_size_t)max ? max : (uInt)left;
(uInt)sourceLen;
uLong ZEXPORT crc32(uLong crc, const unsigned char FAR *buf, uInt len) {
uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8;
uInt level_flags;
putShortMSB(s, (uInt)(strm->adler >> 16));
putShortMSB(s, (uInt)(strm->adler & 0xffff));
putShortMSB(s, (uInt)(strm->adler >> 16));
putShortMSB(s, (uInt)(strm->adler & 0xffff));
local uInt longest_match(deflate_state *s, IPos cur_match) {
uInt wmask = s->w_mask;
if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
local uInt longest_match(deflate_state *s, IPos cur_match) {
return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
uInt wsize = s->w_size;
uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
uInt prev; /* byte at distance one to match */
s->match_length = MAX_MATCH - (uInt)(strend - scan);
Assert(scan <= s->window + (uInt)(s->window_size - 1),
uInt wsize = s->w_size;
uInt str = s->strstart - s->insert;
s->w_bits = (uInt)windowBits;
s->hash_bits = (uInt)memLevel + 7;
uInt dictLength) {
uInt str, n;
uInt *dictLength) {
uInt len;
s->good_match = (uInt)good_length;
s->max_lazy_match = (uInt)max_lazy;
s->max_chain_length = (uInt)max_chain;
local void putShortMSB(deflate_state *s, uInt b) {
uInt w_size; /* LZ77 window size (32K by default) */
uInt w_bits; /* log2(w_size) (8..16) */
uInt w_mask; /* w_size - 1 */
uInt ins_h; /* hash index of string to be inserted */
uInt hash_size; /* number of elements in hash table */
uInt hash_bits; /* log2(hash_size) */
uInt hash_mask; /* hash_size-1 */
uInt hash_shift;
uInt match_length; /* length of best match */
uInt strstart; /* start of string to insert */
uInt match_start; /* start of matching string */
uInt lookahead; /* number of valid bytes ahead in window */
uInt prev_length;
uInt max_chain_length;
uInt max_lazy_match;
uInt good_match;
uInt lit_bufsize;
uInt sym_next; /* running index in symbol buffer */
uInt sym_end; /* symbol table full when sym_next reaches this */
uInt matches; /* number of string matches in current block */
uInt insert; /* bytes at end of window left to insert */
state->wbits = (uInt)windowBits;
uInt *dictLength) {
uInt dictLength) {
if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR;
state->bits += (uInt)bits;
typedef uInt FAR uIntf;
uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
uInt extra_max; /* space at extra (only when reading header) */
uInt name_max; /* space at name (only when reading header) */
uInt comm_max; /* space at comment (only when reading header) */
ZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len);
ZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len);
uInt dictLength);
uInt *dictLength);
typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size);
typedef void (*free_func)(voidpf opaque, voidpf address, uInt size);
uInt dictLength);
uInt avail_in; /* number of bytes available at next_in */
uInt *dictLength);
uInt avail_out; /* remaining free space at next_out */
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) {
extern voidp malloc(uInt size);
extern voidp calloc(uInt items, uInt size);
switch ((int)(sizeof(uInt))) {
uInt len;
len = (uInt)get_byte(s);
len += ((uInt)get_byte(s))<<8;
(uInt)(s->z_stream.next_out - start));
(uInt)(s->z_stream.next_out - start));
(uInt)(s->z_stream.next_out - ubuf));
(uInt)(s->z_stream.next_out - ubuf));