2011-09-10 01:36:31 -04:00
|
|
|
/* inftrees.h -- header to use inftrees.c
|
2011-09-10 02:14:39 -04:00
|
|
|
* Copyright (C) 1995-1996 Mark Adler
|
2011-09-10 01:36:31 -04:00
|
|
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* WARNING: this file should *not* be used by applications. It is
|
|
|
|
part of the implementation of the compression library and is
|
|
|
|
subject to change. Applications should only use zlib.h.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Huffman code lookup table entry--this entry is four bytes for machines
|
2011-09-10 02:08:28 -04:00
|
|
|
that have 16-bit pointers (e.g. PC's in the small or medium model). */
|
2011-09-10 02:08:07 -04:00
|
|
|
|
2011-09-10 02:09:18 -04:00
|
|
|
typedef struct inflate_huft_s FAR inflate_huft;
|
|
|
|
|
2011-09-10 01:36:31 -04:00
|
|
|
struct inflate_huft_s {
|
|
|
|
union {
|
|
|
|
struct {
|
2011-09-10 02:08:28 -04:00
|
|
|
Byte Exop; /* number of extra bits or operation */
|
2011-09-10 02:08:07 -04:00
|
|
|
Byte Bits; /* number of bits in this code or subcode */
|
2011-09-10 01:36:31 -04:00
|
|
|
} what;
|
2011-09-10 02:09:18 -04:00
|
|
|
Bytef *pad; /* pad structure to a power of 2 (4 bytes for */
|
2011-09-10 01:36:31 -04:00
|
|
|
} word; /* 16-bit, 8 bytes for 32-bit machines) */
|
|
|
|
union {
|
|
|
|
uInt Base; /* literal, length base, or distance base */
|
|
|
|
inflate_huft *Next; /* pointer to next level of table */
|
|
|
|
} more;
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
extern uInt inflate_hufts;
|
|
|
|
#endif
|
|
|
|
|
2011-09-10 02:09:18 -04:00
|
|
|
extern int inflate_trees_bits OF((
|
|
|
|
uIntf *, /* 19 code lengths */
|
|
|
|
uIntf *, /* bits tree desired/actual depth */
|
|
|
|
inflate_huft * FAR *, /* bits tree result */
|
2011-09-10 02:17:02 -04:00
|
|
|
z_streamp )); /* for zalloc, zfree functions */
|
2011-09-10 01:36:31 -04:00
|
|
|
|
2011-09-10 02:09:18 -04:00
|
|
|
extern int inflate_trees_dynamic OF((
|
2011-09-10 02:08:07 -04:00
|
|
|
uInt, /* number of literal/length codes */
|
|
|
|
uInt, /* number of distance codes */
|
2011-09-10 02:09:18 -04:00
|
|
|
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 */
|
2011-09-10 02:17:02 -04:00
|
|
|
z_streamp )); /* for zalloc, zfree functions */
|
2011-09-10 01:36:31 -04:00
|
|
|
|
2011-09-10 02:09:18 -04:00
|
|
|
extern int 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 */
|
2011-09-10 01:36:31 -04:00
|
|
|
|
2011-09-10 02:09:18 -04:00
|
|
|
extern int inflate_trees_free OF((
|
2011-09-10 02:08:07 -04:00
|
|
|
inflate_huft *, /* tables to free */
|
2011-09-10 02:17:02 -04:00
|
|
|
z_streamp )); /* for zfree function */
|
2011-09-10 02:09:18 -04:00
|
|
|
|