"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zlib/zlib/deflate.h" between
muscle7.61.zip and muscle7.62.zip

About: MUSCLE (Multi User Server Client Linking Environment) is a messaging server and networking API. The included server program ("muscled") lets its clients message each other, and/or store information in its serverside hierarchical database.

deflate.h  (muscle7.61):deflate.h  (muscle7.62)
/* deflate.h -- internal compression state /* deflate.h -- internal compression state
* Copyright (C) 1995-2012 Jean-loup Gailly * Copyright (C) 1995-2016 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
/* WARNING: this file should *not* be used by applications. It is /* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h. subject to change. Applications should only use zlib.h.
*/ */
/* @(#) $Id$ */ /* @(#) $Id$ */
skipping to change at line 54 skipping to change at line 54
#define HEAP_SIZE (2*L_CODES+1) #define HEAP_SIZE (2*L_CODES+1)
/* maximum heap size */ /* maximum heap size */
#define MAX_BITS 15 #define MAX_BITS 15
/* All codes must not exceed MAX_BITS bits */ /* All codes must not exceed MAX_BITS bits */
#define Buf_size 16 #define Buf_size 16
/* size of bit buffer in bi_buf */ /* size of bit buffer in bi_buf */
#define INIT_STATE 42 #define INIT_STATE 42 /* zlib header -> BUSY_STATE */
#define EXTRA_STATE 69 #ifdef GZIP
#define NAME_STATE 73 # define GZIP_STATE 57 /* gzip header -> BUSY_STATE | EXTRA_STATE */
#define COMMENT_STATE 91 #endif
#define HCRC_STATE 103 #define EXTRA_STATE 69 /* gzip extra block -> NAME_STATE */
#define BUSY_STATE 113 #define NAME_STATE 73 /* gzip file name -> COMMENT_STATE */
#define FINISH_STATE 666 #define COMMENT_STATE 91 /* gzip comment -> HCRC_STATE */
#define HCRC_STATE 103 /* gzip header CRC -> BUSY_STATE */
#define BUSY_STATE 113 /* deflate -> FINISH_STATE */
#define FINISH_STATE 666 /* stream complete */
/* Stream status */ /* Stream status */
/* Data structure describing a single value and its code string. */ /* Data structure describing a single value and its code string. */
typedef struct ct_data_s { typedef struct ct_data_s {
union { union {
ush freq; /* frequency count */ ush freq; /* frequency count */
ush code; /* bit string */ ush code; /* bit string */
} fc; } fc;
union { union {
ush dad; /* father node in Huffman tree */ ush dad; /* father node in Huffman tree */
skipping to change at line 85 skipping to change at line 88
#define Freq fc.freq #define Freq fc.freq
#define Code fc.code #define Code fc.code
#define Dad dl.dad #define Dad dl.dad
#define Len dl.len #define Len dl.len
typedef struct static_tree_desc_s static_tree_desc; typedef struct static_tree_desc_s static_tree_desc;
typedef struct tree_desc_s { typedef struct tree_desc_s {
ct_data *dyn_tree; /* the dynamic tree */ ct_data *dyn_tree; /* the dynamic tree */
int max_code; /* largest code with non zero frequency */ int max_code; /* largest code with non zero frequency */
static_tree_desc *stat_desc; /* the corresponding static tree */ const static_tree_desc *stat_desc; /* the corresponding static tree */
} FAR tree_desc; } FAR tree_desc;
typedef ush Pos; typedef ush Pos;
typedef Pos FAR Posf; typedef Pos FAR Posf;
typedef unsigned IPos; typedef unsigned IPos;
/* A Pos is an index in the character window. We use short instead of int to /* A Pos is an index in the character window. We use short instead of int to
* save space in the various tables. IPos is used only for parameter passing. * save space in the various tables. IPos is used only for parameter passing.
*/ */
typedef struct internal_state { typedef struct internal_state {
z_streamp strm; /* pointer back to this zlib stream */ z_streamp strm; /* pointer back to this zlib stream */
int status; /* as the name implies */ int status; /* as the name implies */
Bytef *pending_buf; /* output still pending */ Bytef *pending_buf; /* output still pending */
ulg pending_buf_size; /* size of pending_buf */ ulg pending_buf_size; /* size of pending_buf */
Bytef *pending_out; /* next pending byte to output to the stream */ Bytef *pending_out; /* next pending byte to output to the stream */
uInt pending; /* nb of bytes in the pending buffer */ ulg pending; /* nb of bytes in the pending buffer */
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
gz_headerp gzhead; /* gzip header information to write */ gz_headerp gzhead; /* gzip header information to write */
uInt gzindex; /* where in extra, name, or comment */ ulg gzindex; /* where in extra, name, or comment */
Byte method; /* can only be DEFLATED */ Byte method; /* can only be DEFLATED */
int last_flush; /* value of flush param for previous deflate call */ int last_flush; /* value of flush param for previous deflate call */
/* used by deflate.c: */ /* used by deflate.c: */
uInt w_size; /* LZ77 window size (32K by default) */ uInt w_size; /* LZ77 window size (32K by default) */
uInt w_bits; /* log2(w_size) (8..16) */ uInt w_bits; /* log2(w_size) (8..16) */
uInt w_mask; /* w_size - 1 */ uInt w_mask; /* w_size - 1 */
Bytef *window; Bytef *window;
skipping to change at line 251 skipping to change at line 254
/* Buffer for distances. To simplify the code, d_buf and l_buf have /* Buffer for distances. To simplify the code, d_buf and l_buf have
* the same number of elements. To use different lengths, an extra flag * the same number of elements. To use different lengths, an extra flag
* array would be necessary. * array would be necessary.
*/ */
ulg opt_len; /* bit length of current block with optimal trees */ ulg opt_len; /* bit length of current block with optimal trees */
ulg static_len; /* bit length of current block with static trees */ ulg static_len; /* bit length of current block with static trees */
uInt matches; /* number of string matches in current block */ uInt matches; /* number of string matches in current block */
uInt insert; /* bytes at end of window left to insert */ uInt insert; /* bytes at end of window left to insert */
#ifdef DEBUG #ifdef ZLIB_DEBUG
ulg compressed_len; /* total bit length of compressed file mod 2^32 */ ulg compressed_len; /* total bit length of compressed file mod 2^32 */
ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
#endif #endif
ush bi_buf; ush bi_buf;
/* Output buffer. bits are inserted starting at the bottom (least /* Output buffer. bits are inserted starting at the bottom (least
* significant bits). * significant bits).
*/ */
int bi_valid; int bi_valid;
/* Number of valid bits in bi_buf. All bits above the last valid bit /* Number of valid bits in bi_buf. All bits above the last valid bit
skipping to change at line 277 skipping to change at line 280
* this are set to zero in order to avoid memory check warnings when * this are set to zero in order to avoid memory check warnings when
* longest match routines access bytes past the input. This is then * longest match routines access bytes past the input. This is then
* updated to the new high water mark. * updated to the new high water mark.
*/ */
} FAR deflate_state; } FAR deflate_state;
/* Output a byte on the stream. /* Output a byte on the stream.
* IN assertion: there is enough room in pending_buf. * IN assertion: there is enough room in pending_buf.
*/ */
#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} #define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
/* Minimum amount of lookahead, except at the end of the input file. /* Minimum amount of lookahead, except at the end of the input file.
* See deflate.c for comments about the MIN_MATCH+1. * See deflate.c for comments about the MIN_MATCH+1.
*/ */
#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) #define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
/* In order to simplify the code, particularly on 16 bit machines, match /* In order to simplify the code, particularly on 16 bit machines, match
* distances are limited to MAX_DIST instead of WSIZE. * distances are limited to MAX_DIST instead of WSIZE.
*/ */
skipping to change at line 310 skipping to change at line 313
void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
ulg stored_len, int last)); ulg stored_len, int last));
#define d_code(dist) \ #define d_code(dist) \
((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
/* Mapping from a distance to a distance code. dist is the distance - 1 and /* Mapping from a distance to a distance code. dist is the distance - 1 and
* must not have side effects. _dist_code[256] and _dist_code[257] are never * must not have side effects. _dist_code[256] and _dist_code[257] are never
* used. * used.
*/ */
#ifndef DEBUG #ifndef ZLIB_DEBUG
/* Inline versions of _tr_tally for speed: */ /* Inline versions of _tr_tally for speed: */
#if defined(GEN_TREES_H) || !defined(STDC) #if defined(GEN_TREES_H) || !defined(STDC)
extern uch ZLIB_INTERNAL _length_code[]; extern uch ZLIB_INTERNAL _length_code[];
extern uch ZLIB_INTERNAL _dist_code[]; extern uch ZLIB_INTERNAL _dist_code[];
#else #else
extern const uch ZLIB_INTERNAL _length_code[]; extern const uch ZLIB_INTERNAL _length_code[];
extern const uch ZLIB_INTERNAL _dist_code[]; extern const uch ZLIB_INTERNAL _dist_code[];
#endif #endif
# define _tr_tally_lit(s, c, flush) \ # define _tr_tally_lit(s, c, flush) \
{ uch cc = (c); \ { uch cc = (c); \
s->d_buf[s->last_lit] = 0; \ s->d_buf[s->last_lit] = 0; \
s->l_buf[s->last_lit++] = cc; \ s->l_buf[s->last_lit++] = cc; \
s->dyn_ltree[cc].Freq++; \ s->dyn_ltree[cc].Freq++; \
flush = (s->last_lit == s->lit_bufsize-1); \ flush = (s->last_lit == s->lit_bufsize-1); \
} }
# define _tr_tally_dist(s, distance, length, flush) \ # define _tr_tally_dist(s, distance, length, flush) \
{ uch len = (length); \ { uch len = (uch)(length); \
ush dist = (distance); \ ush dist = (ush)(distance); \
s->d_buf[s->last_lit] = dist; \ s->d_buf[s->last_lit] = dist; \
s->l_buf[s->last_lit++] = len; \ s->l_buf[s->last_lit++] = len; \
dist--; \ dist--; \
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
s->dyn_dtree[d_code(dist)].Freq++; \ s->dyn_dtree[d_code(dist)].Freq++; \
flush = (s->last_lit == s->lit_bufsize-1); \ flush = (s->last_lit == s->lit_bufsize-1); \
} }
#else #else
# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
# define _tr_tally_dist(s, distance, length, flush) \ # define _tr_tally_dist(s, distance, length, flush) \
 End of changes. 9 change blocks. 
16 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)