some big size savings (removed zalloc requirement from runtime yay)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1275 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
justin1014 2002-10-02 17:19:37 +00:00
parent 87269acd79
commit 4e6828b511
4 changed files with 69 additions and 105 deletions

View file

@ -52,6 +52,52 @@ extern "C" {
#ifdef EXEHEAD
typedef struct inflate_huft_s FAR inflate_huft;
typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
START, /* x: set up for LEN */
LEN, /* i: get length/literal/eob next */
LENEXT, /* i: getting length extra (have base) */
DIST, /* i: get distance next */
DISTEXT, /* i: getting distance extra */
COPY, /* o: copying bytes in window, waiting for space */
LIT, /* o: got literal, waiting for output space */
WASH, /* o: got eob, possibly still output waiting */
END, /* x: got eob and all data flushed */
BADCODE} /* x: got error */
inflate_codes_mode;
/* inflate codes private state */
struct inflate_codes_state {
/* mode */
inflate_codes_mode mode; /* current inflate_codes mode */
/* mode dependent information */
uInt len;
union {
struct {
inflate_huft *tree; /* pointer into tree */
uInt need; /* bits needed */
} code; /* if LEN or DIST, where in tree */
uInt lit; /* if LIT, literal */
struct {
uInt get; /* bits to get for extra */
uInt dist; /* distance back to copy from */
} copy; /* if EXT or COPY, where and how much */
} sub; /* submode */
/* mode independent information */
Byte lbits; /* ltree bits decoded per branch */
Byte dbits; /* dtree bits decoder per branch */
inflate_huft *ltree; /* literal/length/eob tree */
inflate_huft *dtree; /* distance tree */
};
typedef enum {
@ -67,8 +113,6 @@ extern "C" {
BAD} /* got a data error--stuck here */
inflate_block_mode;
typedef struct inflate_huft_s FAR inflate_huft;
struct inflate_huft_s {
union {
struct {
@ -82,7 +126,6 @@ struct inflate_huft_s {
#define MANY 1440
struct inflate_codes_state;
typedef struct inflate_codes_state inflate_codes_statef;
struct inflate_blocks_state {
@ -96,13 +139,12 @@ struct inflate_blocks_state {
struct {
uInt table; /* table lengths (14 bits) */
uInt index; /* index into blens (or border) */
uIntf *blens; /* bit lengths of codes */
uIntf t_blens[258+31+31]; /* bit lengths of codes */
uInt bb; /* bit length tree depth */
inflate_huft *tb; /* bit length decoding tree */
} trees; /* if DTREE, decoding info for trees */
struct {
inflate_codes_statef
*codes;
inflate_codes_statef t_codes;
} decode; /* if CODES, current state */
} sub; /* submode */
uInt last; /* true if this block is the last block */