/* inftrees.h -- header to use inftrees.c1* Copyright (C) 1995-2005 Mark Adler2* For conditions of distribution and use, see copyright notice in zlib.h3*/45/* WARNING: this file should *not* be used by applications. It is6part of the implementation of the compression library and is7subject to change. Applications should only use zlib.h.8*/910/* Structure for decoding tables. Each entry provides either the11information needed to do the operation requested by the code that12indexed that table entry, or it provides a pointer to another13table that indexes more bits of the code. op indicates whether14the entry is a pointer to another table, a literal, a length or15distance, an end-of-block, or an invalid code. For a table16pointer, the low four bits of op is the number of index bits of17that table. For a length or distance, the low four bits of op18is the number of extra bits to get after the code. bits is19the number of bits in this code or part of the code to drop off20of the bit buffer. val is the actual byte to output in the case21of a literal, the base length or distance, or the offset from22the current table to the next table. Each entry is four bytes. */23typedef struct {24unsigned char op; /* operation, extra bits, table bits */25unsigned char bits; /* bits in this part of the code */26unsigned short val; /* offset in table or code value */27} code;2829/* op values as set by inflate_table():3000000000 - literal310000tttt - table link, tttt != 0 is the number of table index bits320001eeee - length or distance, eeee is the number of extra bits3301100000 - end of block3401000000 - invalid code35*/3637/* Maximum size of dynamic tree. The maximum found in a long but non-38exhaustive search was 1444 code structures (852 for length/literals39and 592 for distances, the latter actually the result of an40exhaustive search). The true maximum is not known, but the value41below is more than safe. */42#define ENOUGH 204843#define MAXD 5924445/* Type of code to build for inftable() */46typedef enum {47CODES,48LENS,49DISTS50} codetype;5152extern int inflate_table OF((codetype type, unsigned short FAR *lens,53unsigned codes, code FAR * FAR *table,54unsigned FAR *bits, unsigned short FAR *work));555657