BurgerLib
Classes | Defines | Typedefs | Enumerations | Functions | Variables
pkinflate.cpp File Reference
#include "pkpack.h"
#include "mmmemory.h"
#include "clstdlib.h"
Include dependency graph for pkinflate.cpp:

Classes

struct  InflateHuft_t
struct  InflateCodesState_t
struct  InflateBlocksState_t
struct  InflateState_t

Defines

#define MAX_WBITS   15
#define PRESET_DICT   0x20 /* preset dictionary flag in zlib header */
#define Z_DEFLATED   8
#define Z_NO_FLUSH   0
#define Z_PARTIAL_FLUSH   1 /* will be removed, use Z_SYNC_FLUSH instead */
#define Z_SYNC_FLUSH   2
#define Z_FULL_FLUSH   3
#define Z_FINISH   4
#define Z_OK   0
#define Z_STREAM_END   1
#define Z_NEED_DICT   2
#define Z_ERRNO   (-1)
#define Z_STREAM_ERROR   (-2)
#define Z_DATA_ERROR   (-3)
#define Z_MEM_ERROR   (-4)
#define Z_BUF_ERROR   (-5)
#define Z_VERSION_ERROR   (-6)
#define MANY   1440
#define FIXED_BL   9
#define FIXED_BD   5
#define BMAX   15 /* maximum bit length of any code */

Typedefs

typedef Word32(* check_func )(const Word8 *buf, Word32 len, Word32 check)
typedef struct InflateHuft_t InflateHuft_t
typedef struct InflateCodesState_t InflateCodesState_t
typedef struct InflateBlocksState_t InflateBlocksState_t
typedef struct InflateState_t InflateState_t

Enumerations

enum  InflateBlockMode_e {
  TYPE, LENS, STORED, TABLE,
  BTREE, DTREE, CODES, DRY,
  DONE, BAD
}
enum  InflateCodesMode_e {
  START, LEN, LENEXT, DIST,
  DISTEXT, COPY, LIT, WASH,
  END, BADCODE
}
enum  InflateMode_e {
  METHOD, FLAG, DICT4, DICT3,
  DICT2, DICT1, DICT0, BLOCKS,
  CHECK4, CHECK3, CHECK2, CHECK1,
  XDONE, XBAD
}

Functions

static int inflate_flush (PackState_t *z, int r)
static int inflate_fast (Word bl, Word bd, InflateHuft_t *tl, InflateHuft_t *td, InflateBlocksState_t *s, PackState_t *z)
static InflateCodesState_tinflate_codes_new (Word bl, Word bd, InflateHuft_t *tl, InflateHuft_t *td, PackState_t *)
static int inflate_codes (InflateBlocksState_t *s, PackState_t *z, int r)
static int huft_build (Word *b, Word n, Word s, const Word *d, const Word *e, InflateHuft_t **t, Word *m, InflateHuft_t *hp, Word *hn, Word *v)
static int inflate_trees_bits (Word *c, Word *bb, InflateHuft_t **tb, InflateHuft_t *hp, PackState_t *)
static int inflate_trees_dynamic (Word nl, Word nd, Word *c, Word *bl, Word *bd, InflateHuft_t **tl, InflateHuft_t **td, InflateHuft_t *hp, PackState_t *)
static void inflate_blocks_reset (PackState_t *z, Word32 *c)
static int inflate_blocks (PackState_t *z, int r)
static int inflateReset (PackState_t *Input)
void BURGER_API DInflateDestroy (PackState_t *Input)
Word BURGER_API DInflateInit (PackState_t *Input)
Word BURGER_API DInflateMore (PackState_t *z)
void BURGER_API DInflateFast (Word8 *dest, Word8 *source, WordPtr sourceLen)
void BURGER_API DInflate (Word8 *Dest, Word8 *Src, WordPtr Length, WordPtr PackedLen)

Variables

static Word inflate_mask [17]
static const Word cplens [31]
static const Word cplext [31]
static const Word cpdist [30]
static const Word cpdext [30]
static InflateHuft_t fixed_tl []
static InflateHuft_t fixed_td []
static const Word border []
static PackState_t LastStream

