=========================================================================== * Initialize the "longest match" routines for a new zlib stream */
| 671 | * Initialize the "longest match" routines for a new zlib stream |
| 672 | */ |
| 673 | local void lm_init(deflate_state *s) { |
| 674 | s->window_size = (ulg)2L*s->w_size; |
| 675 | |
| 676 | CLEAR_HASH(s); |
| 677 | |
| 678 | /* Set the default configuration parameters: |
| 679 | */ |
| 680 | s->max_lazy_match = configuration_table[s->level].max_lazy; |
| 681 | s->good_match = configuration_table[s->level].good_length; |
| 682 | s->nice_match = configuration_table[s->level].nice_length; |
| 683 | s->max_chain_length = configuration_table[s->level].max_chain; |
| 684 | |
| 685 | s->strstart = 0; |
| 686 | s->block_start = 0L; |
| 687 | s->lookahead = 0; |
| 688 | s->insert = 0; |
| 689 | s->match_length = s->prev_length = MIN_MATCH-1; |
| 690 | s->match_available = 0; |
| 691 | s->ins_h = 0; |
| 692 | } |
| 693 | |
| 694 | /* ========================================================================= */ |
| 695 | int ZEXPORT deflateReset(z_streamp strm) { |