< prev index next >

src/java.base/share/native/libzip/zlib/inffast.c

Print this page

 54 
 55    On return, state->mode is one of:
 56 
 57         LEN -- ran out of enough output space or enough available input
 58         TYPE -- reached end of block code, inflate() to interpret next block
 59         BAD -- error in block data
 60 
 61    Notes:
 62 
 63     - The maximum input bits used by a length/distance pair is 15 bits for the
 64       length code, 5 bits for the length extra, 15 bits for the distance code,
 65       and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
 66       Therefore if strm->avail_in >= 6, then there is enough input to avoid
 67       checking for available input while decoding.
 68 
 69     - The maximum bytes that a single length/distance pair can output is 258
 70       bytes, which is the maximum length that can be coded.  inflate_fast()
 71       requires strm->avail_out >= 258 for each loop to avoid checking for
 72       output space.
 73  */
 74 void ZLIB_INTERNAL inflate_fast(strm, start)
 75 z_streamp strm;
 76 unsigned start;         /* inflate()'s starting value for strm->avail_out */
 77 {
 78     struct inflate_state FAR *state;
 79     z_const unsigned char FAR *in;      /* local strm->next_in */
 80     z_const unsigned char FAR *last;    /* have enough input while in < last */
 81     unsigned char FAR *out;     /* local strm->next_out */
 82     unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
 83     unsigned char FAR *end;     /* while out < end, enough space available */
 84 #ifdef INFLATE_STRICT
 85     unsigned dmax;              /* maximum distance from zlib header */
 86 #endif
 87     unsigned wsize;             /* window size or zero if not using window */
 88     unsigned whave;             /* valid bytes in the window */
 89     unsigned wnext;             /* window write index */
 90     unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
 91     unsigned long hold;         /* local strm->hold */
 92     unsigned bits;              /* local strm->bits */
 93     code const FAR *lcode;      /* local strm->lencode */
 94     code const FAR *dcode;      /* local strm->distcode */
 95     unsigned lmask;             /* mask for first level of length codes */
 96     unsigned dmask;             /* mask for first level of distance codes */
 97     code const *here;           /* retrieved table entry */

 54 
 55    On return, state->mode is one of:
 56 
 57         LEN -- ran out of enough output space or enough available input
 58         TYPE -- reached end of block code, inflate() to interpret next block
 59         BAD -- error in block data
 60 
 61    Notes:
 62 
 63     - The maximum input bits used by a length/distance pair is 15 bits for the
 64       length code, 5 bits for the length extra, 15 bits for the distance code,
 65       and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
 66       Therefore if strm->avail_in >= 6, then there is enough input to avoid
 67       checking for available input while decoding.
 68 
 69     - The maximum bytes that a single length/distance pair can output is 258
 70       bytes, which is the maximum length that can be coded.  inflate_fast()
 71       requires strm->avail_out >= 258 for each loop to avoid checking for
 72       output space.
 73  */
 74 void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {



 75     struct inflate_state FAR *state;
 76     z_const unsigned char FAR *in;      /* local strm->next_in */
 77     z_const unsigned char FAR *last;    /* have enough input while in < last */
 78     unsigned char FAR *out;     /* local strm->next_out */
 79     unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
 80     unsigned char FAR *end;     /* while out < end, enough space available */
 81 #ifdef INFLATE_STRICT
 82     unsigned dmax;              /* maximum distance from zlib header */
 83 #endif
 84     unsigned wsize;             /* window size or zero if not using window */
 85     unsigned whave;             /* valid bytes in the window */
 86     unsigned wnext;             /* window write index */
 87     unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
 88     unsigned long hold;         /* local strm->hold */
 89     unsigned bits;              /* local strm->bits */
 90     code const FAR *lcode;      /* local strm->lencode */
 91     code const FAR *dcode;      /* local strm->distcode */
 92     unsigned lmask;             /* mask for first level of length codes */
 93     unsigned dmask;             /* mask for first level of distance codes */
 94     code const *here;           /* retrieved table entry */
< prev index next >