diff options
Diffstat (limited to 'deflate.c')
-rw-r--r-- | deflate.c | 27 |
1 files changed, 23 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* deflate.c -- compress data using the deflation algorithm | 1 | /* deflate.c -- compress data using the deflation algorithm |
2 | * Copyright (C) 1995-2004 Jean-loup Gailly. | 2 | * Copyright (C) 1995-2005 Jean-loup Gailly. |
3 | * For conditions of distribution and use, see copyright notice in zlib.h | 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -52,7 +52,7 @@ | |||
52 | #include "deflate.h" | 52 | #include "deflate.h" |
53 | 53 | ||
54 | const char deflate_copyright[] = | 54 | const char deflate_copyright[] = |
55 | " deflate 1.2.2.2 Copyright 1995-2004 Jean-loup Gailly "; | 55 | " deflate 1.2.2.3 Copyright 1995-2005 Jean-loup Gailly "; |
56 | /* | 56 | /* |
57 | If you use the zlib library in a product, an acknowledgment is welcome | 57 | If you use the zlib library in a product, an acknowledgment is welcome |
58 | in the documentation of your product. If for some reason you cannot | 58 | in the documentation of your product. If for some reason you cannot |
@@ -334,9 +334,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) | |||
334 | if (length < MIN_MATCH) return Z_OK; | 334 | if (length < MIN_MATCH) return Z_OK; |
335 | if (length > MAX_DIST(s)) { | 335 | if (length > MAX_DIST(s)) { |
336 | length = MAX_DIST(s); | 336 | length = MAX_DIST(s); |
337 | #ifndef USE_DICT_HEAD | ||
338 | dictionary += dictLength - length; /* use the tail of the dictionary */ | 337 | dictionary += dictLength - length; /* use the tail of the dictionary */ |
339 | #endif | ||
340 | } | 338 | } |
341 | zmemcpy(s->window, dictionary, length); | 339 | zmemcpy(s->window, dictionary, length); |
342 | s->strstart = length; | 340 | s->strstart = length; |
@@ -452,6 +450,25 @@ int ZEXPORT deflateParams(strm, level, strategy) | |||
452 | return err; | 450 | return err; |
453 | } | 451 | } |
454 | 452 | ||
453 | /* ========================================================================= */ | ||
454 | int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) | ||
455 | z_streamp strm; | ||
456 | int good_length; | ||
457 | int max_lazy; | ||
458 | int nice_length; | ||
459 | int max_chain; | ||
460 | { | ||
461 | deflate_state *s; | ||
462 | |||
463 | if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; | ||
464 | s = strm->state; | ||
465 | s->good_match = good_length; | ||
466 | s->max_lazy_match = max_lazy; | ||
467 | s->nice_match = nice_length; | ||
468 | s->max_chain_length = max_chain; | ||
469 | return Z_OK; | ||
470 | } | ||
471 | |||
455 | /* ========================================================================= | 472 | /* ========================================================================= |
456 | * For the default windowBits of 15 and memLevel of 8, this function returns | 473 | * For the default windowBits of 15 and memLevel of 8, this function returns |
457 | * a close to exact, as well as small, upper bound on the compressed size. | 474 | * a close to exact, as well as small, upper bound on the compressed size. |
@@ -986,9 +1003,11 @@ local void lm_init (s) | |||
986 | s->match_length = s->prev_length = MIN_MATCH-1; | 1003 | s->match_length = s->prev_length = MIN_MATCH-1; |
987 | s->match_available = 0; | 1004 | s->match_available = 0; |
988 | s->ins_h = 0; | 1005 | s->ins_h = 0; |
1006 | #ifndef FASTEST | ||
989 | #ifdef ASMV | 1007 | #ifdef ASMV |
990 | match_init(); /* initialize the asm code */ | 1008 | match_init(); /* initialize the asm code */ |
991 | #endif | 1009 | #endif |
1010 | #endif | ||
992 | } | 1011 | } |
993 | 1012 | ||
994 | #ifndef FASTEST | 1013 | #ifndef FASTEST |