QtBase  v6.3.1
Classes | Macros | Typedefs | Enumerations | Functions | Variables
deflate.c File Reference
#include "deflate.h"
Include dependency graph for deflate.c:

Go to the source code of this file.

Classes

struct  config_s
 

Macros

#define NIL   0
 
#define TOO_FAR   4096
 
#define RANK(f)   (((f) * 2) - ((f) > 4 ? 9 : 0))
 
#define UPDATE_HASH(s, h, c)   (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
 
#define INSERT_STRING(s, str, match_head)
 
#define CLEAR_HASH(s)
 
#define HCRC_UPDATE(beg)
 
#define check_match(s, start, match, length)
 
#define FLUSH_BLOCK_ONLY(s, last)
 
#define FLUSH_BLOCK(s, last)
 
#define MAX_STORED   65535
 
#define MIN(a, b)   ((a) > (b) ? (b) : (a))
 

Typedefs

typedef block_state compress_func OF((deflate_state *s, int flush))
 
typedef struct config_s config
 

Enumerations

enum  block_state { need_more , block_done , finish_started , finish_done }
 

Functions

int deflateStateCheck OF ((z_streamp strm))
 
void slide_hash OF ((deflate_state *s))
 
void putShortMSB OF ((deflate_state *s, uInt b))
 
unsigned read_buf OF ((z_streamp strm, Bytef *buf, unsigned size))
 
uInt longest_match OF ((deflate_state *s, IPos cur_match))
 
void slide_hash (deflate_state *s)
 
int ZEXPORT deflateInit_ (z_streamp strm, int level, const char *version, int stream_size)
 
int ZEXPORT deflateInit2_ (z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)
 
int deflateStateCheck (z_streamp strm)
 
int ZEXPORT deflateSetDictionary (z_streamp strm, const Bytef *dictionary, uInt dictLength)
 
int ZEXPORT deflateGetDictionary (z_streamp strm, Bytef *dictionary, uInt *dictLength)
 
int ZEXPORT deflateResetKeep (z_streamp strm)
 
int ZEXPORT deflateReset (z_streamp strm)
 
int ZEXPORT deflateSetHeader (z_streamp strm, gz_headerp head)
 
int ZEXPORT deflatePending (z_streamp strm, unsigned *pending, int *bits)
 
int ZEXPORT deflatePrime (z_streamp strm, int bits, int value)
 
int ZEXPORT deflateParams (z_streamp strm, int level, int strategy)
 
int ZEXPORT deflateTune (z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)
 
uLong ZEXPORT deflateBound (z_streamp strm, uLong sourceLen)
 
void putShortMSB (deflate_state *s, uInt b)
 
void flush_pending (z_streamp strm)
 
int ZEXPORT deflate (z_streamp strm, int flush)
 
int ZEXPORT deflateEnd (z_streamp strm)
 
int ZEXPORT deflateCopy (z_streamp dest, z_streamp source)
 
unsigned read_buf (z_streamp strm, Bytef *buf, unsigned size)
 
void lm_init (deflate_state *s)
 
uInt longest_match (deflate_state *s, IPos cur_match)
 
void fill_window (deflate_state *s)
 
block_state deflate_stored (deflate_state *s, int flush)
 
block_state deflate_fast (deflate_state *s, int flush)
 
block_state deflate_slow (deflate_state *s, int flush)
 
block_state deflate_rle (deflate_state *s, int flush)
 
block_state deflate_huff (deflate_state *s, int flush)
 

Variables

const char deflate_copyright []
 
const config configuration_table [10]
 

Macro Definition Documentation

◆ check_match

#define check_match (   s,
  start,
  match,
  length 
)

Definition at line 1509 of file deflate.c.

◆ CLEAR_HASH

#define CLEAR_HASH (   s)
Value:
do { \
s->head[s->hash_size-1] = NIL; \
zmemzero((Bytef *)s->head, \
(unsigned)(s->hash_size-1)*sizeof(*s->head)); \
} while (0)
#define NIL
Definition: deflate.c:107
Byte FAR Bytef
Definition: ftzconf.h:228
GLdouble s
[6]
Definition: qopenglext.h:235

Definition at line 192 of file deflate.c.

◆ FLUSH_BLOCK

#define FLUSH_BLOCK (   s,
  last 
)
Value:
{ \
FLUSH_BLOCK_ONLY(s, last); \
if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
}
@ finish_started
Definition: deflate.c:69
@ need_more
Definition: deflate.c:67

Definition at line 1659 of file deflate.c.

