Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
deflate.h File Reference
#include "zutil.h"

Go to the source code of this file.

Classes

struct  ct_data_s
 
struct  tree_desc_s
 
struct  internal_state
 

Macros

#define GZIP
 
#define LENGTH_CODES   29
 
#define LITERALS   256
 
#define L_CODES   (LITERALS+1+LENGTH_CODES)
 
#define D_CODES   30
 
#define BL_CODES   19
 
#define HEAP_SIZE   (2*L_CODES+1)
 
#define MAX_BITS   15
 
#define Buf_size   16
 
#define INIT_STATE   42 /* zlib header -> BUSY_STATE */
 
#define GZIP_STATE   57 /* gzip header -> BUSY_STATE | EXTRA_STATE */
 
#define EXTRA_STATE   69 /* gzip extra block -> NAME_STATE */
 
#define NAME_STATE   73 /* gzip file name -> COMMENT_STATE */
 
#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 */
 
#define Freq   fc.freq
 
#define Code   fc.code
 
#define Dad   dl.dad
 
#define Len   dl.len
 
#define max_insert_length   max_lazy_match
 
#define put_byte(s, c)
 
#define MIN_LOOKAHEAD   (MAX_MATCH+MIN_MATCH+1)
 
#define MAX_DIST(s)
 
#define WIN_INIT   MAX_MATCH
 
#define d_code(dist)
 
#define _tr_tally_lit(s, c, flush)
 
#define _tr_tally_dist(s, distance, length, flush)
 

Typedefs

typedef struct ct_data_s ct_data
 
typedef struct static_tree_desc_s static_tree_desc
 
typedef struct tree_desc_s tree_desc
 
typedef ush Pos
 
typedef Pos FAR Posf
 
typedef unsigned IPos
 
typedef struct internal_state deflate_state
 

Functions

void ZLIB_INTERNAL _tr_init OF ((deflate_state *s))
 
int ZLIB_INTERNAL _tr_tally OF ((deflate_state *s, unsigned dist, unsigned lc))
 
void ZLIB_INTERNAL _tr_flush_block OF ((deflate_state *s, charf *buf, ulg stored_len, int last))
 

Variables

uch ZLIB_INTERNAL _length_code []
 
uch ZLIB_INTERNAL _dist_code []
 

Macro Definition Documentation

◆ _tr_tally_dist

#define _tr_tally_dist ( s,
distance,
length,
flush )
Value:
{ uch len = (uch)(length); \
ush dist = (ush)(distance); \
s->sym_buf[s->sym_next++] = (uch)dist; \
s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
s->sym_buf[s->sym_next++] = len; \
dist--; \
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
s->dyn_dtree[d_code(dist)].Freq++; \
flush = (s->sym_next == s->sym_end); \
}
#define LITERALS
Definition deflate.h:33
#define d_code(dist)
Definition deflate.h:303
uch ZLIB_INTERNAL _length_code[]
Definition trees.h:102
unsigned short ush
Definition zutil.h:41
unsigned char uch
Definition zutil.h:39

Definition at line 329 of file deflate.h.

329# define _tr_tally_dist(s, distance, length, flush) \
330 { uch len = (uch)(length); \
331 ush dist = (ush)(distance); \
332 s->sym_buf[s->sym_next++] = (uch)dist; \
333 s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
334 s->sym_buf[s->sym_next++] = len; \
335 dist--; \
336 s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
337 s->dyn_dtree[d_code(dist)].Freq++; \
338 flush = (s->sym_next == s->sym_end); \
339 }

Referenced by deflate_fast(), deflate_rle(), and deflate_slow().

◆ _tr_tally_lit

#define _tr_tally_lit ( s,
c,
flush )
Value:
{ uch cc = (c); \
s->sym_buf[s->sym_next++] = 0; \
s->sym_buf[s->sym_next++] = 0; \
s->sym_buf[s->sym_next++] = cc; \
s->dyn_ltree[cc].Freq++; \
flush = (s->sym_next == s->sym_end); \
}

Definition at line 321 of file deflate.h.

321# define _tr_tally_lit(s, c, flush) \
322 { uch cc = (c); \
323 s->sym_buf[s->sym_next++] = 0; \
324 s->sym_buf[s->sym_next++] = 0; \
325 s->sym_buf[s->sym_next++] = cc; \
326 s->dyn_ltree[cc].Freq++; \
327 flush = (s->sym_next == s->sym_end); \
328 }

Referenced by deflate_fast(), deflate_huff(), deflate_rle(), and deflate_slow().

◆ BL_CODES

#define BL_CODES   19

Definition at line 42 of file deflate.h.

Referenced by build_bl_tree(), init_block(), and send_all_trees().

◆ Buf_size

#define Buf_size   16

Definition at line 51 of file deflate.h.

Referenced by deflatePrime().

◆ BUSY_STATE

#define BUSY_STATE   113 /* deflate -> FINISH_STATE */

Definition at line 62 of file deflate.h.

Referenced by deflate(), deflateEnd(), and deflateStateCheck().

◆ Code

#define Code   fc.code

Definition at line 80 of file deflate.h.

Referenced by gen_codes().

◆ COMMENT_STATE

#define COMMENT_STATE   91 /* gzip comment -> HCRC_STATE */

Definition at line 60 of file deflate.h.

Referenced by deflate(), and deflateStateCheck().

◆ d_code

#define d_code ( dist)
Value:
((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
uch ZLIB_INTERNAL _dist_code[]
Definition trees.h:73

Definition at line 303 of file deflate.h.

303#define d_code(dist) \
304 ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])

Referenced by _tr_tally(), and compress_block().

◆ D_CODES

