#ifndef ZEXTERN
# define ZEXTERN extern
#endif
-#ifndef FAR
-# define FAR
-#endif
typedef unsigned char Byte; /* 8 bits */
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
-
-typedef Byte FAR Bytef;
-typedef char FAR charf;
-typedef int FAR intf;
-typedef uInt FAR uIntf;
-typedef uLong FAR uLongf;
-
-typedef void FAR *voidpf;
typedef void *voidp;
#include <linux/types.h> /* for off_t */
crash even in case of corrupted input.
*/
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void (*free_func) OF((voidpf opaque, voidpf address));
-
struct internal_state;
typedef struct z_stream_s {
- Bytef *next_in; /* next input byte */
+ Byte *next_in; /* next input byte */
uInt avail_in; /* number of bytes available at next_in */
uLong total_in; /* total nb of input bytes read so far */
- Bytef *next_out; /* next output byte should be put there */
+ Byte *next_out; /* next output byte should be put there */
uInt avail_out; /* remaining free space at next_out */
uLong total_out; /* total nb of bytes output so far */
char *msg; /* last error message, NULL if no error */
- struct internal_state FAR *state; /* not visible by applications */
+ struct internal_state *state; /* not visible by applications */
void *workspace; /* memory allocated for this stream */
uLong reserved; /* reserved for future use */
} z_stream;
-typedef z_stream FAR *z_streamp;
+typedef z_stream *z_streamp;
/*
The application must update next_in and avail_in when avail_in has
*/
ZEXTERN int ZEXPORT zlib_deflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
+ const Byte *dictionary,
uInt dictLength));
/*
Initializes the compression dictionary from the given byte sequence
*/
ZEXTERN int ZEXPORT zlib_inflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
+ const Byte *dictionary,
uInt dictLength));
/*
Initializes the decompression dictionary from the given uncompressed byte
struct internal_state {int dummy;}; /* hack for buggy compilers */
#endif
-ZEXTERN const char * ZEXPORT zlib_zError OF((int err));
-ZEXTERN int ZEXPORT zlib_inflateSyncPoint OF((z_streamp z));
-ZEXTERN const uLongf * ZEXPORT zlib_get_crc_table OF((void));
+ZEXTERN const char * ZEXPORT zlib_zError OF((int err));
+ZEXTERN int ZEXPORT zlib_inflateSyncPoint OF((z_streamp z));
+ZEXTERN const uLong * ZEXPORT zlib_get_crc_table OF((void));
#ifdef __cplusplus
}
/* compile with -Dlocal if your debugger can't find static symbols */
typedef unsigned char uch;
-typedef uch FAR uchf;
typedef unsigned short ush;
-typedef ush FAR ushf;
typedef unsigned long ulg;
/* common constants */
/* functions */
-typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
+typedef uLong (ZEXPORT *check_func) OF((uLong check, const Byte *buf,
uInt len));
if (adler != original_adler) error();
*/
static inline uLong zlib_adler32(uLong adler,
- const Bytef *buf,
+ const Byte *buf,
uInt len)
{
unsigned long s1 = adler & 0xffff;
local void lm_init 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 int read_buf OF((z_streamp strm, Byte *buf, unsigned size));
local uInt longest_match OF((deflate_state *s, IPos cur_match));
#ifdef DEBUG_ZLIB
*/
#define CLEAR_HASH(s) \
s->head[s->hash_size-1] = NIL; \
- memset((charf *)s->head, 0, (unsigned)(s->hash_size-1)*sizeof(*s->head));
+ memset((char *)s->head, 0, (unsigned)(s->hash_size-1)*sizeof(*s->head));
/* ========================================================================= */
int zlib_deflateInit_(
static char* my_version = ZLIB_VERSION;
deflate_workspace *mem;
- ushf *overlay;
+ ush *overlay;
/* We overlay pending_buf and d_buf+l_buf. This works since the average
* output size for (length,distance) codes is <= 24 bits.
*/
return Z_STREAM_ERROR;
}
s = (deflate_state *) &(mem->deflate_memory);
- strm->state = (struct internal_state FAR *)s;
+ strm->state = (struct internal_state *)s;
s->strm = strm;
s->noheader = noheader;
s->hash_mask = s->hash_size - 1;
s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
- s->window = (Bytef *) mem->window_memory;
- s->prev = (Posf *) mem->prev_memory;
- s->head = (Posf *) mem->head_memory;
+ s->window = (Byte *) mem->window_memory;
+ s->prev = (Pos *) mem->prev_memory;
+ s->head = (Pos *) mem->head_memory;
s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
- overlay = (ushf *) mem->overlay_memory;
- s->pending_buf = (uchf *) overlay;
+ overlay = (ush *) mem->overlay_memory;
+ s->pending_buf = (uch *) overlay;
s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
/* ========================================================================= */
int zlib_deflateSetDictionary(
z_streamp strm,
- const Bytef *dictionary,
+ const Byte *dictionary,
uInt dictLength
)
{
dictionary += dictLength - length; /* use the tail of the dictionary */
#endif
}
- memcpy((charf *)s->window, dictionary, length);
+ memcpy((char *)s->window, dictionary, length);
s->strstart = length;
s->block_start = (long)length;
#else
deflate_state *ds;
deflate_state *ss;
- ushf *overlay;
+ ush *overlay;
deflate_workspace *mem;
ds = &(mem->deflate_memory);
- dest->state = (struct internal_state FAR *) ds;
+ dest->state = (struct internal_state *) ds;
*ds = *ss;
ds->strm = dest;
- ds->window = (Bytef *) mem->window_memory;
- ds->prev = (Posf *) mem->prev_memory;
- ds->head = (Posf *) mem->head_memory;
- overlay = (ushf *) mem->overlay_memory;
- ds->pending_buf = (uchf *) overlay;
+ ds->window = (Byte *) mem->window_memory;
+ ds->prev = (Pos *) mem->prev_memory;
+ ds->head = (Pos *) mem->head_memory;
+ overlay = (ush *) mem->overlay_memory;
+ ds->pending_buf = (uch *) overlay;
memcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
memcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));
*/
local int read_buf(
z_streamp strm,
- Bytef *buf,
+ Byte *buf,
unsigned size
)
{
IPos cur_match; /* current match */
{
unsigned chain_length = s->max_chain_length;/* max hash chain length */
- register Bytef *scan = s->window + s->strstart; /* current string */
- register Bytef *match; /* matched string */
+ register Byte *scan = s->window + s->strstart; /* current string */
+ register Byte *match; /* matched string */
register int len; /* length of current match */
int best_len = s->prev_length; /* best match length so far */
int nice_match = s->nice_match; /* stop if match long enough */
/* Stop when cur_match becomes <= limit. To simplify the code,
* we prevent matches with the string of window index 0.
*/
- Posf *prev = s->prev;
+ Pos *prev = s->prev;
uInt wmask = s->w_mask;
#ifdef UNALIGNED_OK
/* Compare two bytes at a time. Note: this is not always beneficial.
* Try with and without -DUNALIGNED_OK to check.
*/
- register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
- register ush scan_start = *(ushf*)scan;
- register ush scan_end = *(ushf*)(scan+best_len-1);
+ register Byte *strend = s->window + s->strstart + MAX_MATCH - 1;
+ register ush scan_start = *(ush*)scan;
+ register ush scan_end = *(ush*)(scan+best_len-1);
#else
- register Bytef *strend = s->window + s->strstart + MAX_MATCH;
+ register Byte *strend = s->window + s->strstart + MAX_MATCH;
register Byte scan_end1 = scan[best_len-1];
register Byte scan_end = scan[best_len];
#endif
/* This code assumes sizeof(unsigned short) == 2. Do not use
* UNALIGNED_OK if your compiler uses a different size.
*/
- if (*(ushf*)(match+best_len-1) != scan_end ||
- *(ushf*)match != scan_start) continue;
+ if (*(ush*)(match+best_len-1) != scan_end ||
+ *(ush*)match != scan_start) continue;
/* It is not necessary to compare scan[2] and match[2] since they are
* always equal when the other bytes match, given that the hash keys
Assert(scan[2] == match[2], "scan[2]?");
scan++, match++;
do {
- } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
- *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+ } while (*(ush*)(scan+=2) == *(ush*)(match+=2) &&
+ *(ush*)(scan+=2) == *(ush*)(match+=2) &&
+ *(ush*)(scan+=2) == *(ush*)(match+=2) &&
+ *(ush*)(scan+=2) == *(ush*)(match+=2) &&
scan < strend);
/* The funny "do {}" generates better code on most compilers */
best_len = len;
if (len >= nice_match) break;
#ifdef UNALIGNED_OK
- scan_end = *(ushf*)(scan+best_len-1);
+ scan_end = *(ush*)(scan+best_len-1);
#else
scan_end1 = scan[best_len-1];
scan_end = scan[best_len];
int length;
{
/* check that the match is indeed a match */
- if (memcmp((charf *)s->window + match,
- (charf *)s->window + start, length) != EQUAL) {
+ if (memcmp((char *)s->window + match,
+ (char *)s->window + start, length) != EQUAL) {
fprintf(stderr, " start %u, match %u, length %d\n",
start, match, length);
do {
deflate_state *s;
{
register unsigned n, m;
- register Posf *p;
+ register Pos *p;
unsigned more; /* Amount of free space at the end of the window. */
uInt wsize = s->w_size;
*/
} else if (s->strstart >= wsize+MAX_DIST(s)) {
- memcpy((charf *)s->window, (charf *)s->window+wsize,
+ memcpy((char *)s->window, (char *)s->window+wsize,
(unsigned)wsize);
s->match_start -= wsize;
s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
*/
#define FLUSH_BLOCK_ONLY(s, eof) { \
zlib_tr_flush_block(s, (s->block_start >= 0L ? \
- (charf *)&s->window[(unsigned)s->block_start] : \
- (charf *)Z_NULL), \
+ (char *)&s->window[(unsigned)s->block_start] : \
+ (char *)Z_NULL), \
(ulg)((long)s->strstart - s->block_start), \
(eof)); \
s->block_start = s->strstart; \
struct static_tree_desc_s {
const ct_data *static_tree; /* static tree or NULL */
- const intf *extra_bits; /* extra bits for each code or NULL */
+ const int *extra_bits; /* extra bits for each code or NULL */
int extra_base; /* base index for extra_bits */
int elems; /* max number of elements in the tree */
int max_length; /* max bit length for the codes */
local void init_block OF((deflate_state *s));
local void pqdownheap OF((deflate_state *s, ct_data *tree, int k));
local void gen_bitlen OF((deflate_state *s, tree_desc *desc));
-local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count));
+local void gen_codes OF((ct_data *tree, int max_code, ush *bl_count));
local void build_tree OF((deflate_state *s, tree_desc *desc));
local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code));
local void send_tree OF((deflate_state *s, ct_data *tree, int max_code));
local unsigned bi_reverse OF((unsigned value, int length));
local void bi_windup OF((deflate_state *s));
local void bi_flush OF((deflate_state *s));
-local void copy_block OF((deflate_state *s, charf *buf, unsigned len,
+local void copy_block OF((deflate_state *s, char *buf, unsigned len,
int header));
#ifndef DEBUG_ZLIB
ct_data *tree = desc->dyn_tree;
int max_code = desc->max_code;
const ct_data *stree = desc->stat_desc->static_tree;
- const intf *extra = desc->stat_desc->extra_bits;
+ const int *extra = desc->stat_desc->extra_bits;
int base = desc->stat_desc->extra_base;
int max_length = desc->stat_desc->max_length;
int h; /* heap index */
local void gen_codes(
ct_data *tree, /* the tree to decorate */
int max_code, /* largest code with non zero frequency */
- ushf *bl_count /* number of codes at each bit length */
+ ush *bl_count /* number of codes at each bit length */
)
{
ush next_code[MAX_BITS+1]; /* next code value for each bit length */
*/
void zlib_tr_stored_block(
deflate_state *s,
- charf *buf, /* input block */
+ char *buf, /* input block */
ulg stored_len, /* length of input block */
int eof /* true if this is the last block for a file */
)
*/
ulg zlib_tr_flush_block(
deflate_state *s,
- charf *buf, /* input block, or NULL if too old */
+ char *buf, /* input block, or NULL if too old */
ulg stored_len, /* length of input block */
int eof /* true if this is the last block for a file */
)
if (stored_len <= opt_lenb && eof && s->compressed_len==0L && seekable()) {
# endif
/* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
- if (buf == (charf*)0) error ("block vanished");
+ if (buf == (char*)0) error ("block vanished");
copy_block(s, buf, (unsigned)stored_len, 0); /* without header */
s->compressed_len = stored_len << 3;
*/
local void copy_block(
deflate_state *s,
- charf *buf, /* the input data */
+ char *buf, /* the input data */
unsigned len, /* its length */
int header /* true if block header must be written */
)
ush dad; /* father node in Huffman tree */
ush len; /* length of bit string */
} dl;
-} FAR ct_data;
+} ct_data;
#define Freq fc.freq
#define Code fc.code
ct_data *dyn_tree; /* the dynamic tree */
int max_code; /* largest code with non zero frequency */
static_tree_desc *stat_desc; /* the corresponding static tree */
-} FAR tree_desc;
+} tree_desc;
typedef ush Pos;
-typedef Pos FAR Posf;
typedef unsigned IPos;
/* A Pos is an index in the character window. We use short instead of int to
typedef struct deflate_state {
z_streamp strm; /* pointer back to this zlib stream */
int status; /* as the name implies */
- Bytef *pending_buf; /* output still pending */
+ Byte *pending_buf; /* output still pending */
ulg pending_buf_size; /* size of pending_buf */
- Bytef *pending_out; /* next pending byte to output to the stream */
+ Byte *pending_out; /* next pending byte to output to the stream */
int pending; /* nb of bytes in the pending buffer */
int noheader; /* suppress zlib header and adler32 */
Byte data_type; /* UNKNOWN, BINARY or ASCII */
uInt w_bits; /* log2(w_size) (8..16) */
uInt w_mask; /* w_size - 1 */
- Bytef *window;
+ Byte *window;
/* Sliding window. Input bytes are read into the second half of the window,
* and move to the first half later to keep a dictionary of at least wSize
* bytes. With this organization, matches are limited to a distance of
* is directly used as sliding window.
*/
- Posf *prev;
+ Pos *prev;
/* Link to older string with same hash index. To limit the size of this
* array to 64K, this link is maintained only for the last 32K strings.
* An index in this array is thus a window index modulo 32K.
*/
- Posf *head; /* Heads of the hash chains or NIL. */
+ Pos *head; /* Heads of the hash chains or NIL. */
uInt ins_h; /* hash index of string to be inserted */
uInt hash_size; /* number of elements in hash table */
/* Depth of each subtree used as tie breaker for trees of equal frequency
*/
- uchf *l_buf; /* buffer for literals or lengths */
+ uch *l_buf; /* buffer for literals or lengths */
uInt lit_bufsize;
/* Size of match buffer for literals/lengths. There are 4 reasons for
uInt last_lit; /* running index in l_buf */
- ushf *d_buf;
+ ush *d_buf;
/* Buffer for distances. To simplify the code, d_buf and l_buf have
* the same number of elements. To use different lengths, an extra flag
* array would be necessary.
* are always zero.
*/
-} FAR deflate_state;
+} deflate_state;
typedef struct deflate_workspace {
/* State memory for the deflator */
/* in trees.c */
void zlib_tr_init OF((deflate_state *s));
int zlib_tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
-ulg zlib_tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len,
+ulg zlib_tr_flush_block OF((deflate_state *s, char *buf, ulg stored_len,
int eof));
void zlib_tr_align OF((deflate_state *s));
-void zlib_tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
+void zlib_tr_stored_block OF((deflate_state *s, char *buf, ulg stored_len,
int eof));
void zlib_tr_stored_type_only OF((deflate_state *));
void zlib_inflate_blocks_reset(
inflate_blocks_statef *s,
z_streamp z,
- uLongf *c
+ uLong *c
)
{
if (c != Z_NULL)
s->bitb = 0;
s->read = s->write = s->window;
if (s->checkfn != Z_NULL)
- z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
+ z->adler = s->check = (*s->checkfn)(0L, (const Byte *)Z_NULL, 0);
}
inflate_blocks_statef *zlib_inflate_blocks_new(
uInt t; /* temporary storage */
uLong b; /* bit buffer */
uInt k; /* bits in bit buffer */
- Bytef *p; /* input data pointer */
+ Byte *p; /* input data pointer */
uInt n; /* bytes available there */
- Bytef *q; /* output window write pointer */
+ Byte *q; /* output window write pointer */
uInt m; /* bytes to end of window or read pointer */
/* copy input/output information to locals (UPDATE macro restores) */
void zlib_inflate_set_dictionary(
inflate_blocks_statef *s,
- const Bytef *d,
+ const Byte *d,
uInt n
)
{
#define _INFBLOCK_H
struct inflate_blocks_state;
-typedef struct inflate_blocks_state FAR inflate_blocks_statef;
+typedef struct inflate_blocks_state inflate_blocks_statef;
extern inflate_blocks_statef * zlib_inflate_blocks_new OF((
z_streamp z,
extern void zlib_inflate_blocks_reset OF((
inflate_blocks_statef *,
z_streamp ,
- uLongf *)); /* check value on output */
+ uLong *)); /* check value on output */
extern int zlib_inflate_blocks_free OF((
inflate_blocks_statef *,
extern void zlib_inflate_set_dictionary OF((
inflate_blocks_statef *s,
- const Bytef *d, /* dictionary */
+ const Byte *d, /* dictionary */
uInt n)); /* dictionary length */
extern int zlib_inflate_blocks_sync_point OF((
uInt e; /* extra bits or operation */
uLong b; /* bit buffer */
uInt k; /* bits in bit buffer */
- Bytef *p; /* input data pointer */
+ Byte *p; /* input data pointer */
uInt n; /* bytes available there */
- Bytef *q; /* output window write pointer */
+ Byte *q; /* output window write pointer */
uInt m; /* bytes to end of window or read pointer */
- Bytef *f; /* pointer to copy strings from */
+ Byte *f; /* pointer to copy strings from */
inflate_codes_statef *c = s->sub.decode.codes; /* codes state */
/* copy input/output information to locals (UPDATE macro restores) */
#include "infblock.h"
struct inflate_codes_state;
-typedef struct inflate_codes_state FAR inflate_codes_statef;
+typedef struct inflate_codes_state inflate_codes_statef;
extern inflate_codes_statef *zlib_inflate_codes_new OF((
uInt, uInt,
uInt e; /* extra bits or operation */
uLong b; /* bit buffer */
uInt k; /* bits in bit buffer */
- Bytef *p; /* input data pointer */
+ Byte *p; /* input data pointer */
uInt n; /* bytes available there */
- Bytef *q; /* output window write pointer */
+ Byte *q; /* output window write pointer */
uInt m; /* bytes to end of window or read pointer */
uInt ml; /* mask for literal/length tree */
uInt md; /* mask for distance tree */
uInt c; /* bytes to copy */
uInt d; /* distance back to copy from */
- Bytef *r; /* copy source pointer */
+ Byte *r; /* copy source pointer */
/* load input, output, bit values */
LOAD
local int huft_build OF((
- uIntf *, /* code lengths in bits */
+ uInt *, /* code lengths in bits */
uInt, /* number of codes */
uInt, /* number of "simple" codes */
- const uIntf *, /* list of base values for non-simple codes */
- const uIntf *, /* list of extra bits for non-simple codes */
- inflate_huft * FAR*,/* result: starting table */
- uIntf *, /* maximum lookup bits (returns actual) */
+ const uInt *, /* list of base values for non-simple codes */
+ const uInt *, /* list of extra bits for non-simple codes */
+ inflate_huft **, /* result: starting table */
+ uInt *, /* maximum lookup bits (returns actual) */
inflate_huft *, /* space for trees */
uInt *, /* hufts used in space */
- uIntf * )); /* space for values */
+ uInt * )); /* space for values */
/* Tables for deflate from PKZIP's appnote.txt. */
local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
#define BMAX 15 /* maximum bit length of any code */
local int huft_build(
- uIntf *b, /* code lengths in bits (all assumed <= BMAX) */
- uInt n, /* number of codes (assumed <= 288) */
- uInt s, /* number of simple-valued codes (0..s-1) */
- const uIntf *d, /* list of base values for non-simple codes */
- const uIntf *e, /* list of extra bits for non-simple codes */
- inflate_huft * FAR *t, /* result: starting table */
- uIntf *m, /* maximum lookup bits, returns actual */
- inflate_huft *hp, /* space for trees */
- uInt *hn, /* hufts used in space */
- uIntf *v /* working area: values in order of bit length */
+ uInt *b, /* code lengths in bits (all assumed <= BMAX) */
+ uInt n, /* number of codes (assumed <= 288) */
+ uInt s, /* number of simple-valued codes (0..s-1) */
+ const uInt *d, /* list of base values for non-simple codes */
+ const uInt *e, /* list of extra bits for non-simple codes */
+ inflate_huft **t, /* result: starting table */
+ uInt *m, /* maximum lookup bits, returns actual */
+ inflate_huft *hp, /* space for trees */
+ uInt *hn, /* hufts used in space */
+ uInt *v /* working area: values in order of bit length */
)
/* Given a list of code lengths and a maximum table size, make a set of
tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
register int k; /* number of bits in current code */
int l; /* bits per table (returned in m) */
uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */
- register uIntf *p; /* pointer into c[], b[], or v[] */
+ register uInt *p; /* pointer into c[], b[], or v[] */
inflate_huft *q; /* points to current table */
struct inflate_huft_s r; /* table entry for structure assignment */
inflate_huft *u[BMAX]; /* table stack */
register int w; /* bits before this table == (l * h) */
uInt x[BMAX+1]; /* bit offsets, then code stack */
- uIntf *xp; /* pointer into x */
+ uInt *xp; /* pointer into x */
int y; /* number of dummy codes added */
uInt z; /* number of entries in current table */
int zlib_inflate_trees_bits(
- uIntf *c, /* 19 code lengths */
- uIntf *bb, /* bits tree desired/actual depth */
- inflate_huft * FAR *tb, /* bits tree result */
+ uInt *c, /* 19 code lengths */
+ uInt *bb, /* bits tree desired/actual depth */
+ inflate_huft **tb, /* bits tree result */
inflate_huft *hp, /* space for trees */
z_streamp z /* for messages */
)
{
int r;
uInt hn = 0; /* hufts used in space */
- uIntf *v; /* work area for huft_build */
+ uInt *v; /* work area for huft_build */
v = WS(z)->tree_work_area_1;
- r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL,
+ r = huft_build(c, 19, 19, (uInt*)Z_NULL, (uInt*)Z_NULL,
tb, bb, hp, &hn, v);
if (r == Z_DATA_ERROR)
z->msg = (char*)"oversubscribed dynamic bit lengths tree";
int zlib_inflate_trees_dynamic(
uInt nl, /* number of literal/length codes */
uInt nd, /* number of distance codes */
- uIntf *c, /* that many (total) code lengths */
- uIntf *bl, /* literal desired/actual bit depth */
- uIntf *bd, /* distance desired/actual bit depth */
- inflate_huft * FAR *tl, /* literal/length tree result */
- inflate_huft * FAR *td, /* distance tree result */
+ uInt *c, /* that many (total) code lengths */
+ uInt *bl, /* literal desired/actual bit depth */
+ uInt *bd, /* distance desired/actual bit depth */
+ inflate_huft **tl, /* literal/length tree result */
+ inflate_huft **td, /* distance tree result */
inflate_huft *hp, /* space for trees */
z_streamp z /* for messages */
)
{
int r;
uInt hn = 0; /* hufts used in space */
- uIntf *v; /* work area for huft_build */
+ uInt *v; /* work area for huft_build */
/* allocate work area */
v = WS(z)->tree_work_area_2;
int zlib_inflate_trees_fixed(
- uIntf *bl, /* literal desired/actual bit depth */
- uIntf *bd, /* distance desired/actual bit depth */
- inflate_huft * FAR *tl, /* literal/length tree result */
- inflate_huft * FAR *td, /* distance tree result */
+ uInt *bl, /* literal desired/actual bit depth */
+ uInt *bd, /* distance desired/actual bit depth */
+ inflate_huft **tl, /* literal/length tree result */
+ inflate_huft **td, /* distance tree result */
z_streamp z /* for memory allocation */
)
{
#ifndef _INFTREES_H
#define _INFTREES_H
-typedef struct inflate_huft_s FAR inflate_huft;
+typedef struct inflate_huft_s inflate_huft;
struct inflate_huft_s {
union {
#define MANY 1440
extern int zlib_inflate_trees_bits OF((
- uIntf *, /* 19 code lengths */
- uIntf *, /* bits tree desired/actual depth */
- inflate_huft * FAR *, /* bits tree result */
+ uInt *, /* 19 code lengths */
+ uInt *, /* bits tree desired/actual depth */
+ inflate_huft **, /* bits tree result */
inflate_huft *, /* space for trees */
z_streamp)); /* for messages */
extern int zlib_inflate_trees_dynamic OF((
uInt, /* number of literal/length codes */
uInt, /* number of distance codes */
- uIntf *, /* that many (total) code lengths */
- uIntf *, /* literal desired/actual bit depth */
- uIntf *, /* distance desired/actual bit depth */
- inflate_huft * FAR *, /* literal/length tree result */
- inflate_huft * FAR *, /* distance tree result */
+ uInt *, /* that many (total) code lengths */
+ uInt *, /* literal desired/actual bit depth */
+ uInt *, /* distance desired/actual bit depth */
+ inflate_huft **, /* literal/length tree result */
+ inflate_huft **, /* distance tree result */
inflate_huft *, /* space for trees */
z_streamp)); /* for messages */
extern int zlib_inflate_trees_fixed OF((
- uIntf *, /* literal desired/actual bit depth */
- uIntf *, /* distance desired/actual bit depth */
- inflate_huft * FAR *, /* literal/length tree result */
- inflate_huft * FAR *, /* distance tree result */
+ uInt *, /* literal desired/actual bit depth */
+ uInt *, /* distance desired/actual bit depth */
+ inflate_huft **, /* literal/length tree result */
+ inflate_huft **, /* distance tree result */
z_streamp)); /* for memory allocation */
#endif /* _INFTREES_H */
)
{
uInt n;
- Bytef *p;
- Bytef *q;
+ Byte *p;
+ Byte *q;
/* local copies of source and destination pointers */
p = z->next_out;
struct {
uInt table; /* table lengths (14 bits) */
uInt index; /* index into blens (or border) */
- uIntf *blens; /* bit lengths of codes */
+ uInt *blens; /* bit lengths of codes */
uInt bb; /* bit length tree depth */
inflate_huft *tb; /* bit length decoding tree */
} trees; /* if DTREE, decoding info for trees */
uInt bitk; /* bits in bit buffer */
uLong bitb; /* bit buffer */
inflate_huft *hufts; /* single malloc for tree space */
- Bytef *window; /* sliding window */
- Bytef *end; /* one byte after sliding window */
- Bytef *read; /* window read pointer */
- Bytef *write; /* window write pointer */
+ Byte *window; /* sliding window */
+ Byte *end; /* one byte after sliding window */
+ Byte *read; /* window read pointer */
+ Byte *write; /* window write pointer */
check_func checkfn; /* check function */
uLong check; /* check on output */