◆ FLUSH_BLOCK_ONLY

#define FLUSH_BLOCK_ONLY (   s,
  last 
)
Value:
{ \
_tr_flush_block(s, (s->block_start >= 0L ? \
(charf *)&s->window[(unsigned)s->block_start] : \
(charf *)Z_NULL), \
(ulg)((long)s->strstart - s->block_start), \
(last)); \
s->block_start = s->strstart; \
flush_pending(s->strm); \
Tracev((stderr,"[FLUSH]")); \
}
#define Z_NULL
Definition: zlib.h:164
unsigned long ulg
Definition: zutil.h:38
char FAR charf
Definition: ftzconf.h:230

Definition at line 1647 of file deflate.c.

◆ HCRC_UPDATE

#define HCRC_UPDATE (   beg)
Value:
do { \
if (s->gzhead->hcrc && s->pending > (beg)) \
strm->adler = crc32(strm->adler, s->pending_buf + (beg), \
s->pending - (beg)); \
} while (0)
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
Definition: crc32.c:1063

Definition at line 796 of file deflate.c.

◆ INSERT_STRING

#define INSERT_STRING (   s,
  str,
  match_head 
)
Value:
(UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
s->head[s->ins_h] = (Pos)(str))
#define UPDATE_HASH(s, h, c)
Definition: deflate.c:163
ush Pos
Definition: deflate.h:92
QString str
[2]
#define MIN_MATCH
Definition: zutil.h:64

Definition at line 182 of file deflate.c.

◆ MAX_STORED

#define MAX_STORED   65535

Definition at line 1665 of file deflate.c.

◆ MIN

#define MIN (   a,
  b 
)    ((a) > (b) ? (b) : (a))

Definition at line 1668 of file deflate.c.

◆ NIL

#define NIL   0

Definition at line 107 of file deflate.c.

◆ RANK

#define RANK (   f)    (((f) * 2) - ((f) > 4 ? 9 : 0))

Definition at line 155 of file deflate.c.

◆ TOO_FAR

#define TOO_FAR   4096

Definition at line 111 of file deflate.c.

◆ UPDATE_HASH

#define UPDATE_HASH (   s,
  h,
  c 
)    (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)

Definition at line 163 of file deflate.c.

Typedef Documentation

◆ config

typedef struct config_s config

◆ OF

typedef block_state compress_func OF((deflate_state *s, int flush))

Definition at line 73 of file deflate.c.

Enumeration Type Documentation

◆ block_state

Enumerator
need_more 
block_done 
finish_started 
finish_done 

Definition at line 66 of file deflate.c.

Function Documentation

◆ deflate()

int ZEXPORT deflate ( z_streamp  strm,
int  flush 
)

Definition at line 804 of file deflate.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deflate_fast()

block_state deflate_fast ( deflate_state s,
int  flush 
)

Definition at line 1872 of file deflate.c.

Here is the call graph for this function:

◆ deflate_huff()

block_state deflate_huff ( deflate_state s,
int  flush 
)

Definition at line 2178 of file deflate.c.

Here is the call graph for this function:

◆ deflate_rle()

block_state deflate_rle ( deflate_state s,
int  flush 
)

Definition at line 2105 of file deflate.c.

Here is the call graph for this function:

◆ deflate_slow()

block_state deflate_slow ( deflate_state s,
int  flush 
)

Definition at line 1974 of file deflate.c.

Here is the call graph for this function:

◆ deflate_stored()

block_state deflate_stored ( deflate_state s,
int  flush 
)

Definition at line 1685 of file deflate.c.

Here is the call graph for this function:

◆ deflateBound()

uLong ZEXPORT deflateBound ( z_streamp  strm,
uLong  sourceLen 
)

Definition at line 693 of file deflate.c.

Here is the call graph for this function:

◆ deflateCopy()

int ZEXPORT deflateCopy ( z_streamp  dest,
z_streamp  source 
)

Definition at line 1145 of file deflate.c.

Here is the call graph for this function:

◆ deflateEnd()

int ZEXPORT deflateEnd ( z_streamp  strm)

Definition at line 1119 of file deflate.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deflateGetDictionary()

int ZEXPORT deflateGetDictionary ( z_streamp  strm,
Bytef dictionary,
uInt dictLength 
)

Definition at line 485 of file deflate.c.

Here is the call graph for this function:

◆ deflateInit2_()

int ZEXPORT deflateInit2_ ( z_streamp  strm,
int  level,
int  method,
int  windowBits,
int  memLevel,
int  strategy,
const char *  version,
int  stream_size 
)

