cryptlib  3.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
Classes | Macros | Typedefs | Enumerations | Functions | Variables
deflate.c File Reference
#include "crypt.h"
#include "zlib/deflate.h"

Go to the source code of this file.

Classes

struct  config_s
 
struct  static_tree_desc_s
 

Macros

#define NIL   0
 
#define TOO_FAR   4096
 
#define EQUAL   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 check_match(s, start, match, length)
 
#define FLUSH_BLOCK_ONLY(s, last)
 
#define FLUSH_BLOCK(s, last)
 

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

local void fill_window OF ((deflate_state *s))
 
local block_state deflate_stored OF ((deflate_state *s, int flush))
 
local void putShortMSB OF ((deflate_state *s, uInt b))
 
local void flush_pending OF ((z_streamp strm))
 
local int read_buf OF ((z_streamp strm, Bytef *buf, unsigned size))
 
local uInt longest_match OF ((deflate_state *s, IPos cur_match))
 
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 Bytef *dictionary, uInt dictLength)
 
int ZEXPORT deflateReset (z_streamp strm)
 
int ZEXPORT deflateSetHeader (z_streamp strm, gz_headerp head)
 
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)
 
local void putShortMSB (deflate_state *s, uInt b)
 
local 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)
 
local int read_buf (z_streamp strm, Bytef *buf, unsigned size)
 
local void lm_init (deflate_state *s)
 
local uInt longest_match (deflate_state *s, IPos cur_match)
 
local void fill_window (deflate_state *s)
 
local block_state deflate_stored (deflate_state *s, int flush)
 
local block_state deflate_fast (deflate_state *s, int flush)
 
local block_state deflate_slow (deflate_state *s, int flush)
 
local block_state deflate_rle (deflate_state *s, int flush)
 
local block_state deflate_huff (deflate_state *s, int flush)
 

Variables

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

Macro Definition Documentation

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

Definition at line 1284 of file deflate.c.

#define CLEAR_HASH (   s)
Value:
s->head[s->hash_size-1] = NIL; \
zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));

Definition at line 220 of file deflate.c.

#define EQUAL   0

Definition at line 178 of file deflate.c.

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

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

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

#define NIL   0

Definition at line 131 of file deflate.c.

#define TOO_FAR   4096

Definition at line 135 of file deflate.c.

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

Definition at line 191 of file deflate.c.

Typedef Documentation

typedef struct config_s config
ZEXTERN const uLongf *ZEXPORT get_crc_table OF ( (deflate_state *s, int flush)  )

Definition at line 100 of file deflate.c.

Enumeration Type Documentation

Enumerator:
need_more 
block_done 
finish_started 
finish_done 

Definition at line 93 of file deflate.c.

Function Documentation

int ZEXPORT deflate ( z_streamp  strm,
int  flush 
)

Definition at line 584 of file deflate.c.

local block_state deflate_fast ( deflate_state s,
int  flush 
)

Definition at line 1509 of file deflate.c.

local block_state deflate_huff ( deflate_state s,
int  flush 
)

Definition at line 1790 of file deflate.c.

local block_state deflate_rle ( deflate_state s,
int  flush 
)

Definition at line 1726 of file deflate.c.

local block_state deflate_slow ( deflate_state s,
int  flush 
)

Definition at line 1603 of file deflate.c.

local block_state deflate_stored ( deflate_state s,
int  flush 
)

Definition at line 1453 of file deflate.c.

int ZEXPORT deflateCopy ( z_streamp  dest,
z_streamp  source 
)

Definition at line 929 of file deflate.c.

int ZEXPORT deflateEnd ( z_streamp  strm)

Definition at line 895 of file deflate.c.

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

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

Definition at line 225 of file deflate.c.

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

Definition at line 421 of file deflate.c.

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

Definition at line 412 of file deflate.c.

int ZEXPORT deflateReset ( z_streamp  strm)

Definition at line 368 of file deflate.c.

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

Definition at line 328 of file deflate.c.

int ZEXPORT deflateSetHeader ( z_streamp  strm,
gz_headerp  head 
)

Definition at line 403 of file deflate.c.

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

Definition at line 457 of file deflate.c.

local void fill_window ( deflate_state s)

Definition at line 1297 of file deflate.c.

local void flush_pending ( z_streamp  strm)

Definition at line 565 of file deflate.c.

local void lm_init ( deflate_state s)

Definition at line 1016 of file deflate.c.

local uInt longest_match ( deflate_state s,
IPos  cur_match 
)

Definition at line 1056 of file deflate.c.

local void fill_window OF ( (deflate_state *s )
local void putShortMSB OF ( (deflate_state *s, uInt b)  )
local void flush_pending OF ( (z_streamp strm)  )
local int read_buf OF ( (z_streamp strm, Bytef *buf, unsigned size )
local uInt longest_match OF ( (deflate_state *s, IPos cur_match)  )
local void putShortMSB ( deflate_state s,
uInt  b 
)

Definition at line 553 of file deflate.c.

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

Definition at line 989 of file deflate.c.

Variable Documentation

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

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

Definition at line 81 of file deflate.c.