NCBI C++ ToolKit
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.

Go to the SVN repository for this file.

Classes

struct  config_s
 

Macros

#define NIL   0
 
#define ACTUAL_MIN_MATCH   4
 
#define RANK(f)   (((f) * 2) - ((f) > 4 ? 9 : 0))
 
#define CLEAR_HASH(s)    zmemzero((uint8_t *)s->head, (unsigned)(s->hash_size)*sizeof(*s->head));
 
#define check_match(s, start, match, length)
 
#define FLUSH_BLOCK_ONLY(s, last)
 
#define FLUSH_BLOCK(s, last)
 

Typedefs

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

Enumerations

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

Functions

static int deflateStateCheck (z_streamp strm)
 
static void fill_window (deflate_state *s)
 
static block_state deflate_stored (deflate_state *s, int flush)
 
static block_state deflate_fast (deflate_state *s, int flush)
 
static block_state deflate_slow (deflate_state *s, int flush)
 
static block_state deflate_rle (deflate_state *s, int flush)
 
static block_state deflate_huff (deflate_state *s, int flush)
 
static void lm_init (deflate_state *s)
 
static void putShortMSB (deflate_state *s, uint32_t b)
 
static void flush_pending (z_streamp strm)
 
static int read_buf (z_streamp strm, uint8_t *buf, uint32_t size)
 
static Pos insert_string (deflate_state *s, Pos str)
 
static void bulk_insert_str (deflate_state *s, Pos startpos, uint32_t count)
 
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 ZEXPORT deflateSetDictionary (z_streamp strm, const uint8_t *dictionary, uint32_t 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)
 
uint64_t ZEXPORT deflateBound (z_streamp strm, uint64_t sourceLen)
 
int ZEXPORT deflate (z_streamp strm, int flush)
 
int ZEXPORT deflateEnd (z_streamp strm)
 
int ZEXPORT deflateCopy (z_streamp dest, z_streamp source)
 
static uint32_t longest_match (deflate_state *s, IPos cur_match)
 

Variables

const char deflate_copyright []
 
static const config configuration_table [10]
 

Macro Definition Documentation

◆ ACTUAL_MIN_MATCH

#define ACTUAL_MIN_MATCH   4

Definition at line 96 of file deflate.c.

◆ check_match

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

Definition at line 1261 of file deflate.c.

◆ CLEAR_HASH

#define CLEAR_HASH (   s)     zmemzero((uint8_t *)s->head, (unsigned)(s->hash_size)*sizeof(*s->head));

Definition at line 179 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; \
}
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:51
@ finish_started
Definition: deflate.c:69
@ need_more
Definition: deflate.c:67

Definition at line 1448 of file deflate.c.

◆ FLUSH_BLOCK_ONLY

#define FLUSH_BLOCK_ONLY (   s,
  last 
)
Value:
{ \
_tr_flush_block(s, (s->block_start >= 0L ? \
(uint8_t *)&s->window[(uint64_t)s->block_start] : \
(uint8_t *)Z_NULL), \
(uint64_t)((int64_t)s->strstart - s->block_start), \
(last)); \
s->block_start = s->strstart; \
flush_pending(s->strm); \
Tracev((stderr,"[FLUSH]")); \
}
Uint8 uint64_t
Int8 int64_t
unsigned char uint8_t
#define Z_NULL
Definition: zlib.h:212

Definition at line 1436 of file deflate.c.

◆ NIL

#define NIL   0

Definition at line 94 of file deflate.c.

◆ RANK

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

Definition at line 130 of file deflate.c.

Typedef Documentation

◆ compress_func

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

Definition at line 70 of file deflate.c.

◆ config

typedef struct config_s config

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 63 of file deflate.c.

Function Documentation

◆ bulk_insert_str()

static void bulk_insert_str ( deflate_state s,
Pos  startpos,
uint32_t  count 
)
static

◆ deflate()

int ZEXPORT deflate ( z_streamp  strm,
int  flush 
)

◆ deflate_fast()

static block_state deflate_fast ( deflate_state s,
int  flush 
)
static

◆ deflate_huff()

static block_state deflate_huff ( deflate_state s,
int  flush 
)
static

◆ deflate_rle()

static block_state deflate_rle ( deflate_state s,
int  flush 
)
static

◆ deflate_slow()

static block_state deflate_slow ( deflate_state s,
int  flush 
)
static

◆ deflate_stored()

static block_state deflate_stored ( deflate_state s,
int  flush 
)
static

◆ deflateBound()

uint64_t ZEXPORT deflateBound ( z_streamp  strm,
uint64_t  sourceLen 
)

◆ deflateCopy()

int ZEXPORT deflateCopy ( z_streamp  dest,
z_streamp  source 
)

◆ deflateEnd()

int ZEXPORT deflateEnd ( z_streamp  strm)

◆ deflateInit2_()

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

◆ deflateInit_()

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

Definition at line 183 of file deflate.c.

References DEF_MEM_LEVEL, deflateInit2_(), MAX_WBITS, version, Z_DEFAULT_STRATEGY, and Z_DEFLATED.

◆ deflateParams()

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

◆ deflatePending()

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

◆ deflatePrime()

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

◆ deflateReset()

int ZEXPORT deflateReset ( z_streamp  strm)

Definition at line 436 of file deflate.c.

References deflateResetKeep(), lm_init(), z_stream_s::state, internal_state::strm, and Z_OK.

◆ deflateResetKeep()

int ZEXPORT deflateResetKeep ( z_streamp  strm)

◆ deflateSetDictionary()

int ZEXPORT deflateSetDictionary ( z_streamp  strm,
const uint8_t dictionary,
uint32_t  dictLength 
)

◆ deflateSetHeader()

int ZEXPORT deflateSetHeader ( z_streamp  strm,
gz_headerp  head 
)

◆ deflateStateCheck()

static int deflateStateCheck ( z_streamp  strm)
static

◆ deflateTune()

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

◆ fill_window()

static void fill_window ( deflate_state s)
static

◆ flush_pending()

static void flush_pending ( z_streamp  strm)
static

◆ insert_string()

static Pos insert_string ( deflate_state s,
Pos  str 
)
static

◆ lm_init()

static void lm_init ( deflate_state s)
static

◆ longest_match()

static uint32_t longest_match ( deflate_state s,
IPos  cur_match 
)
static

◆ putShortMSB()

static void putShortMSB ( deflate_state s,
uint32_t  b 
)
static

Definition at line 610 of file deflate.c.

References b, and put_byte.

◆ read_buf()

static int read_buf ( z_streamp  strm,
uint8_t buf,
uint32_t  size 
)
static

Variable Documentation

◆ configuration_table

const config configuration_table[10]
static
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_fast(deflate_state *s, int flush)
Definition: deflate.c:1872
block_state deflate_stored(deflate_state *s, int flush)
Definition: deflate.c:1685
block_state deflate_slow(deflate_state *s, int flush)
Definition: deflate.c:1974

Definition at line 110 of file deflate.c.

◆ deflate_copyright

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

Definition at line 54 of file deflate.c.

Modified on Sun Jun 16 04:33:48 2024 by modify_doxy.py rev. 669887