Definition at line 243 of file deflate.c.

Here is the caller graph for this function:

◆ deflateInit_()

int ZEXPORT deflateInit_ ( z_streamp  strm,
int  level,
const char *  version,
int  stream_size 
)

Definition at line 231 of file deflate.c.

Here is the call graph for this function:

◆ deflateParams()

int ZEXPORT deflateParams ( z_streamp  strm,
int  level,
int  strategy 
)

Definition at line 609 of file deflate.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deflatePending()

int ZEXPORT deflatePending ( z_streamp  strm,
unsigned *  pending,
int *  bits 
)

Definition at line 568 of file deflate.c.

Here is the call graph for this function:

◆ deflatePrime()

int ZEXPORT deflatePrime ( z_streamp  strm,
int  bits,
int  value 
)

Definition at line 582 of file deflate.c.

Here is the call graph for this function:

◆ deflateReset()

int ZEXPORT deflateReset ( z_streamp  strm)

Definition at line 545 of file deflate.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deflateResetKeep()

int ZEXPORT deflateResetKeep ( z_streamp  strm)

Definition at line 507 of file deflate.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deflateSetDictionary()

int ZEXPORT deflateSetDictionary ( z_streamp  strm,
const Bytef dictionary,
uInt  dictLength 
)

Definition at line 416 of file deflate.c.

◆ deflateSetHeader()

int ZEXPORT deflateSetHeader ( z_streamp  strm,
gz_headerp  head 
)

Definition at line 557 of file deflate.c.

Here is the call graph for this function:

◆ deflateStateCheck()

int deflateStateCheck ( z_streamp  strm)

Definition at line 393 of file deflate.c.

Here is the caller graph for this function:

◆ deflateTune()

int ZEXPORT deflateTune ( z_streamp  strm,
int  good_length,
int  max_lazy,
int  nice_length,
int  max_chain 
)

Definition at line 658 of file deflate.c.

Here is the call graph for this function:

◆ fill_window()

void fill_window ( deflate_state s)

Definition at line 1522 of file deflate.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flush_pending()

void flush_pending ( z_streamp  strm)

Definition at line 771 of file deflate.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lm_init()

void lm_init ( deflate_state s)

Definition at line 1234 of file deflate.c.

Here is the caller graph for this function:

◆ longest_match()

uInt longest_match ( deflate_state s,
IPos  cur_match 
)

Definition at line 1276 of file deflate.c.

Here is the caller graph for this function:

◆ OF() [1/5]

◆ OF() [2/5]

uInt longest_match OF ( (deflate_state *s, IPos cur_match)  )

◆ OF() [3/5]

◆ OF() [4/5]

int deflateStateCheck OF ( (z_streamp strm)  )

◆ OF() [5/5]

unsigned read_buf OF ( (z_streamp strm, Bytef *buf, unsigned size )

◆ putShortMSB()

void putShortMSB ( deflate_state s,
uInt  b 
)

Definition at line 757 of file deflate.c.

Here is the caller graph for this function:

◆ read_buf()

unsigned read_buf ( z_streamp  strm,
Bytef buf,
unsigned  size 
)

Definition at line 1204 of file deflate.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ slide_hash()

void slide_hash ( deflate_state s)

Definition at line 204 of file deflate.c.

Here is the caller graph for this function:

Variable Documentation

◆ configuration_table

const config configuration_table[10]
Initial value:
= {
{0, 0, 0, 0, deflate_stored},
{4, 4, 8, 4, deflate_fast},
{4, 5, 16, 8, deflate_fast},
{4, 6, 32, 32, deflate_fast},
{4, 4, 16, 16, deflate_slow},
{8, 16, 32, 32, deflate_slow},
{8, 16, 128, 128, deflate_slow},
{8, 32, 128, 256, deflate_slow},
{32, 128, 258, 1024, deflate_slow},
{32, 258, 258, 4096, deflate_slow}}
block_state deflate_stored(deflate_state *s, int flush)
Definition: deflate.c:1685
block_state deflate_fast(deflate_state *s, int flush)
Definition: deflate.c:1872
block_state deflate_slow(deflate_state *s, int flush)
Definition: deflate.c:1974

Definition at line 134 of file deflate.c.

◆ deflate_copyright

const char deflate_copyright[]
Initial value:
=
" deflate 1.2.12 Copyright 1995-2022 Jean-loup Gailly and Mark Adler "

Definition at line 54 of file deflate.c.