jdk/src/share/native/java/util/zip/zlib-1.2.8/inflate.h
author sherman
Wed, 04 Jun 2014 11:25:13 -0700
changeset 24710 c019dc4104b2
permissions -rw-r--r--
8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files Summary: to upgrade zlib version from 1.2.5 to 1.2.8 Reviewed-by: alanb, iris
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24710
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
     1
/*
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
     3
 *
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
     6
 * published by the Free Software Foundation.  Oracle designates this
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
     8
 * by Oracle in the LICENSE file that accompanied this code.
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
     9
 *
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    14
 * accompanied this code).
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    15
 *
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    19
 *
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    22
 * questions.
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    23
 */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    24
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    25
/* inflate.h -- internal inflate state definition
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    26
 * Copyright (C) 1995-2009 Mark Adler
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    27
 * For conditions of distribution and use, see copyright notice in zlib.h
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    28
 */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    29
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    30
/* WARNING: this file should *not* be used by applications. It is
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    31
   part of the implementation of the compression library and is
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    32
   subject to change. Applications should only use zlib.h.
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    33
 */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    34
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    35
/* define NO_GZIP when compiling if you want to disable gzip header and
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    36
   trailer decoding by inflate().  NO_GZIP would be used to avoid linking in
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    37
   the crc code when it is not needed.  For shared libraries, gzip decoding
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    38
   should be left enabled. */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    39
#ifndef NO_GZIP
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    40
#  define GUNZIP
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    41
#endif
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    42
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    43
/* Possible inflate modes between inflate() calls */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    44
typedef enum {
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    45
    HEAD,       /* i: waiting for magic header */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    46
    FLAGS,      /* i: waiting for method and flags (gzip) */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    47
    TIME,       /* i: waiting for modification time (gzip) */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    48
    OS,         /* i: waiting for extra flags and operating system (gzip) */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    49
    EXLEN,      /* i: waiting for extra length (gzip) */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    50
    EXTRA,      /* i: waiting for extra bytes (gzip) */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    51
    NAME,       /* i: waiting for end of file name (gzip) */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    52
    COMMENT,    /* i: waiting for end of comment (gzip) */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    53
    HCRC,       /* i: waiting for header crc (gzip) */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    54
    DICTID,     /* i: waiting for dictionary check value */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    55
    DICT,       /* waiting for inflateSetDictionary() call */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    56
        TYPE,       /* i: waiting for type bits, including last-flag bit */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    57
        TYPEDO,     /* i: same, but skip check to exit inflate on new block */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    58
        STORED,     /* i: waiting for stored size (length and complement) */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    59
        COPY_,      /* i/o: same as COPY below, but only first time in */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    60
        COPY,       /* i/o: waiting for input or output to copy stored block */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    61
        TABLE,      /* i: waiting for dynamic block table lengths */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    62
        LENLENS,    /* i: waiting for code length code lengths */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    63
        CODELENS,   /* i: waiting for length/lit and distance code lengths */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    64
            LEN_,       /* i: same as LEN below, but only first time in */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    65
            LEN,        /* i: waiting for length/lit/eob code */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    66
            LENEXT,     /* i: waiting for length extra bits */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    67
            DIST,       /* i: waiting for distance code */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    68
            DISTEXT,    /* i: waiting for distance extra bits */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    69
            MATCH,      /* o: waiting for output space to copy string */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    70
            LIT,        /* o: waiting for output space to write literal */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    71
    CHECK,      /* i: waiting for 32-bit check value */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    72
    LENGTH,     /* i: waiting for 32-bit length (gzip) */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    73
    DONE,       /* finished check, done -- remain here until reset */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    74
    BAD,        /* got a data error -- remain here until reset */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    75
    MEM,        /* got an inflate() memory error -- remain here until reset */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    76
    SYNC        /* looking for synchronization bytes to restart inflate() */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    77
} inflate_mode;
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    78
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    79
/*
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    80
    State transitions between above modes -
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    81
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    82
    (most modes can go to BAD or MEM on error -- not shown for clarity)
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    83
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    84
    Process header:
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    85
        HEAD -> (gzip) or (zlib) or (raw)
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    86
        (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    87
                  HCRC -> TYPE
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    88
        (zlib) -> DICTID or TYPE
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    89
        DICTID -> DICT -> TYPE
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    90
        (raw) -> TYPEDO
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    91
    Read deflate blocks:
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    92
            TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    93
            STORED -> COPY_ -> COPY -> TYPE
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    94
            TABLE -> LENLENS -> CODELENS -> LEN_
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    95
            LEN_ -> LEN
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    96
    Read deflate codes in fixed or dynamic block:
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    97
                LEN -> LENEXT or LIT or TYPE
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    98
                LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
    99
                LIT -> LEN
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   100
    Process trailer:
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   101
        CHECK -> LENGTH -> DONE
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   102
 */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   103
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   104
/* state maintained between inflate() calls.  Approximately 10K bytes. */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   105
struct inflate_state {
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   106
    inflate_mode mode;          /* current inflate mode */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   107
    int last;                   /* true if processing last block */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   108
    int wrap;                   /* bit 0 true for zlib, bit 1 true for gzip */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   109
    int havedict;               /* true if dictionary provided */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   110
    int flags;                  /* gzip header method and flags (0 if zlib) */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   111
    unsigned dmax;              /* zlib header max distance (INFLATE_STRICT) */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   112
    unsigned long check;        /* protected copy of check value */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   113
    unsigned long total;        /* protected copy of output count */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   114
    gz_headerp head;            /* where to save gzip header information */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   115
        /* sliding window */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   116
    unsigned wbits;             /* log base 2 of requested window size */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   117
    unsigned wsize;             /* window size or zero if not using window */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   118
    unsigned whave;             /* valid bytes in the window */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   119
    unsigned wnext;             /* window write index */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   120
    unsigned char FAR *window;  /* allocated sliding window, if needed */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   121
        /* bit accumulator */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   122
    unsigned long hold;         /* input bit accumulator */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   123
    unsigned bits;              /* number of bits in "in" */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   124
        /* for string and stored block copying */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   125
    unsigned length;            /* literal or length of data to copy */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   126
    unsigned offset;            /* distance back to copy string from */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   127
        /* for table and code decoding */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   128
    unsigned extra;             /* extra bits needed */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   129
        /* fixed and dynamic code tables */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   130
    code const FAR *lencode;    /* starting table for length/literal codes */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   131
    code const FAR *distcode;   /* starting table for distance codes */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   132
    unsigned lenbits;           /* index bits for lencode */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   133
    unsigned distbits;          /* index bits for distcode */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   134
        /* dynamic table building */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   135
    unsigned ncode;             /* number of code length code lengths */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   136
    unsigned nlen;              /* number of length code lengths */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   137
    unsigned ndist;             /* number of distance code lengths */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   138
    unsigned have;              /* number of code lengths in lens[] */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   139
    code FAR *next;             /* next available space in codes[] */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   140
    unsigned short lens[320];   /* temporary storage for code lengths */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   141
    unsigned short work[288];   /* work area for code table building */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   142
    code codes[ENOUGH];         /* space for code tables */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   143
    int sane;                   /* if false, allow invalid distance too far */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   144
    int back;                   /* bits back of last unprocessed length/lit */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   145
    unsigned was;               /* initial length of match */
c019dc4104b2 8044725: Bug in zlib 1.2.5 prevents inflation of some gzipped files
sherman
parents:
diff changeset
   146
};