ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
inftrees.h
Go to the documentation of this file.
1/* inftrees.h -- header to use inftrees.c
2 * Copyright (C) 1995-2005, 2010 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* WARNING: this file should *not* be used by applications. It is
7 part of the implementation of the compression library and is
8 subject to change. Applications should only use zlib.h.
9 */
10
12
13/* Structure for decoding tables. Each entry provides either the
14 information needed to do the operation requested by the code that
15 indexed that table entry, or it provides a pointer to another
16 table that indexes more bits of the code. op indicates whether
17 the entry is a pointer to another table, a literal, a length or
18 distance, an end-of-block, or an invalid code. For a table
19 pointer, the low four bits of op is the number of index bits of
20 that table. For a length or distance, the low four bits of op
21 is the number of extra bits to get after the code. bits is
22 the number of bits in this code or part of the code to drop off
23 of the bit buffer. val is the actual byte to output in the case
24 of a literal, the base length or distance, or the offset from
25 the current table to the next table. Each entry is four bytes. */
26typedef struct {
27 unsigned char op; /* operation, extra bits, table bits */
28 unsigned char bits; /* bits in this part of the code */
29 unsigned short val; /* offset in table or code value */
30} code;
31
32/* op values as set by inflate_table():
33 00000000 - literal
34 0000tttt - table link, tttt != 0 is the number of table index bits
35 0001eeee - length or distance, eeee is the number of extra bits
36 01100000 - end of block
37 01000000 - invalid code
38 */
39
40/* Maximum size of the dynamic table. The maximum number of code structures is
41 1444, which is the sum of 852 for literal/length codes and 592 for distance
42 codes. These values were found by exhaustive searches using the program
43 examples/enough.c found in the zlib distribtution. The arguments to that
44 program are the number of symbols, the initial root table size, and the
45 maximum bit length of a code. "enough 286 9 15" for literal/length codes
46 returns returns 852, and "enough 30 6 15" for distance codes returns 592.
47 The initial root table size (9 or 6) is found in the fifth argument of the
48 inflate_table() calls in inflate.c and infback.c. If the root table size is
49 changed, then these maximum sizes would be need to be recalculated and
50 updated. */
51#define ENOUGH_LENS 852
52#define ENOUGH_DISTS 592
53#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
54
55/* Type of code to build for inflate_table() */
56typedef enum {
60} codetype;
61
62int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
63 unsigned codes, code FAR * FAR *table,
64 unsigned FAR *bits, unsigned short FAR *work));
65
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
#define ZLIB_INTERNAL
Definition compress_.c:8
type
CUBE COVER and CUBE typedefs ///.
Definition exor.h:90
int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, unsigned codes, code FAR *FAR *table, unsigned FAR *bits, unsigned short FAR *work)
Definition inftrees.c:39
codetype
Definition inftrees.h:56
@ CODES
Definition inftrees.h:57
@ LENS
Definition inftrees.h:58
@ DISTS
Definition inftrees.h:59
unsigned char op
Definition inftrees.h:27
unsigned char bits
Definition inftrees.h:28
unsigned short val
Definition inftrees.h:29
#define OF(args)
Definition zconf.h:242
#define FAR
Definition zconf.h:329