TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Classes | Macros | Typedefs | Enumerations | Functions | Variables
deflate.c File Reference
#include "deflate.h"

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) (deflate_state *s, int flush)
 
typedef struct config_s config
 

Enumerations

enum  block_state { need_more, block_done, finish_started, finish_done }
 

Functions

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)
 
local void slide_hash (deflate_state *s)
 
local unsigned read_buf (z_streamp strm, Bytef *buf, unsigned size)
 
local void fill_window (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)
 
local 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)
 
local void lm_init (deflate_state *s)
 
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)
 
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 uInt longest_match (deflate_state *s, IPos cur_match)
 

Variables

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

Macro Definition Documentation

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

Definition at line 1582 of file deflate.c.

Referenced by deflate_fast(), deflate_rle(), and deflate_slow().

#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)
Byte FAR Bytef
Definition: zconf.h:402
#define NIL
Definition: deflate.c:85
void ZLIB_INTERNAL zmemzero(Bytef *dest, uInt len)
Definition: zutil.c:161

Definition at line 170 of file deflate.c.

Referenced by deflate(), deflateParams(), deflateSetDictionary(), and lm_init().

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

Definition at line 1601 of file deflate.c.

Referenced by deflate_fast(), deflate_huff(), deflate_rle(), and deflate_slow().

#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]")); \
}
local void flush_pending(z_streamp strm)
Definition: deflate.c:915
#define Tracev(x)
Definition: zutil.h:233
void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf, ulg stored_len, int last)
Definition: trees.c:995
unsigned long ulg
Definition: zutil.h:43
#define Z_NULL
Definition: zlib.h:212
char FAR charf
Definition: zconf.h:404

Definition at line 1589 of file deflate.c.

Referenced by deflate_slow().

#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:1015

Definition at line 938 of file deflate.c.

Referenced by deflate().

#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 MIN_MATCH
Definition: zutil.h:84
ush Pos
Definition: deflate.h:96
#define UPDATE_HASH(s, h, c)
Definition: deflate.c:141

Definition at line 160 of file deflate.c.

Referenced by deflate_fast(), and deflate_slow().

#define MAX_STORED   65535

Definition at line 1607 of file deflate.c.

Referenced by deflate_stored().

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

Definition at line 1610 of file deflate.c.

Referenced by deflate_stored().

#define NIL   0

Definition at line 85 of file deflate.c.

Referenced by deflate_fast(), deflate_slow(), longest_match(), and slide_hash().

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

Definition at line 133 of file deflate.c.

Referenced by deflate().

#define TOO_FAR   4096

Definition at line 89 of file deflate.c.

Referenced by deflate_slow().

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

Definition at line 141 of file deflate.c.

Referenced by deflate_fast(), deflateSetDictionary(), and fill_window().

Typedef Documentation

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

Definition at line 70 of file deflate.c.

typedef struct config_s config

Enumeration Type Documentation

Enumerator
need_more 
block_done 
finish_started 
finish_done 

Definition at line 63 of file deflate.c.

Function Documentation

int ZEXPORT deflate ( z_streamp  strm,
int  flush 
)
local block_state deflate_fast ( deflate_state s,
int  flush 
)
local block_state deflate_huff ( deflate_state s,
int  flush 
)
local block_state deflate_rle ( deflate_state s,
int  flush 
)
local block_state deflate_slow ( deflate_state s,
int  flush 
)
local 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 
)

Definition at line 371 of file deflate.c.

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

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

Definition at line 713 of file deflate.c.

References deflateStateCheck(), Z_NULL, Z_OK, and Z_STREAM_ERROR.

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

Definition at line 695 of file deflate.c.

References deflateResetKeep(), lm_init(), and Z_OK.

Referenced by deflateInit2_(), and gz_comp().

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 
)

Definition at line 705 of file deflate.c.

References deflateStateCheck(), internal_state::head, Z_OK, and Z_STREAM_ERROR.

local int deflateStateCheck ( z_streamp  strm)
int ZEXPORT deflateTune ( z_streamp  strm,
int  good_length,
int  max_lazy,
int  nice_length,
int  max_chain 
)
local void fill_window ( deflate_state s)
local void flush_pending ( z_streamp  strm)
local void lm_init ( deflate_state s)
local uInt longest_match ( deflate_state s,
IPos  cur_match 
)
local void putShortMSB ( deflate_state s,
uInt  b 
)

Definition at line 904 of file deflate.c.

References put_byte.

Referenced by deflate().

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

Definition at line 218 of file deflate.c.

References adler32(), crc32(), and zmemcpy().

Referenced by deflate_stored(), and fill_window().

local void slide_hash ( deflate_state s)

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

Definition at line 112 of file deflate.c.

Referenced by deflate(), deflateParams(), and lm_init().

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

Definition at line 54 of file deflate.c.