Lines Matching refs:s

78 typedef block_state (*compress_func) OF((deflate_state *s, int flush));
81 local void fill_window OF((deflate_state *s));
82 local block_state deflate_stored OF((deflate_state *s, int flush));
83 local block_state deflate_fast OF((deflate_state *s, int flush));
85 local block_state deflate_slow OF((deflate_state *s, int flush));
87 local void lm_init OF((deflate_state *s));
88 local void putShortMSB OF((deflate_state *s, uInt b));
94 uInt longest_match OF((deflate_state *s, IPos cur_match));
96 local uInt longest_match OF((deflate_state *s, IPos cur_match));
99 local uInt longest_match_fast OF((deflate_state *s, IPos cur_match));
102 local void check_match OF((deflate_state *s, IPos start, IPos match,
175 #define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask) argument
189 #define INSERT_STRING(s, str, match_head) \ argument
190 (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
191 match_head = s->head[s->ins_h], \
192 s->head[s->ins_h] = (Pos)(str))
194 #define INSERT_STRING(s, str, match_head) \ argument
195 (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
196 match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
197 s->head[s->ins_h] = (Pos)(str))
204 #define CLEAR_HASH(s) \ argument
205 s->head[s->hash_size-1] = NIL; \
206 (void) zmemzero((Bytef *)s->head, \
207 (unsigned)(s->hash_size-1)*sizeof(*s->head));
233 deflate_state *s; local
277 s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
278 if (s == Z_NULL) return Z_MEM_ERROR;
279 strm->state = (struct internal_state FAR *)s;
280 s->strm = strm;
282 s->wrap = wrap;
283 s->gzhead = Z_NULL;
284 s->w_bits = windowBits;
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;
291 s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
293 s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
294 s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
295 s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
297 s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
299 overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
300 s->pending_buf = (uchf *) overlay;
301 s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
303 if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
304 s->pending_buf == Z_NULL) {
305 s->status = FINISH_STATE;
310 s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
311 s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
313 s->level = level;
314 s->strategy = strategy;
315 s->method = (Byte)method;
326 deflate_state *s; local
336 s = strm->state;
337 if (s->wrap)
341 if (length > MAX_DIST(s)) {
342 length = MAX_DIST(s);
345 (void) zmemcpy(s->window, dictionary, length);
346 s->strstart = length;
347 s->block_start = (long)length;
353 s->ins_h = s->window[0];
354 UPDATE_HASH(s, s->ins_h, s->window[1]);
356 INSERT_STRING(s, n, hash_head);
366 deflate_state *s; local
377 s = (deflate_state *)strm->state;
378 s->pending = 0;
379 s->pending_out = s->pending_buf;
381 if (s->wrap < 0) {
382 s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
384 s->status = s->wrap ? INIT_STATE : BUSY_STATE;
387 s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
390 s->last_flush = Z_NO_FLUSH;
392 _tr_init(s);
393 lm_init(s);
427 deflate_state *s; local
432 s = strm->state;
442 func = configuration_table[s->level].func;
448 if (s->level != level) {
449 s->level = level;
450 s->max_lazy_match = configuration_table[level].max_lazy;
451 s->good_match = configuration_table[level].good_length;
452 s->nice_match = configuration_table[level].nice_length;
453 s->max_chain_length = configuration_table[level].max_chain;
455 s->strategy = strategy;
467 deflate_state *s; local
470 s = strm->state;
471 s->good_match = good_length;
472 s->max_lazy_match = max_lazy;
473 s->nice_match = nice_length;
474 s->max_chain_length = max_chain;
499 deflate_state *s; local
511 s = strm->state;
512 if (s->w_bits != 15 || s->hash_bits != 8 + 7)
524 local void putShortMSB (s, b) in putShortMSB() argument
525 deflate_state *s; in putShortMSB()
528 put_byte(s, (Byte)(b >> 8));
529 put_byte(s, (Byte)(b & 0xff));
563 deflate_state *s; local
569 s = strm->state;
573 (s->status == FINISH_STATE && flush != Z_FINISH)) {
578 s->strm = strm; /* just in case */
579 old_flush = s->last_flush;
580 s->last_flush = flush;
583 if (s->status == INIT_STATE) {
585 if (s->wrap == 2) {
587 put_byte(s, 31);
588 put_byte(s, 139);
589 put_byte(s, 8);
590 if (s->gzhead == NULL) {
591 put_byte(s, 0);
592 put_byte(s, 0);
593 put_byte(s, 0);
594 put_byte(s, 0);
595 put_byte(s, 0);
596 put_byte(s, s->level == 9 ? 2 :
597 (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
599 put_byte(s, OS_CODE);
600 s->status = BUSY_STATE;
603 put_byte(s, (s->gzhead->text ? 1 : 0) +
604 (s->gzhead->hcrc ? 2 : 0) +
605 (s->gzhead->extra == Z_NULL ? 0 : 4) +
606 (s->gzhead->name == Z_NULL ? 0 : 8) +
607 (s->gzhead->comment == Z_NULL ? 0 : 16)
609 put_byte(s, (Byte)(s->gzhead->time & 0xff));
610 put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
611 put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
612 put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
613 put_byte(s, s->level == 9 ? 2 :
614 (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
616 put_byte(s, s->gzhead->os & 0xff);
617 if (s->gzhead->extra != NULL) {
618 put_byte(s, s->gzhead->extra_len & 0xff);
619 put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
621 if (s->gzhead->hcrc)
622 strm->adler = crc32(strm->adler, s->pending_buf,
623 s->pending);
624 s->gzindex = 0;
625 s->status = EXTRA_STATE;
631 uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
634 if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
636 else if (s->level < 6)
638 else if (s->level == 6)
643 if (s->strstart != 0) header |= PRESET_DICT;
646 s->status = BUSY_STATE;
647 putShortMSB(s, header);
650 if (s->strstart != 0) {
651 putShortMSB(s, (uInt)(strm->adler >> 16));
652 putShortMSB(s, (uInt)(strm->adler & 0xffff));
658 if (s->status == EXTRA_STATE) {
659 if (s->gzhead->extra != NULL) {
660 uInt beg = s->pending; /* start of bytes to update crc */
662 while (s->gzindex < (s->gzhead->extra_len & 0xffff)) {
663 if (s->pending == s->pending_buf_size) {
664 if (s->gzhead->hcrc && s->pending > beg)
665 strm->adler = crc32(strm->adler, s->pending_buf + beg,
666 s->pending - beg);
668 beg = s->pending;
669 if (s->pending == s->pending_buf_size)
672 put_byte(s, s->gzhead->extra[s->gzindex]);
673 s->gzindex++;
675 if (s->gzhead->hcrc && s->pending > beg)
676 strm->adler = crc32(strm->adler, s->pending_buf + beg,
677 s->pending - beg);
678 if (s->gzindex == s->gzhead->extra_len) {
679 s->gzindex = 0;
680 s->status = NAME_STATE;
684 s->status = NAME_STATE;
686 if (s->status == NAME_STATE) {
687 if (s->gzhead->name != NULL) {
688 uInt beg = s->pending; /* start of bytes to update crc */
692 if (s->pending == s->pending_buf_size) {
693 if (s->gzhead->hcrc && s->pending > beg)
694 strm->adler = crc32(strm->adler, s->pending_buf + beg,
695 s->pending - beg);
697 beg = s->pending;
698 if (s->pending == s->pending_buf_size) {
703 val = s->gzhead->name[s->gzindex++];
704 put_byte(s, val);
706 if (s->gzhead->hcrc && s->pending > beg)
707 strm->adler = crc32(strm->adler, s->pending_buf + beg,
708 s->pending - beg);
710 s->gzindex = 0;
711 s->status = COMMENT_STATE;
715 s->status = COMMENT_STATE;
717 if (s->status == COMMENT_STATE) {
718 if (s->gzhead->comment != NULL) {
719 uInt beg = s->pending; /* start of bytes to update crc */
723 if (s->pending == s->pending_buf_size) {
724 if (s->gzhead->hcrc && s->pending > beg)
725 strm->adler = crc32(strm->adler, s->pending_buf + beg,
726 s->pending - beg);
728 beg = s->pending;
729 if (s->pending == s->pending_buf_size) {
734 val = s->gzhead->comment[s->gzindex++];
735 put_byte(s, val);
737 if (s->gzhead->hcrc && s->pending > beg)
738 strm->adler = crc32(strm->adler, s->pending_buf + beg,
739 s->pending - beg);
741 s->status = HCRC_STATE;
744 s->status = HCRC_STATE;
746 if (s->status == HCRC_STATE) {
747 if (s->gzhead->hcrc) {
748 if (s->pending + 2 > s->pending_buf_size)
750 if (s->pending + 2 <= s->pending_buf_size) {
751 put_byte(s, (Byte)(strm->adler & 0xff));
752 put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
754 s->status = BUSY_STATE;
758 s->status = BUSY_STATE;
763 if (s->pending != 0) {
772 s->last_flush = -1;
786 if (s->status == FINISH_STATE && strm->avail_in != 0) {
792 if (strm->avail_in != 0 || s->lookahead != 0 ||
793 (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
796 bstate = (*(configuration_table[s->level].func))(s, flush);
799 s->status = FINISH_STATE;
803 s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
816 _tr_align(s);
818 _tr_stored_block(s, (char*)0, 0L, 0);
823 CLEAR_HASH(s); /* forget history */
828 s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
836 if (s->wrap <= 0) return Z_STREAM_END;
840 if (s->wrap == 2) {
841 put_byte(s, (Byte)(strm->adler & 0xff));
842 put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
843 put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
844 put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
845 put_byte(s, (Byte)(strm->total_in & 0xff));
846 put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
847 put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
848 put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
853 putShortMSB(s, (uInt)(strm->adler >> 16));
854 putShortMSB(s, (uInt)(strm->adler & 0xffff));
860 if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
861 return s->pending != 0 ? Z_OK : Z_STREAM_END;
992 local void lm_init (s) in lm_init() argument
993 deflate_state *s; in lm_init()
995 s->window_size = (ulg)2L*s->w_size;
997 CLEAR_HASH(s);
1001 s->max_lazy_match = configuration_table[s->level].max_lazy;
1002 s->good_match = configuration_table[s->level].good_length;
1003 s->nice_match = configuration_table[s->level].nice_length;
1004 s->max_chain_length = configuration_table[s->level].max_chain;
1006 s->strstart = 0;
1007 s->block_start = 0L;
1008 s->lookahead = 0;
1009 s->match_length = s->prev_length = MIN_MATCH-1;
1010 s->match_available = 0;
1011 s->ins_h = 0;
1033 local uInt longest_match(s, cur_match) in longest_match() argument
1034 deflate_state *s; in longest_match()
1037 unsigned chain_length = s->max_chain_length;/* max hash chain length */
1038 register Bytef *scan = s->window + s->strstart; /* current string */
1041 int best_len = s->prev_length; /* best match length so far */
1042 int nice_match = s->nice_match; /* stop if match long enough */
1043 IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
1044 s->strstart - (IPos)MAX_DIST(s) : NIL;
1048 Posf *prev = s->prev;
1049 uInt wmask = s->w_mask;
1055 register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
1059 register Bytef *strend = s->window + s->strstart + MAX_MATCH;
1067 Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
1070 if (s->prev_length >= s->good_match) {
1076 if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
1078 Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
1081 Assert(cur_match < s->strstart, "no future");
1082 match = s->window + cur_match;
1119 Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
1151 Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
1159 s->match_start = cur_match;
1172 if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
1173 return s->lookahead;
1181 local uInt longest_match_fast(s, cur_match) in longest_match_fast() argument
1182 deflate_state *s; in longest_match_fast()
1185 register Bytef *scan = s->window + s->strstart; /* current string */
1188 register Bytef *strend = s->window + s->strstart + MAX_MATCH;
1193 Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
1195 Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
1197 Assert(cur_match < s->strstart, "no future");
1199 match = s->window + cur_match;
1224 Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
1230 s->match_start = cur_match;
1231 return (uInt)len <= s->lookahead ? (uInt)len : s->lookahead;
1238 local void check_match(s, start, match, length) in check_match() argument
1239 deflate_state *s; in check_match()
1244 if (zmemcmp(s->window + match,
1245 s->window + start, length) != EQUAL) {
1249 fprintf(stderr, "%c%c", s->window[match++], s->window[start++]);
1255 do { putc(s->window[start++], stderr); } while (--length != 0);
1259 # define check_match(s, start, match, length) argument
1272 local void fill_window(s) in fill_window() argument
1273 deflate_state *s; in fill_window()
1278 uInt wsize = s->w_size;
1281 more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
1285 if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
1299 if (s->strstart >= wsize+MAX_DIST(s)) {
1301 zmemcpy(s->window, s->window+wsize, (unsigned)wsize);
1302 s->match_start -= wsize;
1303 s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
1304 s->block_start -= (long) wsize;
1313 n = s->hash_size;
1314 p = &s->head[n];
1322 p = &s->prev[n];
1333 if (s->strm->avail_in == 0) return;
1348 n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
1349 s->lookahead += n;
1352 if (s->lookahead >= MIN_MATCH) {
1353 s->ins_h = s->window[s->strstart];
1354 UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
1363 } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
1370 #define FLUSH_BLOCK_ONLY(s, eof) { \ argument
1371 _tr_flush_block(s, (s->block_start >= 0L ? \
1372 (charf *)&s->window[(unsigned)s->block_start] : \
1374 (ulg)((long)s->strstart - s->block_start), \
1376 s->block_start = s->strstart; \
1377 flush_pending(s->strm); \
1382 #define FLUSH_BLOCK(s, eof) { \ argument
1383 FLUSH_BLOCK_ONLY(s, eof); \
1384 if (s->strm->avail_out == 0) return (eof) ? finish_started : need_more; \
1396 local block_state deflate_stored(s, flush) in deflate_stored() argument
1397 deflate_state *s; in deflate_stored()
1406 if (max_block_size > s->pending_buf_size - 5) {
1407 max_block_size = s->pending_buf_size - 5;
1413 if (s->lookahead <= 1) {
1415 Assert(s->strstart < s->w_size+MAX_DIST(s) ||
1416 s->block_start >= (long)s->w_size, "slide too late");
1418 fill_window(s);
1419 if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more;
1421 if (s->lookahead == 0) break; /* flush the current block */
1423 Assert(s->block_start >= 0L, "block gone");
1425 s->strstart += s->lookahead;
1426 s->lookahead = 0;
1429 max_start = s->block_start + max_block_size;
1430 if (s->strstart == 0 || (ulg)s->strstart >= max_start) {
1432 s->lookahead = (uInt)(s->strstart - max_start);
1433 s->strstart = (uInt)max_start;
1434 FLUSH_BLOCK(s, 0);
1439 if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) {
1440 FLUSH_BLOCK(s, 0);
1443 FLUSH_BLOCK(s, flush == Z_FINISH);
1454 local block_state deflate_fast(s, flush) in deflate_fast() argument
1455 deflate_state *s; in deflate_fast()
1467 if (s->lookahead < MIN_LOOKAHEAD) {
1468 fill_window(s);
1469 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1472 if (s->lookahead == 0) break; /* flush the current block */
1478 if (s->lookahead >= MIN_MATCH) {
1479 INSERT_STRING(s, s->strstart, hash_head);
1485 if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
1491 if ((s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) ||
1492 (s->strategy == Z_RLE && s->strstart - hash_head == 1)) {
1493 s->match_length = longest_match_fast (s, hash_head);
1496 if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {
1497 s->match_length = longest_match (s, hash_head);
1498 } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
1499 s->match_length = longest_match_fast (s, hash_head);
1504 if (s->match_length >= MIN_MATCH) {
1505 check_match(s, s->strstart, s->match_start, s->match_length);
1507 _tr_tally_dist(s, s->strstart - s->match_start,
1508 s->match_length - MIN_MATCH, bflush);
1510 s->lookahead -= s->match_length;
1516 if (s->match_length <= s->max_insert_length &&
1517 s->lookahead >= MIN_MATCH) {
1518 s->match_length--; /* string at strstart already in table */
1520 s->strstart++;
1521 INSERT_STRING(s, s->strstart, hash_head);
1525 } while (--s->match_length != 0);
1526 s->strstart++;
1530 s->strstart += s->match_length;
1531 s->match_length = 0;
1532 s->ins_h = s->window[s->strstart];
1533 UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
1543 Tracevv((stderr,"%c", s->window[s->strstart]));
1544 _tr_tally_lit (s, s->window[s->strstart], bflush);
1545 s->lookahead--;
1546 s->strstart++;
1548 if (bflush) FLUSH_BLOCK(s, 0);
1550 FLUSH_BLOCK(s, flush == Z_FINISH);
1560 local block_state deflate_slow(s, flush) in deflate_slow() argument
1561 deflate_state *s; in deflate_slow()
1574 if (s->lookahead < MIN_LOOKAHEAD) {
1575 fill_window(s);
1576 if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
1579 if (s->lookahead == 0) break; /* flush the current block */
1585 if (s->lookahead >= MIN_MATCH) {
1586 INSERT_STRING(s, s->strstart, hash_head);
1591 s->prev_length = s->match_length, s->prev_match = s->match_start;
1592 s->match_length = MIN_MATCH-1;
1594 if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
1595 s->strstart - hash_head <= MAX_DIST(s)) {
1600 if (s->strategy != Z_HUFFMAN_ONLY && s->strategy != Z_RLE) {
1601 s->match_length = longest_match (s, hash_head);
1602 } else if (s->strategy == Z_RLE && s->strstart - hash_head == 1) {
1603 s->match_length = longest_match_fast (s, hash_head);
1607 if (s->match_length <= 5 && (s->strategy == Z_FILTERED
1609 || (s->match_length == MIN_MATCH &&
1610 s->strstart - s->match_start > TOO_FAR)
1617 s->match_length = MIN_MATCH-1;
1623 if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
1624 uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
1627 check_match(s, s->strstart-1, s->prev_match, s->prev_length);
1629 _tr_tally_dist(s, s->strstart -1 - s->prev_match,
1630 s->prev_length - MIN_MATCH, bflush);
1637 s->lookahead -= s->prev_length-1;
1638 s->prev_length -= 2;
1640 if (++s->strstart <= max_insert) {
1641 INSERT_STRING(s, s->strstart, hash_head);
1643 } while (--s->prev_length != 0);
1644 s->match_available = 0;
1645 s->match_length = MIN_MATCH-1;
1646 s->strstart++;
1648 if (bflush) FLUSH_BLOCK(s, 0);
1650 } else if (s->match_available) {
1655 Tracevv((stderr,"%c", s->window[s->strstart-1]));
1656 _tr_tally_lit(s, s->window[s->strstart-1], bflush);
1658 FLUSH_BLOCK_ONLY(s, 0);
1660 s->strstart++;
1661 s->lookahead--;
1662 if (s->strm->avail_out == 0) return need_more;
1667 s->match_available = 1;
1668 s->strstart++;
1669 s->lookahead--;
1673 if (s->match_available) {
1674 Tracevv((stderr,"%c", s->window[s->strstart-1]));
1675 _tr_tally_lit(s, s->window[s->strstart-1], bflush);
1676 s->match_available = 0;
1678 FLUSH_BLOCK(s, flush == Z_FINISH);
1689 local block_state deflate_rle(s, flush)
1690 deflate_state *s;
1704 if (s->lookahead < MAX_MATCH) {
1705 fill_window(s);
1706 if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) {
1709 if (s->lookahead == 0) break; /* flush the current block */
1714 if (s->strstart > 0) { /* if there is a previous byte, that is */
1715 max = s->lookahead < MAX_MATCH ? s->lookahead : MAX_MATCH;
1716 scan = s->window + s->strstart - 1;
1726 check_match(s, s->strstart, s->strstart - 1, run);
1727 _tr_tally_dist(s, 1, run - MIN_MATCH, bflush);
1728 s->lookahead -= run;
1729 s->strstart += run;
1732 Tracevv((stderr,"%c", s->window[s->strstart]));
1733 _tr_tally_lit (s, s->window[s->strstart], bflush);
1734 s->lookahead--;
1735 s->strstart++;
1737 if (bflush) FLUSH_BLOCK(s, 0);
1739 FLUSH_BLOCK(s, flush == Z_FINISH);