LMMS
Loading...
Searching...
No Matches
deflate.c File Reference
#include "deflate.h"

Classes

struct  config_s

Macros

#define NIL   0
#define TOO_FAR   4096
#define MIN_LOOKAHEAD   (MAX_MATCH+MIN_MATCH+1)
#define EQUAL   0
#define UPDATE_HASH(s, h, c)
#define INSERT_STRING(s, str, match_head)
#define CLEAR_HASH(s)
#define check_match(s, start, match, length)
#define FLUSH_BLOCK_ONLY(s, eof)
#define FLUSH_BLOCK(s, eof)

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 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)
uLong ZEXPORT deflateBound (z_streamp strm, uLong sourceLen)
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 uInt longest_match_fast (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)

Variables

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

Macro Definition Documentation

◆ check_match

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

◆ CLEAR_HASH

#define CLEAR_HASH ( s)
Value:
s->head[s->hash_size-1] = NIL; \
zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head));
unsigned s
Definition inflate.c:1555
#define NIL
Definition deflate.c:105
#define Bytef
Definition zconf.h:66

◆ EQUAL

#define EQUAL   0

◆ FLUSH_BLOCK

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

◆ FLUSH_BLOCK_ONLY

#define FLUSH_BLOCK_ONLY ( s,
eof )
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), \
(eof)); \
s->block_start = s->strstart; \
flush_pending(s->strm); \
Tracev((stderr,"[FLUSH]")); \
}
unsigned long ulg
Definition unzip.h:403
#define charf
Definition zconf.h:67
#define Z_NULL
Definition zlib.h:206

◆ 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:170
ush Pos
Definition deflate.h:88
#define MIN_MATCH
Definition zutil.h:81

◆ MIN_LOOKAHEAD

#define MIN_LOOKAHEAD   (MAX_MATCH+MIN_MATCH+1)

◆ NIL

#define NIL   0

◆ TOO_FAR

#define TOO_FAR   4096

◆ UPDATE_HASH

#define UPDATE_HASH ( s,
h,
c )
Value:
(h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
return c
Definition crypt.c:175
uch h[RAND_HEAD_LEN]
Definition crypt.c:459

Typedef Documentation

◆ config

typedef struct config_s config

◆ OF

ZEXTERN void ZEXPORT gzclearerr OF

Enumeration Type Documentation

◆ block_state

Enumerator
need_more 
block_done 
finish_started 
finish_done 

Function Documentation

◆ deflate()

int ZEXPORT deflate ( z_streamp strm,
int flush )

◆ deflate_fast()

local block_state deflate_fast ( deflate_state * s,
int flush )

◆ deflate_slow()

local block_state deflate_slow ( deflate_state * s,
int flush )

◆ deflate_stored()

local block_state deflate_stored ( deflate_state * s,
int flush )

◆ deflateBound()

uLong ZEXPORT deflateBound ( z_streamp strm,
uLong 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 )

◆ deflateParams()

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

◆ deflatePrime()

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

◆ deflateReset()

int ZEXPORT deflateReset ( z_streamp strm)

◆ deflateSetDictionary()

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

◆ deflateSetHeader()

int ZEXPORT deflateSetHeader ( z_streamp strm,
gz_headerp head )

◆ deflateTune()

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

◆ fill_window()

local void fill_window ( deflate_state * s)

◆ flush_pending()

local void flush_pending ( z_streamp strm)

◆ lm_init()

local void lm_init ( deflate_state * s)

◆ longest_match()

local uInt longest_match ( deflate_state * s,
IPos cur_match )

◆ longest_match_fast()

local uInt longest_match_fast ( deflate_state * s,
IPos cur_match )

◆ OF() [1/5]

◆ OF() [2/5]

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

◆ OF() [3/5]

◆ OF() [4/5]

◆ OF() [5/5]

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

◆ putShortMSB()

local void putShortMSB ( deflate_state * s,
uInt b )

◆ read_buf()

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

Variable Documentation

◆ configuration_table

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}}
local block_state deflate_fast(deflate_state *s, int flush)
Definition deflate.c:1395
local block_state deflate_stored(deflate_state *s, int flush)
Definition deflate.c:1339
local block_state deflate_slow(deflate_state *s, int flush)
Definition deflate.c:1499

◆ deflate_copyright

const char deflate_copyright[]
Initial value:
=
" deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly "