2003-03-18 22:53:15 +03:00
|
|
|
/* $NetBSD: inftrees.h,v 1.8 2003/03/18 19:53:16 mycroft Exp $ */
|
1996-09-13 04:29:49 +04:00
|
|
|
|
1996-09-12 19:33:09 +04:00
|
|
|
/* inftrees.h -- header to use inftrees.c
|
2002-03-12 02:40:14 +03:00
|
|
|
* Copyright (C) 1995-2002 Mark Adler
|
1999-07-03 16:30:16 +04:00
|
|
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
1996-09-12 19:33:09 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* 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
|
|
|
|
that have 16-bit pointers (e.g. PC's in the small or medium model). */
|
|
|
|
|
|
|
|
typedef struct inflate_huft_s FAR inflate_huft;
|
|
|
|
|
|
|
|
struct inflate_huft_s {
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
Byte Exop; /* number of extra bits or operation */
|
|
|
|
Byte Bits; /* number of bits in this code or subcode */
|
|
|
|
} what;
|
1998-11-01 23:33:24 +03:00
|
|
|
uInt pad; /* pad structure to a power of 2 (4 bytes for */
|
|
|
|
} word; /* 16-bit, 8 bytes for 32-bit int's) */
|
|
|
|
uInt base; /* literal, length base, distance base,
|
|
|
|
or table offset */
|
1996-09-12 19:33:09 +04:00
|
|
|
};
|
|
|
|
|
1998-11-01 23:33:24 +03:00
|
|
|
/* Maximum size of dynamic tree. The maximum found in a long but non-
|
|
|
|
exhaustive search was 1004 huft structures (850 for length/literals
|
|
|
|
and 154 for distances, the latter actually the result of an
|
|
|
|
exhaustive search). The actual maximum is not known, but the
|
|
|
|
value below is more than safe. */
|
|
|
|
#define MANY 1440
|
1996-09-12 19:33:09 +04:00
|
|
|
|
2001-01-08 17:48:19 +03:00
|
|
|
extern int inflate_trees_bits __P((
|
1996-09-12 19:33:09 +04:00
|
|
|
uIntf *, /* 19 code lengths */
|
|
|
|
uIntf *, /* bits tree desired/actual depth */
|
|
|
|
inflate_huft * FAR *, /* bits tree result */
|
1998-11-01 23:33:24 +03:00
|
|
|
inflate_huft *, /* space for trees */
|
|
|
|
z_streamp)); /* for messages */
|
1996-09-12 19:33:09 +04:00
|
|
|
|
2001-01-08 17:48:19 +03:00
|
|
|
extern int inflate_trees_dynamic __P((
|
1996-09-12 19:33:09 +04:00
|
|
|
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 */
|
1998-11-01 23:33:24 +03:00
|
|
|
inflate_huft *, /* space for trees */
|
|
|
|
z_streamp)); /* for messages */
|
1996-09-12 19:33:09 +04:00
|
|
|
|
2001-01-08 17:48:19 +03:00
|
|
|
extern int inflate_trees_fixed __P((
|
1996-09-12 19:33:09 +04:00
|
|
|
uIntf *, /* literal desired/actual bit depth */
|
|
|
|
uIntf *, /* distance desired/actual bit depth */
|
2003-03-18 22:53:15 +03:00
|
|
|
const inflate_huft * FAR *, /* literal/length tree result */
|
|
|
|
const inflate_huft * FAR *, /* distance tree result */
|
1998-11-01 23:33:24 +03:00
|
|
|
z_streamp)); /* for memory allocation */
|