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

Go to the source code of this file.

Classes

struct  config_s
 

Macros

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

Typedefs

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

Enumerations

enum  block_state {
  need_more, block_done, finish_started, finish_done,
  need_more, block_done, finish_started, finish_done
}
 

Functions

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

Variables

const config configuration_table [10]
 
const char deflate_copyright []
 

Macro Definition Documentation

◆ check_match

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

Definition at line 1514 of file zlib/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)

Definition at line 186 of file zlib/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; \
}

Definition at line 1664 of file zlib/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]")); \
}

Definition at line 1652 of file zlib/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)

Definition at line 807 of file zlib/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))

Definition at line 176 of file zlib/deflate.c.

◆ MAX_STORED

#define MAX_STORED   65535

Definition at line 1670 of file zlib/deflate.c.

◆ MIN

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

Definition at line 1673 of file zlib/deflate.c.

◆ NIL

#define NIL   0

Definition at line 101 of file zlib/deflate.c.

◆ RANK

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

Definition at line 149 of file zlib/deflate.c.

◆ TOO_FAR

#define TOO_FAR   4096

Definition at line 105 of file zlib/deflate.c.

◆ UPDATE_HASH

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

Definition at line 157 of file zlib/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 zlib/deflate.c.

Enumeration Type Documentation

◆ block_state

Enumerator
need_more 
block_done 
finish_started 
finish_done 
need_more 
block_done 
finish_started 
finish_done 

Definition at line 66 of file zlib/deflate.c.

Function Documentation

◆ deflate()

int ZEXPORT deflate ( z_streamp  strm,
int  flush 
)

Definition at line 815 of file zlib/deflate.c.

◆ deflate_fast()

block_state deflate_fast ( deflate_state s,
int  flush 
)

Definition at line 1877 of file zlib/deflate.c.

◆ deflate_huff()

block_state deflate_huff ( deflate_state s,
int  flush 
)

Definition at line 2184 of file zlib/deflate.c.

◆ deflate_rle()

block_state deflate_rle ( deflate_state s,
int  flush 
)

Definition at line 2110 of file zlib/deflate.c.

◆ deflate_slow()

block_state deflate_slow ( deflate_state s,
int  flush 
)

Definition at line 1979 of file zlib/deflate.c.

◆ deflate_stored()

block_state deflate_stored ( deflate_state s,
int  flush 
)

Definition at line 1690 of file zlib/deflate.c.

◆ deflateBound()

uLong ZEXPORT deflateBound ( z_streamp  strm,
uLong  sourceLen 
)

Definition at line 696 of file zlib/deflate.c.

◆ deflateCopy()

int ZEXPORT deflateCopy ( z_streamp  dest,
z_streamp  source 
)

Definition at line 1156 of file zlib/deflate.c.

◆ deflateEnd()

int ZEXPORT deflateEnd ( z_streamp  strm)

Definition at line 1130 of file zlib/deflate.c.

◆ deflateGetDictionary()

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

Definition at line 481 of file zlib/deflate.c.

◆ 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 237 of file zlib/deflate.c.

◆ deflateInit_()

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

Definition at line 225 of file zlib/deflate.c.

◆ deflateParams()

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

Definition at line 605 of file zlib/deflate.c.

◆ deflatePending()

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

Definition at line 564 of file zlib/deflate.c.

◆ deflatePrime()

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

Definition at line 578 of file zlib/deflate.c.

◆ deflateReset()

int ZEXPORT deflateReset ( z_streamp  strm)

Definition at line 541 of file zlib/deflate.c.

◆ deflateResetKeep()

int ZEXPORT deflateResetKeep ( z_streamp  strm)

Definition at line 503 of file zlib/deflate.c.

◆ deflateSetDictionary()

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

Definition at line 412 of file zlib/deflate.c.

◆ deflateSetHeader()

int ZEXPORT deflateSetHeader ( z_streamp  strm,
gz_headerp  head 
)

Definition at line 553 of file zlib/deflate.c.

◆ deflateStateCheck()

int deflateStateCheck ( z_streamp  strm)

Definition at line 389 of file zlib/deflate.c.

◆ deflateTune()

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

Definition at line 654 of file zlib/deflate.c.

◆ fill_window()

void fill_window ( deflate_state s)

Definition at line 1527 of file zlib/deflate.c.

◆ flush_pending()

void flush_pending ( z_streamp  strm)

Definition at line 782 of file zlib/deflate.c.

◆ lm_init()

void lm_init ( deflate_state s)

Definition at line 1245 of file zlib/deflate.c.

◆ longest_match()

uInt longest_match ( deflate_state s,
IPos  cur_match 
)

Definition at line 1278 of file zlib/deflate.c.

◆ OF() [1/6]

void slide_hash OF ( (deflate_state *s)  )

◆ OF() [2/6]

◆ OF() [3/6]

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

◆ OF() [4/6]

void putShortMSB OF ( (deflate_state *s, uInt b )

◆ OF() [5/6]

int deflateStateCheck OF ( (z_streamp strm)  )

◆ OF() [6/6]

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

◆ putShortMSB()

void putShortMSB ( deflate_state s,
uInt  b 
)

Definition at line 768 of file zlib/deflate.c.

◆ read_buf()

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

Definition at line 1215 of file zlib/deflate.c.

◆ slide_hash()

void slide_hash ( deflate_state s)

Definition at line 198 of file zlib/deflate.c.

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}}

Definition at line 128 of file zlib/deflate.c.

◆ deflate_copyright

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

Definition at line 54 of file zlib/deflate.c.

xds_interop_client.str
str
Definition: xds_interop_client.py:487
deflate_stored
block_state deflate_stored(deflate_state *s, int flush)
Definition: zlib/deflate.c:1690
MIN_MATCH
#define MIN_MATCH
Definition: bloaty/third_party/zlib/zutil.h:77
Bytef
Byte FAR Bytef
Definition: bloaty/third_party/zlib/zconf.h:400
Pos
ush Pos
Definition: bloaty/third_party/zlib/deflate.h:92
absl::FormatConversionChar::s
@ s
NIL
#define NIL
Definition: zlib/deflate.c:101
python_utils.port_server.stderr
stderr
Definition: port_server.py:51
charf
char FAR charf
Definition: bloaty/third_party/zlib/zconf.h:402
Z_NULL
#define Z_NULL
Definition: bloaty/third_party/zlib/zlib.h:212
finish_started
@ finish_started
Definition: zlib/deflate.c:69
UPDATE_HASH
#define UPDATE_HASH(s, h, c)
Definition: zlib/deflate.c:157
need_more
@ need_more
Definition: zlib/deflate.c:67
L
lua_State * L
Definition: upb/upb/bindings/lua/main.c:35
ulg
unsigned long ulg
Definition: bloaty/third_party/zlib/zutil.h:47
deflate_fast
block_state deflate_fast(deflate_state *s, int flush)
Definition: zlib/deflate.c:1877
crc32
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
Definition: bloaty/third_party/zlib/crc32.c:237
deflate_slow
block_state deflate_slow(deflate_state *s, int flush)
Definition: zlib/deflate.c:1979


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:10