#define D_CODES   30

Definition at line 39 of file deflate.h.

Referenced by _tr_tally(), compress_block(), init_block(), send_all_trees(), and tr_static_init().

◆ Dad

#define Dad   dl.dad

Definition at line 81 of file deflate.h.

◆ EXTRA_STATE

#define EXTRA_STATE   69 /* gzip extra block -> NAME_STATE */

Definition at line 58 of file deflate.h.

Referenced by deflate(), and deflateStateCheck().

◆ FINISH_STATE

#define FINISH_STATE   666 /* stream complete */

Definition at line 63 of file deflate.h.

Referenced by deflate(), deflateInit2_(), and deflateStateCheck().

◆ Freq

#define Freq   fc.freq

Definition at line 79 of file deflate.h.

Referenced by build_tree(), and gen_bitlen().

◆ GZIP

#define GZIP

Definition at line 23 of file deflate.h.

Referenced by deflateStateCheck(), gz_fetch(), and gz_look().

◆ GZIP_STATE

#define GZIP_STATE   57 /* gzip header -> BUSY_STATE | EXTRA_STATE */

Definition at line 56 of file deflate.h.

Referenced by deflate(), deflateResetKeep(), and deflateStateCheck().

◆ HCRC_STATE

#define HCRC_STATE   103 /* gzip header CRC -> BUSY_STATE */

Definition at line 61 of file deflate.h.

Referenced by deflate(), and deflateStateCheck().

◆ HEAP_SIZE

#define HEAP_SIZE   (2*L_CODES+1)

Definition at line 45 of file deflate.h.

Referenced by build_tree(), and gen_bitlen().

◆ INIT_STATE

#define INIT_STATE   42 /* zlib header -> BUSY_STATE */

◆ L_CODES

#define L_CODES   (LITERALS+1+LENGTH_CODES)

Definition at line 36 of file deflate.h.

Referenced by init_block(), send_all_trees(), and tr_static_init().

◆ Len

#define Len   dl.len

Definition at line 82 of file deflate.h.

Referenced by gen_bitlen().

◆ LENGTH_CODES

#define LENGTH_CODES   29

Definition at line 30 of file deflate.h.

Referenced by tr_static_init().

◆ LITERALS

#define LITERALS   256

Definition at line 33 of file deflate.h.

Referenced by _tr_tally(), compress_block(), and detect_data_type().

◆ MAX_BITS

#define MAX_BITS   15

Definition at line 48 of file deflate.h.

Referenced by gen_bitlen(), gen_codes(), and tr_static_init().

◆ MAX_DIST

#define MAX_DIST ( s)
Value:
((s)->w_size-MIN_LOOKAHEAD)
#define MIN_LOOKAHEAD
Definition deflate.h:279

Definition at line 284 of file deflate.h.

Referenced by _tr_tally(), deflate_fast(), deflate_slow(), fill_window(), and longest_match().

◆ max_insert_length

#define max_insert_length   max_lazy_match

Definition at line 182 of file deflate.h.

◆ MIN_LOOKAHEAD

#define MIN_LOOKAHEAD   (MAX_MATCH+MIN_MATCH+1)

Definition at line 279 of file deflate.h.

Referenced by deflate_fast(), deflate_slow(), fill_window(), and longest_match().

◆ NAME_STATE

#define NAME_STATE   73 /* gzip file name -> COMMENT_STATE */

Definition at line 59 of file deflate.h.

Referenced by deflate(), and deflateStateCheck().

◆ put_byte

#define put_byte ( s,
c )
Value:
{s->pending_buf[s->pending++] = (Bytef)(c);}

Definition at line 276 of file deflate.h.

Referenced by bi_flush(), bi_windup(), deflate(), and putShortMSB().

◆ WIN_INIT

#define WIN_INIT   MAX_MATCH

Definition at line 289 of file deflate.h.

Referenced by fill_window().

Typedef Documentation

◆ ct_data

typedef struct ct_data_s ct_data

◆ deflate_state

typedef struct internal_state deflate_state

◆ IPos

typedef unsigned IPos

Definition at line 94 of file deflate.h.

◆ Pos

typedef ush Pos

Definition at line 92 of file deflate.h.

◆ Posf

typedef Pos FAR Posf

Definition at line 93 of file deflate.h.

◆ static_tree_desc

Definition at line 84 of file deflate.h.

◆ tree_desc

typedef struct tree_desc_s tree_desc

Function Documentation

◆ OF() [1/3]

◆ OF() [2/3]

void ZLIB_INTERNAL _tr_flush_block OF ( (deflate_state *s, charf *buf, ulg stored_len, int last) )

◆ OF() [3/3]

int ZLIB_INTERNAL _tr_tally OF ( (deflate_state *s, unsigned dist, unsigned lc) )

Variable Documentation

◆ _dist_code

uch ZLIB_INTERNAL _dist_code[]
extern

Definition at line 73 of file trees.h.

73 {
74 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
75 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
7610, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
7711, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
7812, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
7913, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
8013, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
8114, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
8214, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
8314, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
8415, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
8515, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
8615, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
8718, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
8823, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
8924, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
9026, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
9126, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
9227, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
9327, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
9428, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
9528, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
9628, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
9729, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
9829, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
9929, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
100};

Referenced by tr_static_init().

◆ _length_code

uch ZLIB_INTERNAL _length_code[]
extern

Definition at line 102 of file trees.h.

102 {
103 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
10413, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
10517, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
10619, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
10721, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
10822, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
10923, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
11024, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
11125, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
11225, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
11326, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
11426, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
11527, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
116};

Referenced by _tr_tally(), compress_block(), and tr_static_init().