Lines Matching refs:state
19 local void fixedtables OF((struct inflate_state FAR *state));
35 struct inflate_state FAR *state; in inflateBackInit_() local
58 state = (struct inflate_state FAR *)ZALLOC(strm, 1, in inflateBackInit_()
60 if (state == Z_NULL) return Z_MEM_ERROR; in inflateBackInit_()
62 strm->state = (struct internal_state FAR *)state; in inflateBackInit_()
63 state->dmax = 32768U; in inflateBackInit_()
64 state->wbits = windowBits; in inflateBackInit_()
65 state->wsize = 1U << windowBits; in inflateBackInit_()
66 state->window = window; in inflateBackInit_()
67 state->wnext = 0; in inflateBackInit_()
68 state->whave = 0; in inflateBackInit_()
83 struct inflate_state FAR *state) in fixedtables() argument
97 while (sym < 144) state->lens[sym++] = 8; in fixedtables()
98 while (sym < 256) state->lens[sym++] = 9; in fixedtables()
99 while (sym < 280) state->lens[sym++] = 7; in fixedtables()
100 while (sym < 288) state->lens[sym++] = 8; in fixedtables()
104 inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); in fixedtables()
108 while (sym < 32) state->lens[sym++] = 5; in fixedtables()
111 inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); in fixedtables()
119 state->lencode = lenfix; in fixedtables()
120 state->lenbits = 9; in fixedtables()
121 state->distcode = distfix; in fixedtables()
122 state->distbits = 5; in fixedtables()
134 hold = state->hold; \
135 bits = state->bits; \
145 state->hold = hold; \
146 state->bits = bits; \
213 put = state->window; \
214 left = state->wsize; \
215 state->whave = left; \
257 struct inflate_state FAR *state; in inflateBack() local
273 if (strm == Z_NULL || strm->state == Z_NULL) in inflateBack()
275 state = (struct inflate_state FAR *)strm->state; in inflateBack()
279 state->mode = TYPE; in inflateBack()
280 state->last = 0; in inflateBack()
281 state->whave = 0; in inflateBack()
286 put = state->window; in inflateBack()
287 left = state->wsize; in inflateBack()
291 switch (state->mode) { in inflateBack()
294 if (state->last) { in inflateBack()
296 state->mode = DONE; in inflateBack()
300 state->last = BITS(1); in inflateBack()
305 state->last ? " (last)" : "")); in inflateBack()
306 state->mode = STORED; in inflateBack()
309 fixedtables(state); in inflateBack()
311 state->last ? " (last)" : "")); in inflateBack()
312 state->mode = LEN; /* decode codes */ in inflateBack()
316 state->last ? " (last)" : "")); in inflateBack()
317 state->mode = TABLE; in inflateBack()
321 state->mode = BAD; in inflateBack()
332 state->mode = BAD; in inflateBack()
335 state->length = (unsigned)hold & 0xffff; in inflateBack()
337 state->length)); in inflateBack()
341 while (state->length != 0) { in inflateBack()
342 copy = state->length; in inflateBack()
352 state->length -= copy; in inflateBack()
355 state->mode = TYPE; in inflateBack()
361 state->nlen = BITS(5) + 257; in inflateBack()
363 state->ndist = BITS(5) + 1; in inflateBack()
365 state->ncode = BITS(4) + 4; in inflateBack()
368 if (state->nlen > 286 || state->ndist > 30) { in inflateBack()
370 state->mode = BAD; in inflateBack()
377 state->have = 0; in inflateBack()
378 while (state->have < state->ncode) { in inflateBack()
380 state->lens[order[state->have++]] = (unsigned short)BITS(3); in inflateBack()
383 while (state->have < 19) in inflateBack()
384 state->lens[order[state->have++]] = 0; in inflateBack()
385 state->next = state->codes; in inflateBack()
386 state->lencode = (code const FAR *)(state->next); in inflateBack()
387 state->lenbits = 7; in inflateBack()
388 ret = inflate_table(CODES, state->lens, 19, &(state->next), in inflateBack()
389 &(state->lenbits), state->work); in inflateBack()
392 state->mode = BAD; in inflateBack()
398 state->have = 0; in inflateBack()
399 while (state->have < state->nlen + state->ndist) { in inflateBack()
401 here = state->lencode[BITS(state->lenbits)]; in inflateBack()
407 state->lens[state->have++] = here.val; in inflateBack()
413 if (state->have == 0) { in inflateBack()
415 state->mode = BAD; in inflateBack()
418 len = (unsigned)(state->lens[state->have - 1]); in inflateBack()
436 if (state->have + copy > state->nlen + state->ndist) { in inflateBack()
438 state->mode = BAD; in inflateBack()
442 state->lens[state->have++] = (unsigned short)len; in inflateBack()
447 if (state->mode == BAD) break; in inflateBack()
450 if (state->lens[256] == 0) { in inflateBack()
452 state->mode = BAD; in inflateBack()
459 state->next = state->codes; in inflateBack()
460 state->lencode = (code const FAR *)(state->next); in inflateBack()
461 state->lenbits = 9; in inflateBack()
462 ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), in inflateBack()
463 &(state->lenbits), state->work); in inflateBack()
466 state->mode = BAD; in inflateBack()
469 state->distcode = (code const FAR *)(state->next); in inflateBack()
470 state->distbits = 6; in inflateBack()
471 ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, in inflateBack()
472 &(state->next), &(state->distbits), state->work); in inflateBack()
475 state->mode = BAD; in inflateBack()
479 state->mode = LEN; in inflateBack()
485 if (state->whave < state->wsize) in inflateBack()
486 state->whave = state->wsize - left; in inflateBack()
487 inflate_fast(strm, state->wsize); in inflateBack()
494 here = state->lencode[BITS(state->lenbits)]; in inflateBack()
501 here = state->lencode[last.val + in inflateBack()
509 state->length = (unsigned)here.val; in inflateBack()
517 *put++ = (unsigned char)(state->length); in inflateBack()
519 state->mode = LEN; in inflateBack()
526 state->mode = TYPE; in inflateBack()
533 state->mode = BAD; in inflateBack()
538 state->extra = (unsigned)(here.op) & 15; in inflateBack()
539 if (state->extra != 0) { in inflateBack()
540 NEEDBITS(state->extra); in inflateBack()
541 state->length += BITS(state->extra); in inflateBack()
542 DROPBITS(state->extra); in inflateBack()
544 Tracevv((stderr, "inflate: length %u\n", state->length)); in inflateBack()
548 here = state->distcode[BITS(state->distbits)]; in inflateBack()
555 here = state->distcode[last.val + in inflateBack()
565 state->mode = BAD; in inflateBack()
568 state->offset = (unsigned)here.val; in inflateBack()
571 state->extra = (unsigned)(here.op) & 15; in inflateBack()
572 if (state->extra != 0) { in inflateBack()
573 NEEDBITS(state->extra); in inflateBack()
574 state->offset += BITS(state->extra); in inflateBack()
575 DROPBITS(state->extra); in inflateBack()
577 if (state->offset > state->wsize - (state->whave < state->wsize ? in inflateBack()
580 state->mode = BAD; in inflateBack()
583 Tracevv((stderr, "inflate: distance %u\n", state->offset)); in inflateBack()
588 copy = state->wsize - state->offset; in inflateBack()
594 from = put - state->offset; in inflateBack()
597 if (copy > state->length) copy = state->length; in inflateBack()
598 state->length -= copy; in inflateBack()
603 } while (state->length != 0); in inflateBack()
609 if (left < state->wsize) { in inflateBack()
610 if (out(out_desc, state->window, state->wsize - left)) in inflateBack()
634 if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) in inflateBackEnd()
636 ZFREE(strm, strm->state); in inflateBackEnd()
637 strm->state = Z_NULL; in inflateBackEnd()