vrshoot

diff libs/zlib/inftrees.h @ 0:b2f14e535253

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 01 Feb 2014 19:58:19 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libs/zlib/inftrees.h	Sat Feb 01 19:58:19 2014 +0200
     1.3 @@ -0,0 +1,55 @@
     1.4 +/* inftrees.h -- header to use inftrees.c
     1.5 + * Copyright (C) 1995-2005 Mark Adler
     1.6 + * For conditions of distribution and use, see copyright notice in zlib.h
     1.7 + */
     1.8 +
     1.9 +/* WARNING: this file should *not* be used by applications. It is
    1.10 +   part of the implementation of the compression library and is
    1.11 +   subject to change. Applications should only use zlib.h.
    1.12 + */
    1.13 +
    1.14 +/* Structure for decoding tables.  Each entry provides either the
    1.15 +   information needed to do the operation requested by the code that
    1.16 +   indexed that table entry, or it provides a pointer to another
    1.17 +   table that indexes more bits of the code.  op indicates whether
    1.18 +   the entry is a pointer to another table, a literal, a length or
    1.19 +   distance, an end-of-block, or an invalid code.  For a table
    1.20 +   pointer, the low four bits of op is the number of index bits of
    1.21 +   that table.  For a length or distance, the low four bits of op
    1.22 +   is the number of extra bits to get after the code.  bits is
    1.23 +   the number of bits in this code or part of the code to drop off
    1.24 +   of the bit buffer.  val is the actual byte to output in the case
    1.25 +   of a literal, the base length or distance, or the offset from
    1.26 +   the current table to the next table.  Each entry is four bytes. */
    1.27 +typedef struct {
    1.28 +    unsigned char op;           /* operation, extra bits, table bits */
    1.29 +    unsigned char bits;         /* bits in this part of the code */
    1.30 +    unsigned short val;         /* offset in table or code value */
    1.31 +} code;
    1.32 +
    1.33 +/* op values as set by inflate_table():
    1.34 +    00000000 - literal
    1.35 +    0000tttt - table link, tttt != 0 is the number of table index bits
    1.36 +    0001eeee - length or distance, eeee is the number of extra bits
    1.37 +    01100000 - end of block
    1.38 +    01000000 - invalid code
    1.39 + */
    1.40 +
    1.41 +/* Maximum size of dynamic tree.  The maximum found in a long but non-
    1.42 +   exhaustive search was 1444 code structures (852 for length/literals
    1.43 +   and 592 for distances, the latter actually the result of an
    1.44 +   exhaustive search).  The true maximum is not known, but the value
    1.45 +   below is more than safe. */
    1.46 +#define ENOUGH 2048
    1.47 +#define MAXD 592
    1.48 +
    1.49 +/* Type of code to build for inftable() */
    1.50 +typedef enum {
    1.51 +    CODES,
    1.52 +    LENS,
    1.53 +    DISTS
    1.54 +} codetype;
    1.55 +
    1.56 +extern int inflate_table OF((codetype type, unsigned short FAR *lens,
    1.57 +                             unsigned codes, code FAR * FAR *table,
    1.58 +                             unsigned FAR *bits, unsigned short FAR *work));