5128eecc9f 2011-02-23 kinaba: /* inftrees.h -- header to use inftrees.c 5128eecc9f 2011-02-23 kinaba: * Copyright (C) 1995-1998 Mark Adler 5128eecc9f 2011-02-23 kinaba: * For conditions of distribution and use, see copyright notice in zlib.h 5128eecc9f 2011-02-23 kinaba: */ 5128eecc9f 2011-02-23 kinaba: 5128eecc9f 2011-02-23 kinaba: /* WARNING: this file should *not* be used by applications. It is 5128eecc9f 2011-02-23 kinaba: part of the implementation of the compression library and is 5128eecc9f 2011-02-23 kinaba: subject to change. Applications should only use zlib.h. 5128eecc9f 2011-02-23 kinaba: */ 5128eecc9f 2011-02-23 kinaba: 5128eecc9f 2011-02-23 kinaba: /* Huffman code lookup table entry--this entry is four bytes for machines 5128eecc9f 2011-02-23 kinaba: that have 16-bit pointers (e.g. PC's in the small or medium model). */ 5128eecc9f 2011-02-23 kinaba: 5128eecc9f 2011-02-23 kinaba: typedef struct inflate_huft_s FAR inflate_huft; 5128eecc9f 2011-02-23 kinaba: 5128eecc9f 2011-02-23 kinaba: struct inflate_huft_s { 5128eecc9f 2011-02-23 kinaba: union { 5128eecc9f 2011-02-23 kinaba: struct { 5128eecc9f 2011-02-23 kinaba: Byte Exop; /* number of extra bits or operation */ 5128eecc9f 2011-02-23 kinaba: Byte Bits; /* number of bits in this code or subcode */ 5128eecc9f 2011-02-23 kinaba: } what; 5128eecc9f 2011-02-23 kinaba: uInt pad; /* pad structure to a power of 2 (4 bytes for */ 5128eecc9f 2011-02-23 kinaba: } word; /* 16-bit, 8 bytes for 32-bit int's) */ 5128eecc9f 2011-02-23 kinaba: uInt base; /* literal, length base, distance base, 5128eecc9f 2011-02-23 kinaba: or table offset */ 5128eecc9f 2011-02-23 kinaba: }; 5128eecc9f 2011-02-23 kinaba: 5128eecc9f 2011-02-23 kinaba: /* Maximum size of dynamic tree. The maximum found in a long but non- 5128eecc9f 2011-02-23 kinaba: exhaustive search was 1004 huft structures (850 for length/literals 5128eecc9f 2011-02-23 kinaba: and 154 for distances, the latter actually the result of an 5128eecc9f 2011-02-23 kinaba: exhaustive search). The actual maximum is not known, but the 5128eecc9f 2011-02-23 kinaba: value below is more than safe. */ 5128eecc9f 2011-02-23 kinaba: #define MANY 1440 5128eecc9f 2011-02-23 kinaba: 5128eecc9f 2011-02-23 kinaba: extern int inflate_trees_bits OF(( 5128eecc9f 2011-02-23 kinaba: uIntf *, /* 19 code lengths */ 5128eecc9f 2011-02-23 kinaba: uIntf *, /* bits tree desired/actual depth */ 5128eecc9f 2011-02-23 kinaba: inflate_huft * FAR *, /* bits tree result */ 5128eecc9f 2011-02-23 kinaba: inflate_huft *, /* space for trees */ 5128eecc9f 2011-02-23 kinaba: z_streamp)); /* for messages */ 5128eecc9f 2011-02-23 kinaba: 5128eecc9f 2011-02-23 kinaba: extern int inflate_trees_dynamic OF(( 5128eecc9f 2011-02-23 kinaba: uInt, /* number of literal/length codes */ 5128eecc9f 2011-02-23 kinaba: uInt, /* number of distance codes */ 5128eecc9f 2011-02-23 kinaba: uIntf *, /* that many (total) code lengths */ 5128eecc9f 2011-02-23 kinaba: uIntf *, /* literal desired/actual bit depth */ 5128eecc9f 2011-02-23 kinaba: uIntf *, /* distance desired/actual bit depth */ 5128eecc9f 2011-02-23 kinaba: inflate_huft * FAR *, /* literal/length tree result */ 5128eecc9f 2011-02-23 kinaba: inflate_huft * FAR *, /* distance tree result */ 5128eecc9f 2011-02-23 kinaba: inflate_huft *, /* space for trees */ 5128eecc9f 2011-02-23 kinaba: z_streamp)); /* for messages */ 5128eecc9f 2011-02-23 kinaba: 5128eecc9f 2011-02-23 kinaba: extern int inflate_trees_fixed OF(( 5128eecc9f 2011-02-23 kinaba: uIntf *, /* literal desired/actual bit depth */ 5128eecc9f 2011-02-23 kinaba: uIntf *, /* distance desired/actual bit depth */ 5128eecc9f 2011-02-23 kinaba: inflate_huft * FAR *, /* literal/length tree result */ 5128eecc9f 2011-02-23 kinaba: inflate_huft * FAR *, /* distance tree result */ 5128eecc9f 2011-02-23 kinaba: z_streamp)); /* for memory allocation */