annotate zlib/inftrees.h @ 3:5a977ccbc7a9 default tip

Empty changelog
author darius
date Sat, 06 Dec 1997 05:41:29 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1 /* inftrees.h -- header to use inftrees.c
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
2 * Copyright (C) 1995 Mark Adler
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
3 * For conditions of distribution and use, see copyright notice in zlib.h
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
4 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
5
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
6 /* WARNING: this file should *not* be used by applications. It is
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
7 part of the implementation of the compression library and is
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
8 subject to change. Applications should only use zlib.h.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
9 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
10
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
11 /* Huffman code lookup table entry--this entry is four bytes for machines
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
12 that have 16-bit pointers (e.g. PC's in the small or medium model).
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
13 Valid extra bits (exop) are 0..13. exop == -64 is EOB (end of block),
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
14 exop == 16 means that v is a literal, exop < 0 means that v is a pointer
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
15 to the next table, which codes -exop bits, and lastly exop == -128
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
16 indicates an unused code. If a code with exop == -128 is looked up,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
17 this implies an error in the data. */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
18
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
19 #if defined(STDC) || defined(sgi)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
20 typedef signed char Char;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
21 #else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
22 typedef char Char; /* just hope that char is signed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
23 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
24
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
25 typedef struct inflate_huft_s inflate_huft;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
26 struct inflate_huft_s {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
27 union {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
28 struct {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
29 Char Exop; /* number of extra bits or operation */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
30 Byte Bits; /* number of bits in this code or subcode */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
31 } what;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
32 Byte *pad; /* pad structure to a power of 2 (4 bytes for */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
33 } word; /* 16-bit, 8 bytes for 32-bit machines) */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
34 union {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
35 uInt Base; /* literal, length base, or distance base */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
36 inflate_huft *Next; /* pointer to next level of table */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
37 } more;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
38 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
39
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
40 #ifdef DEBUG
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
41 extern uInt inflate_hufts;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
42 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
43
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
44 extern int inflate_trees_bits __P((
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
45 uInt *, /* 19 code lengths */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
46 uInt *, /* bits tree desired/actual depth */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
47 inflate_huft **, /* bits tree result */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
48 z_stream *)); /* for zalloc, zfree functions */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
49
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
50 extern int inflate_trees_dynamic __P((
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
51 uInt, /* number of literal/length codes */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
52 uInt, /* number of distance codes */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
53 uInt *, /* that many (total) code lengths */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
54 uInt *, /* literal desired/actual bit depth */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
55 uInt *, /* distance desired/actual bit depth */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
56 inflate_huft **, /* literal/length tree result */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
57 inflate_huft **, /* distance tree result */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
58 z_stream *)); /* for zalloc, zfree functions */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
59
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
60 extern int inflate_trees_fixed __P((
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
61 uInt *, /* literal desired/actual bit depth */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
62 uInt *, /* distance desired/actual bit depth */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
63 inflate_huft **, /* literal/length tree result */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
64 inflate_huft **)); /* distance tree result */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
65
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
66 extern int inflate_trees_free __P((
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
67 inflate_huft *, /* tables to free */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
68 z_stream *)); /* for zfree function */