~ubuntu-branches/ubuntu/trusty/rsync/trusty

« back to all changes in this revision

Viewing changes to zlib/deflate.h

  • Committer: Package Import Robot
  • Author(s): Paul Slootman
  • Date: 2013-10-27 12:01:10 UTC
  • mfrom: (1.1.13) (2.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20131027120110-mpr03n5scqmf40mi
Tags: 3.1.0-2
fix build failure if zlib1g-dev package is not installed;
solved by building without the included zlib source and adding a
build-depends on zlib1g-dev >= 1:1.2.8
closes:32379

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* deflate.h -- internal compression state
2
 
 * Copyright (C) 1995-2004 Jean-loup Gailly
 
2
 * Copyright (C) 1995-2012 Jean-loup Gailly
3
3
 * For conditions of distribution and use, see copyright notice in zlib.h
4
4
 */
5
5
 
48
48
#define MAX_BITS 15
49
49
/* All codes must not exceed MAX_BITS bits */
50
50
 
 
51
#define Buf_size 16
 
52
/* size of bit buffer in bi_buf */
 
53
 
51
54
#define INIT_STATE    42
52
55
#define EXTRA_STATE   69
53
56
#define NAME_STATE    73
101
104
    int   wrap;          /* bit 0 true for zlib, bit 1 true for gzip */
102
105
    gz_headerp  gzhead;  /* gzip header information to write */
103
106
    uInt   gzindex;      /* where in extra, name, or comment */
104
 
    Byte  method;        /* STORED (for zip only) or DEFLATED */
 
107
    Byte  method;        /* can only be DEFLATED */
105
108
    int   last_flush;    /* value of flush param for previous deflate call */
106
109
 
107
110
                /* used by deflate.c: */
188
191
    int nice_match; /* Stop searching when current match exceeds this */
189
192
 
190
193
                /* used by trees.c: */
191
 
    /* Didn't use ct_data typedef below to supress compiler warning */
 
194
    /* Didn't use ct_data typedef below to suppress compiler warning */
192
195
    struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
193
196
    struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
194
197
    struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */
244
247
    ulg opt_len;        /* bit length of current block with optimal trees */
245
248
    ulg static_len;     /* bit length of current block with static trees */
246
249
    uInt matches;       /* number of string matches in current block */
247
 
    int last_eob_len;   /* bit length of EOB code for last block */
 
250
    uInt insert;        /* bytes at end of window left to insert */
248
251
 
249
252
#ifdef DEBUG
250
253
    ulg compressed_len; /* total bit length of compressed file mod 2^32 */
260
263
     * are always zero.
261
264
     */
262
265
 
 
266
    ulg high_water;
 
267
    /* High water mark offset in window for initialized bytes -- bytes above
 
268
     * this are set to zero in order to avoid memory check warnings when
 
269
     * longest match routines access bytes past the input.  This is then
 
270
     * updated to the new high water mark.
 
271
     */
 
272
 
263
273
} FAR deflate_state;
264
274
 
265
275
/* Output a byte on the stream.
278
288
 * distances are limited to MAX_DIST instead of WSIZE.
279
289
 */
280
290
 
 
291
#define WIN_INIT MAX_MATCH
 
292
/* Number of bytes after end of data in window to initialize in order to avoid
 
293
   memory checker errors from longest match routines */
 
294
 
281
295
        /* in trees.c */
282
 
void _tr_init         OF((deflate_state *s));
283
 
int  _tr_tally        OF((deflate_state *s, unsigned dist, unsigned lc));
284
 
void _tr_flush_block  OF((deflate_state *s, charf *buf, ulg stored_len,
285
 
                          int eof));
286
 
void _tr_align        OF((deflate_state *s));
287
 
void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
288
 
                          int eof));
 
296
void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
 
297
int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
 
298
void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
 
299
                        ulg stored_len, int last));
 
300
void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s));
 
301
void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
 
302
void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
 
303
                        ulg stored_len, int last));
289
304
 
290
305
#define d_code(dist) \
291
306
   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
298
313
/* Inline versions of _tr_tally for speed: */
299
314
 
300
315
#if defined(GEN_TREES_H) || !defined(STDC)
301
 
  extern uch _length_code[];
302
 
  extern uch _dist_code[];
 
316
  extern uch ZLIB_INTERNAL _length_code[];
 
317
  extern uch ZLIB_INTERNAL _dist_code[];
303
318
#else
304
 
  extern const uch _length_code[];
305
 
  extern const uch _dist_code[];
 
319
  extern const uch ZLIB_INTERNAL _length_code[];
 
320
  extern const uch ZLIB_INTERNAL _dist_code[];
306
321
#endif
307
322
 
308
323
# define _tr_tally_lit(s, c, flush) \