2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
19 /* inftrees.h -- header to use inftrees.c
20 * Copyright (C) 1995-1998 Mark Adler
21 * For conditions of distribution and use, see copyright notice in zlib.h
24 /* WARNING: this file should *not* be used by applications. It is
25 part of the implementation of the compression library and is
26 subject to change. Applications should only use zlib.h.
29 /* Huffman code lookup table entry--this entry is four bytes for machines
30 that have 16-bit pointers (e.g. PC's in the small or medium model). */
32 typedef struct inflate_huft_s FAR inflate_huft
;
34 struct inflate_huft_s
{
37 Byte Exop
; /* number of extra bits or operation */
38 Byte Bits
; /* number of bits in this code or subcode */
40 uInt pad
; /* pad structure to a power of 2 (4 bytes for */
41 } word
; /* 16-bit, 8 bytes for 32-bit int's) */
42 uInt base
; /* literal, length base, distance base,
46 /* Maximum size of dynamic tree. The maximum found in a long but non-
47 exhaustive search was 1004 huft structures (850 for length/literals
48 and 154 for distances, the latter actually the result of an
49 exhaustive search). The actual maximum is not known, but the
50 value below is more than safe. */
53 extern int inflate_trees_bits
OF((
54 uIntf
*, /* 19 code lengths */
55 uIntf
*, /* bits tree desired/actual depth */
56 inflate_huft
* FAR
*, /* bits tree result */
57 inflate_huft
*, /* space for trees */
58 z_streamp
)); /* for messages */
60 extern int inflate_trees_dynamic
OF((
61 uInt
, /* number of literal/length codes */
62 uInt
, /* number of distance codes */
63 uIntf
*, /* that many (total) code lengths */
64 uIntf
*, /* literal desired/actual bit depth */
65 uIntf
*, /* distance desired/actual bit depth */
66 inflate_huft
* FAR
*, /* literal/length tree result */
67 inflate_huft
* FAR
*, /* distance tree result */
68 inflate_huft
*, /* space for trees */
69 z_streamp
)); /* for messages */
71 extern int inflate_trees_fixed
OF((
72 uIntf
*, /* literal desired/actual bit depth */
73 uIntf
*, /* distance desired/actual bit depth */
74 inflate_huft
* FAR
*, /* literal/length tree result */
75 inflate_huft
* FAR
*, /* distance tree result */
76 z_streamp
)); /* for memory allocation */