55 " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler ";
89 void match_init
OF((
void));
108 # define TOO_FAR 4096 117 typedef struct config_s {
154 #ifndef NO_DUMMY_DECL 155 struct static_tree_desc_s {
int dummy;};
159 #define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0)) 167 #define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask) 181 #define INSERT_STRING(s, str, match_head) \ 182 (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ 183 match_head = s->head[s->ins_h], \ 184 s->head[s->ins_h] = (Pos)(str)) 186 #define INSERT_STRING(s, str, match_head) \ 187 (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \ 188 match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \ 189 s->head[s->ins_h] = (Pos)(str)) 196 #define CLEAR_HASH(s) \ 197 s->head[s->hash_size-1] = NIL; \ 198 zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); 214 version, stream_size)
233 if (version ==
Z_NULL || version[0] != my_version[0] ||
240 if (strm->zalloc == (alloc_func)0) {
248 if (strm->zfree == (free_func)0)
256 if (level != 0) level = 1;
261 if (windowBits < 0) {
266 else if (windowBits > 15) {
273 strategy < 0 || strategy >
Z_FIXED) {
276 if (windowBits == 8) windowBits = 9;
279 strm->state = (
struct internal_state FAR *)s;
285 s->w_size = 1 << s->w_bits;
286 s->w_mask = s->w_size - 1;
288 s->hash_bits = memLevel + 7;
289 s->hash_size = 1 << s->hash_bits;
290 s->hash_mask = s->hash_size - 1;
299 s->lit_bufsize = 1 << (memLevel + 6);
301 overlay = (
ushf *)
ZALLOC(strm, s->lit_bufsize,
sizeof(
ush)+2);
302 s->pending_buf = (
uchf *) overlay;
303 s->pending_buf_size = (
ulg)s->lit_bufsize * (
sizeof(
ush)+2L);
306 s->pending_buf ==
Z_NULL) {
312 s->d_buf = overlay + s->lit_bufsize/
sizeof(
ush);
313 s->l_buf = s->pending_buf + (1+
sizeof(
ush))*s->lit_bufsize;
317 s->method = (
Byte)method;
338 if (wrap == 2 || (wrap == 1 && s->status !=
INIT_STATE) || s->lookahead)
343 strm->adler =
adler32(strm->adler, dictionary, dictLength);
347 if (dictLength >= s->w_size) {
354 dictionary += dictLength - s->w_size;
355 dictLength = s->w_size;
359 avail = strm->avail_in;
360 next = strm->next_in;
361 strm->avail_in = dictLength;
370 s->prev[str & s->w_mask] = s->head[s->ins_h];
372 s->head[s->ins_h] = (
Pos)str;
379 s->strstart += s->lookahead;
380 s->block_start = (
long)s->strstart;
381 s->insert = s->lookahead;
383 s->match_length = s->prev_length =
MIN_MATCH-1;
384 s->match_available = 0;
385 strm->next_in = next;
386 strm->avail_in = avail;
398 strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) {
402 strm->total_in = strm->total_out = 0;
408 s->pending_out = s->pending_buf;
445 strm->state->gzhead = head;
457 *pending = strm->state->pending;
459 *bits = strm->state->bi_valid;
474 if ((
Bytef *)(s->d_buf) < s->pending_out + ((
Buf_size + 7) >> 3))
480 s->bi_buf |= (
ush)((value & ((1 << put) - 1)) << s->bi_valid);
503 if (level != 0) level = 1;
510 func = configuration_table[s->level].func;
512 if ((strategy != s->strategy || func != configuration_table[level].func) &&
513 strm->total_in != 0) {
519 if (s->level != level) {
521 s->max_lazy_match = configuration_table[
level].max_lazy;
522 s->good_match = configuration_table[
level].good_length;
523 s->nice_match = configuration_table[
level].nice_length;
524 s->max_chain_length = configuration_table[
level].max_chain;
542 s->good_match = good_length;
543 s->max_lazy_match = max_lazy;
544 s->nice_match = nice_length;
545 s->max_chain_length = max_chain;
571 uLong complen, wraplen;
575 complen = sourceLen +
576 ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
589 wraplen = 6 + (s->strstart ? 4 : 0);
593 if (s->gzhead !=
Z_NULL) {
594 if (s->gzhead->extra !=
Z_NULL)
595 wraplen += 2 + s->gzhead->extra_len;
596 str = s->gzhead->name;
601 str = s->gzhead->comment;
615 if (s->w_bits != 15 || s->hash_bits != 8 + 7)
616 return complen + wraplen;
619 return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
620 (sourceLen >> 25) + 13 - 6 + wraplen;
650 if (len > strm->avail_out) len = strm->avail_out;
651 if (len == 0)
return;
653 zmemcpy(strm->next_out, s->pending_out, len);
654 strm->next_out +=
len;
655 s->pending_out +=
len;
656 strm->total_out +=
len;
657 strm->avail_out -=
len;
659 if (s->pending == 0) {
660 s->pending_out = s->pending_buf;
673 flush >
Z_BLOCK || flush < 0) {
678 if (strm->next_out ==
Z_NULL ||
679 (strm->next_in ==
Z_NULL && strm->avail_in != 0) ||
686 old_flush = s->last_flush;
687 s->last_flush =
flush;
697 if (s->gzhead ==
Z_NULL) {
710 put_byte(s, (s->gzhead->text ? 1 : 0) +
711 (s->gzhead->hcrc ? 2 : 0) +
712 (s->gzhead->extra ==
Z_NULL ? 0 : 4) +
713 (s->gzhead->name ==
Z_NULL ? 0 : 8) +
714 (s->gzhead->comment ==
Z_NULL ? 0 : 16)
724 if (s->gzhead->extra !=
Z_NULL) {
725 put_byte(s, s->gzhead->extra_len & 0xff);
726 put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
729 strm->adler =
crc32(strm->adler, s->pending_buf,
743 else if (s->level < 6)
745 else if (s->level == 6)
749 header |= (level_flags << 6);
751 header += 31 - (header % 31);
757 if (s->strstart != 0) {
766 if (s->gzhead->extra !=
Z_NULL) {
767 uInt beg = s->pending;
769 while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {
770 if (s->pending == s->pending_buf_size) {
771 if (s->gzhead->hcrc && s->pending > beg)
772 strm->adler =
crc32(strm->adler, s->pending_buf + beg,
776 if (s->pending == s->pending_buf_size)
779 put_byte(s, s->gzhead->extra[s->gzindex]);
782 if (s->gzhead->hcrc && s->pending > beg)
783 strm->adler =
crc32(strm->adler, s->pending_buf + beg,
785 if (s->gzindex == s->gzhead->extra_len) {
794 if (s->gzhead->name !=
Z_NULL) {
795 uInt beg = s->pending;
799 if (s->pending == s->pending_buf_size) {
800 if (s->gzhead->hcrc && s->pending > beg)
801 strm->adler =
crc32(strm->adler, s->pending_buf + beg,
805 if (s->pending == s->pending_buf_size) {
810 val = s->gzhead->name[s->gzindex++];
813 if (s->gzhead->hcrc && s->pending > beg)
814 strm->adler =
crc32(strm->adler, s->pending_buf + beg,
825 if (s->gzhead->comment !=
Z_NULL) {
826 uInt beg = s->pending;
830 if (s->pending == s->pending_buf_size) {
831 if (s->gzhead->hcrc && s->pending > beg)
832 strm->adler =
crc32(strm->adler, s->pending_buf + beg,
836 if (s->pending == s->pending_buf_size) {
841 val = s->gzhead->comment[s->gzindex++];
844 if (s->gzhead->hcrc && s->pending > beg)
845 strm->adler =
crc32(strm->adler, s->pending_buf + beg,
854 if (s->gzhead->hcrc) {
855 if (s->pending + 2 > s->pending_buf_size)
857 if (s->pending + 2 <= s->pending_buf_size) {
870 if (s->pending != 0) {
872 if (strm->avail_out == 0) {
887 }
else if (strm->avail_in == 0 &&
RANK(flush) <=
RANK(old_flush) &&
899 if (strm->avail_in != 0 || s->lookahead != 0 ||
905 (*(configuration_table[s->level].func))(
s,
flush));
911 if (strm->avail_out == 0) {
933 if (s->lookahead == 0) {
941 if (strm->avail_out == 0) {
947 Assert(strm->avail_out > 0,
"bug2");
974 if (s->wrap > 0) s->wrap = -s->wrap;
986 status = strm->state->status;
998 TRY_FREE(strm, strm->state->pending_buf);
1001 TRY_FREE(strm, strm->state->window);
1003 ZFREE(strm, strm->state);
1036 dest->state = (
struct internal_state FAR *) ds;
1042 ds->head = (
Posf *)
ZALLOC(dest, ds->hash_size,
sizeof(
Pos));
1043 overlay = (
ushf *)
ZALLOC(dest, ds->lit_bufsize,
sizeof(
ush)+2);
1044 ds->pending_buf = (
uchf *) overlay;
1047 ds->pending_buf ==
Z_NULL) {
1052 zmemcpy(ds->window, ss->window, ds->w_size * 2 *
sizeof(
Byte));
1055 zmemcpy(ds->pending_buf, ss->pending_buf, (
uInt)ds->pending_buf_size);
1057 ds->pending_out = ds->pending_buf + (ss->pending_out - ss->pending_buf);
1058 ds->d_buf = overlay + ds->lit_bufsize/
sizeof(
ush);
1059 ds->l_buf = ds->pending_buf + (1+
sizeof(
ush))*ds->lit_bufsize;
1061 ds->l_desc.dyn_tree = ds->dyn_ltree;
1062 ds->d_desc.dyn_tree = ds->dyn_dtree;
1063 ds->bl_desc.dyn_tree = ds->bl_tree;
1081 unsigned len = strm->avail_in;
1083 if (len > size) len =
size;
1084 if (len == 0)
return 0;
1086 strm->avail_in -=
len;
1088 zmemcpy(buf, strm->next_in, len);
1089 if (strm->state->wrap == 1) {
1090 strm->adler =
adler32(strm->adler, buf, len);
1093 else if (strm->state->wrap == 2) {
1094 strm->adler =
crc32(strm->adler, buf, len);
1097 strm->next_in +=
len;
1098 strm->total_in +=
len;
1109 s->window_size = (
ulg)2L*s->w_size;
1115 s->max_lazy_match = configuration_table[s->level].max_lazy;
1116 s->good_match = configuration_table[s->level].good_length;
1117 s->nice_match = configuration_table[s->level].nice_length;
1118 s->max_chain_length = configuration_table[s->level].max_chain;
1121 s->block_start = 0L;
1124 s->match_length = s->prev_length =
MIN_MATCH-1;
1125 s->match_available = 0;
1152 unsigned chain_length = s->max_chain_length;
1153 register Bytef *scan = s->window + s->strstart;
1156 int best_len = s->prev_length;
1157 int nice_match = s->nice_match;
1163 Posf *prev = s->prev;
1164 uInt wmask = s->w_mask;
1170 register Bytef *strend = s->window + s->strstart +
MAX_MATCH - 1;
1171 register ush scan_start = *(
ushf*)scan;
1172 register ush scan_end = *(
ushf*)(scan+best_len-1);
1175 register Byte scan_end1 = scan[best_len-1];
1176 register Byte scan_end = scan[best_len];
1185 if (s->prev_length >= s->good_match) {
1191 if ((
uInt)nice_match > s->lookahead) nice_match = s->lookahead;
1196 Assert(cur_match < s->strstart,
"no future");
1197 match = s->window + cur_match;
1207 #if (defined(UNALIGNED_OK) && MAX_MATCH == 258) 1211 if (*(
ushf*)(match+best_len-1) != scan_end ||
1212 *(
ushf*)match != scan_start)
continue;
1223 Assert(scan[2] == match[2],
"scan[2]?");
1226 }
while (*(
ushf*)(scan+=2) == *(
ushf*)(match+=2) &&
1227 *(
ushf*)(scan+=2) == *(
ushf*)(match+=2) &&
1228 *(
ushf*)(scan+=2) == *(
ushf*)(match+=2) &&
1229 *(
ushf*)(scan+=2) == *(
ushf*)(match+=2) &&
1234 Assert(scan <= s->window+(
unsigned)(s->window_size-1),
"wild scan");
1235 if (*scan == *match) scan++;
1237 len = (
MAX_MATCH - 1) - (
int)(strend-scan);
1242 if (match[best_len] != scan_end ||
1243 match[best_len-1] != scan_end1 ||
1245 *++match != scan[1])
continue;
1254 Assert(*scan == *match,
"match[2]?");
1260 }
while (*++scan == *++match && *++scan == *++match &&
1261 *++scan == *++match && *++scan == *++match &&
1262 *++scan == *++match && *++scan == *++match &&
1263 *++scan == *++match && *++scan == *++match &&
1266 Assert(scan <= s->window+(
unsigned)(s->window_size-1),
"wild scan");
1273 if (len > best_len) {
1274 s->match_start = cur_match;
1276 if (len >= nice_match)
break;
1278 scan_end = *(
ushf*)(scan+best_len-1);
1280 scan_end1 = scan[best_len-1];
1281 scan_end = scan[best_len];
1284 }
while ((cur_match = prev[cur_match & wmask]) > limit
1285 && --chain_length != 0);
1287 if ((
uInt)best_len <= s->lookahead)
return (
uInt)best_len;
1288 return s->lookahead;
1301 register Bytef *scan = s->window + s->strstart;
1313 Assert(cur_match < s->strstart,
"no future");
1315 match = s->window + cur_match;
1319 if (match[0] != scan[0] || match[1] != scan[1])
return MIN_MATCH-1;
1327 scan += 2, match += 2;
1328 Assert(*scan == *match,
"match[2]?");
1334 }
while (*++scan == *++match && *++scan == *++match &&
1335 *++scan == *++match && *++scan == *++match &&
1336 *++scan == *++match && *++scan == *++match &&
1337 *++scan == *++match && *++scan == *++match &&
1340 Assert(scan <= s->window+(
unsigned)(s->window_size-1),
"wild scan");
1346 s->match_start = cur_match;
1347 return (
uInt)len <= s->lookahead ? (
uInt)len : s->lookahead;
1362 if (
zmemcmp(s->window + match,
1363 s->window + start, length) !=
EQUAL) {
1364 fprintf(stderr,
" start %u, match %u, length %d\n",
1365 start, match, length);
1367 fprintf(stderr,
"%c%c", s->window[match++], s->window[start++]);
1368 }
while (--length != 0);
1369 z_error(
"invalid match");
1371 if (z_verbose > 1) {
1372 fprintf(stderr,
"\\[%d,%d]", start-match, length);
1373 do { putc(s->window[start++], stderr); }
while (--length != 0);
1377 # define check_match(s, start, match, length) 1393 register unsigned n,
m;
1396 uInt wsize = s->w_size;
1401 more = (unsigned)(s->window_size -(
ulg)s->lookahead -(
ulg)s->strstart);
1404 if (
sizeof(
int) <= 2) {
1405 if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
1408 }
else if (more == (
unsigned)(-1)) {
1419 if (s->strstart >= wsize+
MAX_DIST(s)) {
1421 zmemcpy(s->window, s->window+wsize, (
unsigned)wsize);
1422 s->match_start -= wsize;
1423 s->strstart -= wsize;
1424 s->block_start -= (
long) wsize;
1436 *p = (
Pos)(m >= wsize ? m-wsize :
NIL);
1444 *p = (
Pos)(m >= wsize ? m-wsize :
NIL);
1452 if (s->strm->avail_in == 0)
break;
1465 Assert(more >= 2,
"more < 2");
1467 n =
read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
1471 if (s->lookahead + s->insert >=
MIN_MATCH) {
1472 uInt str = s->strstart - s->insert;
1473 s->ins_h = s->window[str];
1481 s->prev[str & s->w_mask] = s->head[s->ins_h];
1483 s->head[s->ins_h] = (
Pos)str;
1486 if (s->lookahead + s->insert <
MIN_MATCH)
1494 }
while (s->lookahead <
MIN_LOOKAHEAD && s->strm->avail_in != 0);
1503 if (s->high_water < s->window_size) {
1504 ulg curr = s->strstart + (
ulg)(s->lookahead);
1507 if (s->high_water < curr) {
1511 init = s->window_size - curr;
1514 zmemzero(s->window + curr, (
unsigned)init);
1515 s->high_water = curr + init;
1523 if (init > s->window_size - s->high_water)
1524 init = s->window_size - s->high_water;
1525 zmemzero(s->window + s->high_water, (
unsigned)init);
1526 s->high_water += init;
1531 "not enough room for search");
1538 #define FLUSH_BLOCK_ONLY(s, last) { \ 1539 _tr_flush_block(s, (s->block_start >= 0L ? \ 1540 (charf *)&s->window[(unsigned)s->block_start] : \ 1542 (ulg)((long)s->strstart - s->block_start), \ 1544 s->block_start = s->strstart; \ 1545 flush_pending(s->strm); \ 1546 Tracev((stderr,"[FLUSH]")); \ 1550 #define FLUSH_BLOCK(s, last) { \ 1551 FLUSH_BLOCK_ONLY(s, last); \ 1552 if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \ 1571 ulg max_block_size = 0xffff;
1574 if (max_block_size > s->pending_buf_size - 5) {
1575 max_block_size = s->pending_buf_size - 5;
1581 if (s->lookahead <= 1) {
1584 s->block_start >= (
long)s->w_size,
"slide too late");
1589 if (s->lookahead == 0)
break;
1591 Assert(s->block_start >= 0L,
"block gone");
1593 s->strstart += s->lookahead;
1597 max_start = s->block_start + max_block_size;
1598 if (s->strstart == 0 || (
ulg)s->strstart >= max_start) {
1600 s->lookahead = (
uInt)(s->strstart - max_start);
1601 s->strstart = (
uInt)max_start;
1607 if (s->strstart - (
uInt)s->block_start >=
MAX_DIST(s)) {
1616 if ((
long)s->strstart > s->block_start)
1646 if (s->lookahead == 0)
break;
1660 if (hash_head !=
NIL && s->strstart - hash_head <=
MAX_DIST(s)) {
1669 check_match(s, s->strstart, s->match_start, s->match_length);
1674 s->lookahead -= s->match_length;
1680 if (s->match_length <= s->max_insert_length &&
1689 }
while (--s->match_length != 0);
1694 s->strstart += s->match_length;
1695 s->match_length = 0;
1696 s->ins_h = s->window[s->strstart];
1697 UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
1707 Tracevv((stderr,
"%c", s->window[s->strstart]));
1749 if (s->lookahead == 0)
break;
1762 s->prev_length = s->match_length, s->prev_match = s->match_start;
1765 if (hash_head !=
NIL && s->prev_length < s->max_lazy_match &&
1766 s->strstart - hash_head <=
MAX_DIST(s)) {
1774 if (s->match_length <= 5 && (s->strategy ==
Z_FILTERED 1777 s->strstart - s->match_start >
TOO_FAR)
1790 if (s->prev_length >=
MIN_MATCH && s->match_length <= s->prev_length) {
1794 check_match(s, s->strstart-1, s->prev_match, s->prev_length);
1804 s->lookahead -= s->prev_length-1;
1805 s->prev_length -= 2;
1807 if (++s->strstart <= max_insert) {
1810 }
while (--s->prev_length != 0);
1811 s->match_available = 0;
1817 }
else if (s->match_available) {
1822 Tracevv((stderr,
"%c", s->window[s->strstart-1]));
1829 if (s->strm->avail_out == 0)
return need_more;
1834 s->match_available = 1;
1840 if (s->match_available) {
1841 Tracevv((stderr,
"%c", s->window[s->strstart-1]));
1843 s->match_available = 0;
1867 Bytef *scan, *strend;
1879 if (s->lookahead == 0)
break;
1883 s->match_length = 0;
1884 if (s->lookahead >=
MIN_MATCH && s->strstart > 0) {
1885 scan = s->window + s->strstart - 1;
1887 if (prev == *++scan && prev == *++scan && prev == *++scan) {
1888 strend = s->window + s->strstart +
MAX_MATCH;
1890 }
while (prev == *++scan && prev == *++scan &&
1891 prev == *++scan && prev == *++scan &&
1892 prev == *++scan && prev == *++scan &&
1893 prev == *++scan && prev == *++scan &&
1896 if (s->match_length > s->lookahead)
1897 s->match_length = s->lookahead;
1899 Assert(scan <= s->window+(
uInt)(s->window_size-1),
"wild scan");
1904 check_match(s, s->strstart, s->strstart - 1, s->match_length);
1908 s->lookahead -= s->match_length;
1909 s->strstart += s->match_length;
1910 s->match_length = 0;
1913 Tracevv((stderr,
"%c", s->window[s->strstart]));
1942 if (s->lookahead == 0) {
1944 if (s->lookahead == 0) {
1952 s->match_length = 0;
1953 Tracevv((stderr,
"%c", s->window[s->strstart]));
GLenum GLuint GLenum GLsizei length
unsigned char match[65280+2]
int ZEXPORT deflateParams(z_streamp strm, int level, int strategy)
block_state compress_func OF((deflate_state *s, int flush))
#define INSERT_STRING(s, str, match_head)
#define check_match(s, start, match, length)
local void flush_pending(z_streamp strm)
#define ZALLOC(strm, items, size)
void ZLIB_INTERNAL _tr_align(deflate_state *s)
GLsizei GLsizei GLchar * source
local uInt longest_match(deflate_state *s, IPos cur_match)
#define Z_DEFAULT_COMPRESSION
#define UPDATE_HASH(s, h, c)
int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)
uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen)
int ZEXPORT deflateEnd(z_streamp strm)
int ZEXPORT deflatePrime(z_streamp strm, int bits, int value)
GLboolean GLboolean GLboolean b
const char deflate_copyright[]
local int read_buf(z_streamp strm, Bytef *buf, unsigned size)
GLenum GLuint GLenum GLsizei const GLchar * buf
#define _tr_tally_lit(s, c, flush)
local block_state deflate_huff(deflate_state *s, int flush)
local block_state deflate_stored(deflate_state *s, int flush)
int ZEXPORT deflateCopy(z_streamp dest, z_streamp source)
#define Assert(cond, msg)
int ZEXPORT deflateTune(z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)
gz_header FAR * gz_headerp
void ZLIB_INTERNAL _tr_init(deflate_state *s)
void zmemzero(Bytef *dest, uInt len)
local block_state deflate_fast(deflate_state *s, int flush)
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque
void zmemcpy(Bytef *dest, const Bytef *source, uInt len)
#define Z_DEFAULT_STRATEGY
#define ZFREE(strm, addr)
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s)
GLsizei const GLfloat * value
int const char int stream_size
local const config configuration_table[10]
#define _tr_tally_dist(s, distance, length, flush)
int ZEXPORT deflate(z_streamp strm, int flush)
void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf, ulg stored_len, int last)
local void fill_window(deflate_state *s)
if(!abbox) return FT_THROW(Invalid_Argument)
local block_state deflate_rle(deflate_state *s, int flush)
local void putShortMSB(deflate_state *s, uInt b)
struct internal_state deflate_state
void zcfree(voidpf opaque, voidpf ptr)
int zmemcmp(Bytef *s1, const Bytef *s2, uInt len) const
int ZEXPORT deflateResetKeep(z_streamp strm)
int ZEXPORT deflateSetDictionary(z_streamp strm, const Bytef *dictionary, uInt dictLength)
voidpf zcalloc(voidpf opaque, unsigned items, unsigned size)
int ZEXPORT deflateSetHeader(z_streamp strm, gz_headerp head)
#define FLUSH_BLOCK(s, last)
local void lm_init(deflate_state *s)
int ZEXPORT deflateInit_(z_streamp strm, int level, const char *version, int stream_size)
local block_state deflate_slow(deflate_state *s, int flush)
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
int ZEXPORT deflateReset(z_streamp strm)
int ZEXPORT deflatePending(z_streamp strm, unsigned *pending, int *bits)
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len)
#define ERR_RETURN(strm, err)
#define FLUSH_BLOCK_ONLY(s, last)