lemon-project-template-glpk

diff deps/glpk/src/zlib/inftrees.h @ 9:33de93886c88

Import GLPK 4.47
author Alpar Juttner <alpar@cs.elte.hu>
date Sun, 06 Nov 2011 20:59:10 +0100
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/deps/glpk/src/zlib/inftrees.h	Sun Nov 06 20:59:10 2011 +0100
     1.3 @@ -0,0 +1,62 @@
     1.4 +/* inftrees.h -- header to use inftrees.c
     1.5 + * Copyright (C) 1995-2005, 2010 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 the dynamic table.  The maximum number of code structures is
    1.42 +   1444, which is the sum of 852 for literal/length codes and 592 for distance
    1.43 +   codes.  These values were found by exhaustive searches using the program
    1.44 +   examples/enough.c found in the zlib distribtution.  The arguments to that
    1.45 +   program are the number of symbols, the initial root table size, and the
    1.46 +   maximum bit length of a code.  "enough 286 9 15" for literal/length codes
    1.47 +   returns returns 852, and "enough 30 6 15" for distance codes returns 592.
    1.48 +   The initial root table size (9 or 6) is found in the fifth argument of the
    1.49 +   inflate_table() calls in inflate.c and infback.c.  If the root table size is
    1.50 +   changed, then these maximum sizes would be need to be recalculated and
    1.51 +   updated. */
    1.52 +#define ENOUGH_LENS 852
    1.53 +#define ENOUGH_DISTS 592
    1.54 +#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
    1.55 +
    1.56 +/* Type of code to build for inflate_table() */
    1.57 +typedef enum {
    1.58 +    CODES,
    1.59 +    LENS,
    1.60 +    DISTS
    1.61 +} codetype;
    1.62 +
    1.63 +int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
    1.64 +                             unsigned codes, code FAR * FAR *table,
    1.65 +                             unsigned FAR *bits, unsigned short FAR *work));