Define Documentation

#define BMAX   15 /* maximum bit length of any code */
#define FIXED_BD   5
#define FIXED_BL   9
#define MANY   1440
#define MAX_WBITS   15
#define PRESET_DICT   0x20 /* preset dictionary flag in zlib header */
#define Z_BUF_ERROR   (-5)
#define Z_DATA_ERROR   (-3)
#define Z_DEFLATED   8
#define Z_ERRNO   (-1)
#define Z_FINISH   4
#define Z_FULL_FLUSH   3
#define Z_MEM_ERROR   (-4)
#define Z_NEED_DICT   2
#define Z_NO_FLUSH   0
#define Z_OK   0
#define Z_PARTIAL_FLUSH   1 /* will be removed, use Z_SYNC_FLUSH instead */
#define Z_STREAM_END   1
#define Z_STREAM_ERROR   (-2)
#define Z_SYNC_FLUSH   2
#define Z_VERSION_ERROR   (-6)

Typedef Documentation

typedef Word32(* check_func)(const Word8 *buf, Word32 len, Word32 check)
typedef struct InflateHuft_t InflateHuft_t

Enumeration Type Documentation

Enumerator:
TYPE 
LENS 
STORED 
TABLE 
BTREE 
DTREE 
CODES 
DRY 
DONE 
BAD 
Enumerator:
START 
LEN 
LENEXT 
DIST 
DISTEXT 
COPY 
LIT 
WASH 
END 
BADCODE 
Enumerator:
METHOD 
FLAG 
DICT4 
DICT3 
DICT2 
DICT1 
DICT0 
BLOCKS 
CHECK4 
CHECK3 
CHECK2 
CHECK1 
XDONE 
XBAD 

Function Documentation

void BURGER_API DInflate ( Word8 Dest,
Word8 Src,
WordPtr  Length,
WordPtr  PackedLen 
)
void BURGER_API DInflateFast ( Word8 dest,
Word8 source,
WordPtr  sourceLen 
)
static int huft_build ( Word b,
Word  n,
Word  s,
const Word d,
const Word e,
InflateHuft_t **  t,
Word m,
InflateHuft_t hp,
Word hn,
Word v 
) [static]
static int inflate_blocks ( PackState_t z,
int  r 
) [static]
static void inflate_blocks_reset ( PackState_t z,
Word32 c 
) [static]
static int inflate_codes ( InflateBlocksState_t s,
PackState_t z,
int  r 
) [static]
static InflateCodesState_t* inflate_codes_new ( Word  bl,
Word  bd,
InflateHuft_t tl,
InflateHuft_t td,
PackState_t  
) [static]
static int inflate_fast ( Word  bl,
Word  bd,
InflateHuft_t tl,
InflateHuft_t td,
InflateBlocksState_t s,
PackState_t z 
) [static]
static int inflate_flush ( PackState_t z,
int  r 
) [static]
static int inflate_trees_bits ( Word c,
Word bb,
InflateHuft_t **  tb,
InflateHuft_t hp,
PackState_t  
) [static]
static int inflate_trees_dynamic ( Word  nl,
Word  nd,
Word c,
Word bl,
Word bd,
InflateHuft_t **  tl,
InflateHuft_t **  td,
InflateHuft_t hp,
PackState_t  
) [static]
static int inflateReset ( PackState_t Input) [static]

Variable Documentation

const Word border[] [static]
Initial value:
 { 
    16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}
const Word cpdext[30] [static]
Initial value:
 { 
    0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
    7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
    12, 12, 13, 13}
const Word cpdist[30] [static]
Initial value:
 { 
    1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
    257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
    8193, 12289, 16385, 24577}
const Word cplens[31] [static]
Initial value:
 { 
    3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
    35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}
const Word cplext[31] [static]
Initial value:
 { 
    0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
    3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}
InflateHuft_t fixed_td[] [static]
Initial value:
 {
    {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
    {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
    {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
    {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},
    {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},
    {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},
    {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},
    {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
}
InflateHuft_t fixed_tl[] [static]
Word inflate_mask[17] [static]
Initial value:
 {
    0x0000,
    0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
    0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
}