• Home
  • Raw
  • Download

Lines Matching full:state

26  * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
30 * - Add comments on state->bits assertion in inffast.c
95 struct inflate_state FAR *state; in inflateStateCheck() local
99 state = (struct inflate_state FAR *)strm->state; in inflateStateCheck()
100 if (state == Z_NULL || state->strm != strm || in inflateStateCheck()
101 state->mode < HEAD || state->mode > SYNC) in inflateStateCheck()
107 struct inflate_state FAR *state; in inflateResetKeep() local
110 state = (struct inflate_state FAR *)strm->state; in inflateResetKeep()
111 strm->total_in = strm->total_out = state->total = 0; in inflateResetKeep()
113 if (state->wrap) /* to support ill-conceived Java test suite */ in inflateResetKeep()
114 strm->adler = state->wrap & 1; in inflateResetKeep()
115 state->mode = HEAD; in inflateResetKeep()
116 state->last = 0; in inflateResetKeep()
117 state->havedict = 0; in inflateResetKeep()
118 state->flags = -1; in inflateResetKeep()
119 state->dmax = 32768U; in inflateResetKeep()
120 state->head = Z_NULL; in inflateResetKeep()
121 state->hold = 0; in inflateResetKeep()
122 state->bits = 0; in inflateResetKeep()
123 state->lencode = state->distcode = state->next = state->codes; in inflateResetKeep()
124 state->sane = 1; in inflateResetKeep()
125 state->back = -1; in inflateResetKeep()
131 struct inflate_state FAR *state; in inflateReset() local
134 state = (struct inflate_state FAR *)strm->state; in inflateReset()
135 state->wsize = 0; in inflateReset()
136 state->whave = 0; in inflateReset()
137 state->wnext = 0; in inflateReset()
143 struct inflate_state FAR *state; in inflateReset2() local
145 /* get the state */ in inflateReset2()
147 state = (struct inflate_state FAR *)strm->state; in inflateReset2()
167 if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) { in inflateReset2()
168 ZFREE(strm, state->window); in inflateReset2()
169 state->window = Z_NULL; in inflateReset2()
172 /* update state and reset the rest of it */ in inflateReset2()
173 state->wrap = wrap; in inflateReset2()
174 state->wbits = (unsigned)windowBits; in inflateReset2()
181 struct inflate_state FAR *state; in inflateInit2_() local
202 state = (struct inflate_state FAR *) in inflateInit2_()
204 if (state == Z_NULL) return Z_MEM_ERROR; in inflateInit2_()
206 strm->state = (struct internal_state FAR *)state; in inflateInit2_()
207 state->strm = strm; in inflateInit2_()
208 state->window = Z_NULL; in inflateInit2_()
209 state->mode = HEAD; /* to pass state test in inflateReset2() */ in inflateInit2_()
210 state->check = 1L; /* 1L is the result of adler32() zero length data */ in inflateInit2_()
213 ZFREE(strm, state); in inflateInit2_()
214 strm->state = Z_NULL; in inflateInit2_()
225 struct inflate_state FAR *state; in inflatePrime() local
230 state = (struct inflate_state FAR *)strm->state; in inflatePrime()
232 state->hold = 0; in inflatePrime()
233 state->bits = 0; in inflatePrime()
236 if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR; in inflatePrime()
238 state->hold += (unsigned)value << state->bits; in inflatePrime()
239 state->bits += (uInt)bits; in inflatePrime()
244 Return state with length and distance decoding tables and index sizes set to
253 local void fixedtables(struct inflate_state FAR *state) { in fixedtables() argument
266 while (sym < 144) state->lens[sym++] = 8; in fixedtables()
267 while (sym < 256) state->lens[sym++] = 9; in fixedtables()
268 while (sym < 280) state->lens[sym++] = 7; in fixedtables()
269 while (sym < 288) state->lens[sym++] = 8; in fixedtables()
273 inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); in fixedtables()
277 while (sym < 32) state->lens[sym++] = 5; in fixedtables()
280 inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); in fixedtables()
288 state->lencode = lenfix; in fixedtables()
289 state->lenbits = 9; in fixedtables()
290 state->distcode = distfix; in fixedtables()
291 state->distbits = 5; in fixedtables()
318 struct inflate_state state; in makefixed() local
320 fixedtables(&state); in makefixed()
335 printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op, in makefixed()
336 state.lencode[low].bits, state.lencode[low].val); in makefixed()
346 printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits, in makefixed()
347 state.distcode[low].val); in makefixed()
370 struct inflate_state FAR *state; in updatewindow() local
373 state = (struct inflate_state FAR *)strm->state; in updatewindow()
376 if (state->window == Z_NULL) { in updatewindow()
377 state->window = (unsigned char FAR *) in updatewindow()
378 ZALLOC(strm, 1U << state->wbits, in updatewindow()
380 if (state->window == Z_NULL) return 1; in updatewindow()
384 if (state->wsize == 0) { in updatewindow()
385 state->wsize = 1U << state->wbits; in updatewindow()
386 state->wnext = 0; in updatewindow()
387 state->whave = 0; in updatewindow()
390 /* copy state->wsize or less output bytes into the circular window */ in updatewindow()
391 if (copy >= state->wsize) { in updatewindow()
392 zmemcpy(state->window, end - state->wsize, state->wsize); in updatewindow()
393 state->wnext = 0; in updatewindow()
394 state->whave = state->wsize; in updatewindow()
397 dist = state->wsize - state->wnext; in updatewindow()
399 zmemcpy(state->window + state->wnext, end - copy, dist); in updatewindow()
402 zmemcpy(state->window, end - copy, copy); in updatewindow()
403 state->wnext = copy; in updatewindow()
404 state->whave = state->wsize; in updatewindow()
407 state->wnext += dist; in updatewindow()
408 if (state->wnext == state->wsize) state->wnext = 0; in updatewindow()
409 if (state->whave < state->wsize) state->whave += dist; in updatewindow()
420 (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
444 /* Load registers with state in inflate() for speed */
451 hold = state->hold; \
452 bits = state->bits; \
455 /* Restore state from registers in inflate() */
462 state->hold = hold; \
463 state->bits = bits; \
510 inflate() uses a state machine to process as much input data and generate as
511 much output data as possible before returning. The state machine is
514 for (;;) switch (state) {
520 state = STATEm;
527 next state. The NEEDBITS() macro is usually the way the state evaluates
550 state information is maintained to continue the loop where it left off
552 would all have to actually be part of the saved state in case NEEDBITS()
561 state = STATEx;
564 As shown above, if the next state is also the next case, then the break
567 A state may also return if there is not enough output space available to
568 complete that state. Those states are copying stored data, writing a
592 struct inflate_state FAR *state; in inflate() local
615 state = (struct inflate_state FAR *)strm->state; in inflate()
616 if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ in inflate()
622 switch (state->mode) { in inflate()
624 if (state->wrap == 0) { in inflate()
625 state->mode = TYPEDO; in inflate()
630 if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ in inflate()
631 if (state->wbits == 0) in inflate()
632 state->wbits = 15; in inflate()
633 state->check = crc32(0L, Z_NULL, 0); in inflate()
634 CRC2(state->check, hold); in inflate()
636 state->mode = FLAGS; in inflate()
639 if (state->head != Z_NULL) in inflate()
640 state->head->done = -1; in inflate()
641 if (!(state->wrap & 1) || /* check if zlib header allowed */ in inflate()
647 state->mode = BAD; in inflate()
652 state->mode = BAD; in inflate()
657 if (state->wbits == 0) in inflate()
658 state->wbits = len; in inflate()
659 if (len > 15 || len > state->wbits) { in inflate()
661 state->mode = BAD; in inflate()
664 state->dmax = 1U << len; in inflate()
665 state->flags = 0; /* indicate zlib header */ in inflate()
667 strm->adler = state->check = adler32(0L, Z_NULL, 0); in inflate()
668 state->mode = hold & 0x200 ? DICTID : TYPE; in inflate()
674 state->flags = (int)(hold); in inflate()
675 if ((state->flags & 0xff) != Z_DEFLATED) { in inflate()
677 state->mode = BAD; in inflate()
680 if (state->flags & 0xe000) { in inflate()
682 state->mode = BAD; in inflate()
685 if (state->head != Z_NULL) in inflate()
686 state->head->text = (int)((hold >> 8) & 1); in inflate()
687 if ((state->flags & 0x0200) && (state->wrap & 4)) in inflate()
688 CRC2(state->check, hold); in inflate()
690 state->mode = TIME; in inflate()
694 if (state->head != Z_NULL) in inflate()
695 state->head->time = hold; in inflate()
696 if ((state->flags & 0x0200) && (state->wrap & 4)) in inflate()
697 CRC4(state->check, hold); in inflate()
699 state->mode = OS; in inflate()
703 if (state->head != Z_NULL) { in inflate()
704 state->head->xflags = (int)(hold & 0xff); in inflate()
705 state->head->os = (int)(hold >> 8); in inflate()
707 if ((state->flags & 0x0200) && (state->wrap & 4)) in inflate()
708 CRC2(state->check, hold); in inflate()
710 state->mode = EXLEN; in inflate()
713 if (state->flags & 0x0400) { in inflate()
715 state->length = (unsigned)(hold); in inflate()
716 if (state->head != Z_NULL) in inflate()
717 state->head->extra_len = (unsigned)hold; in inflate()
718 if ((state->flags & 0x0200) && (state->wrap & 4)) in inflate()
719 CRC2(state->check, hold); in inflate()
722 else if (state->head != Z_NULL) in inflate()
723 state->head->extra = Z_NULL; in inflate()
724 state->mode = EXTRA; in inflate()
727 if (state->flags & 0x0400) { in inflate()
728 copy = state->length; in inflate()
731 if (state->head != Z_NULL && in inflate()
732 state->head->extra != Z_NULL && in inflate()
733 (len = state->head->extra_len - state->length) < in inflate()
734 state->head->extra_max) { in inflate()
735 zmemcpy(state->head->extra + len, next, in inflate()
736 len + copy > state->head->extra_max ? in inflate()
737 state->head->extra_max - len : copy); in inflate()
739 if ((state->flags & 0x0200) && (state->wrap & 4)) in inflate()
740 state->check = crc32(state->check, next, copy); in inflate()
743 state->length -= copy; in inflate()
745 if (state->length) goto inf_leave; in inflate()
747 state->length = 0; in inflate()
748 state->mode = NAME; in inflate()
751 if (state->flags & 0x0800) { in inflate()
756 if (state->head != Z_NULL && in inflate()
757 state->head->name != Z_NULL && in inflate()
758 state->length < state->head->name_max) in inflate()
759 state->head->name[state->length++] = (Bytef)len; in inflate()
761 if ((state->flags & 0x0200) && (state->wrap & 4)) in inflate()
762 state->check = crc32(state->check, next, copy); in inflate()
767 else if (state->head != Z_NULL) in inflate()
768 state->head->name = Z_NULL; in inflate()
769 state->length = 0; in inflate()
770 state->mode = COMMENT; in inflate()
773 if (state->flags & 0x1000) { in inflate()
778 if (state->head != Z_NULL && in inflate()
779 state->head->comment != Z_NULL && in inflate()
780 state->length < state->head->comm_max) in inflate()
781 state->head->comment[state->length++] = (Bytef)len; in inflate()
783 if ((state->flags & 0x0200) && (state->wrap & 4)) in inflate()
784 state->check = crc32(state->check, next, copy); in inflate()
789 else if (state->head != Z_NULL) in inflate()
790 state->head->comment = Z_NULL; in inflate()
791 state->mode = HCRC; in inflate()
794 if (state->flags & 0x0200) { in inflate()
796 if ((state->wrap & 4) && hold != (state->check & 0xffff)) { in inflate()
798 state->mode = BAD; in inflate()
803 if (state->head != Z_NULL) { in inflate()
804 state->head->hcrc = (int)((state->flags >> 9) & 1); in inflate()
805 state->head->done = 1; in inflate()
807 strm->adler = state->check = crc32(0L, Z_NULL, 0); in inflate()
808 state->mode = TYPE; in inflate()
813 strm->adler = state->check = ZSWAP32(hold); in inflate()
815 state->mode = DICT; in inflate()
818 if (state->havedict == 0) { in inflate()
822 strm->adler = state->check = adler32(0L, Z_NULL, 0); in inflate()
823 state->mode = TYPE; in inflate()
829 if (state->last) { in inflate()
831 state->mode = CHECK; in inflate()
835 state->last = BITS(1); in inflate()
840 state->last ? " (last)" : "")); in inflate()
841 state->mode = STORED; in inflate()
844 fixedtables(state); in inflate()
846 state->last ? " (last)" : "")); in inflate()
847 state->mode = LEN_; /* decode codes */ in inflate()
855 state->last ? " (last)" : "")); in inflate()
856 state->mode = TABLE; in inflate()
860 state->mode = BAD; in inflate()
869 state->mode = BAD; in inflate()
872 state->length = (unsigned)hold & 0xffff; in inflate()
874 state->length)); in inflate()
876 state->mode = COPY_; in inflate()
880 state->mode = COPY; in inflate()
883 copy = state->length; in inflate()
893 state->length -= copy; in inflate()
897 state->mode = TYPE; in inflate()
901 state->nlen = BITS(5) + 257; in inflate()
903 state->ndist = BITS(5) + 1; in inflate()
905 state->ncode = BITS(4) + 4; in inflate()
908 if (state->nlen > 286 || state->ndist > 30) { in inflate()
910 state->mode = BAD; in inflate()
915 state->have = 0; in inflate()
916 state->mode = LENLENS; in inflate()
919 while (state->have < state->ncode) { in inflate()
921 state->lens[order[state->have++]] = (unsigned short)BITS(3); in inflate()
924 while (state->have < 19) in inflate()
925 state->lens[order[state->have++]] = 0; in inflate()
926 state->next = state->codes; in inflate()
927 state->lencode = (const code FAR *)(state->next); in inflate()
928 state->lenbits = 7; in inflate()
929 ret = inflate_table(CODES, state->lens, 19, &(state->next), in inflate()
930 &(state->lenbits), state->work); in inflate()
933 state->mode = BAD; in inflate()
937 state->have = 0; in inflate()
938 state->mode = CODELENS; in inflate()
941 while (state->have < state->nlen + state->ndist) { in inflate()
943 here = state->lencode[BITS(state->lenbits)]; in inflate()
949 state->lens[state->have++] = here.val; in inflate()
955 if (state->have == 0) { in inflate()
957 state->mode = BAD; in inflate()
960 len = state->lens[state->have - 1]; in inflate()
978 if (state->have + copy > state->nlen + state->ndist) { in inflate()
980 state->mode = BAD; in inflate()
984 state->lens[state->have++] = (unsigned short)len; in inflate()
989 if (state->mode == BAD) break; in inflate()
992 if (state->lens[256] == 0) { in inflate()
994 state->mode = BAD; in inflate()
1001 state->next = state->codes; in inflate()
1002 state->lencode = (const code FAR *)(state->next); in inflate()
1003 state->lenbits = 10; in inflate()
1004 ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), in inflate()
1005 &(state->lenbits), state->work); in inflate()
1008 state->mode = BAD; in inflate()
1011 state->distcode = (const code FAR *)(state->next); in inflate()
1012 state->distbits = 9; in inflate()
1013 ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, in inflate()
1014 &(state->next), &(state->distbits), state->work); in inflate()
1017 state->mode = BAD; in inflate()
1021 state->mode = LEN_; in inflate()
1025 state->mode = LEN; in inflate()
1033 if (state->mode == TYPE) in inflate()
1034 state->back = -1; in inflate()
1037 state->back = 0; in inflate()
1039 here = state->lencode[BITS(state->lenbits)]; in inflate()
1046 here = state->lencode[last.val + in inflate()
1052 state->back += last.bits; in inflate()
1055 state->back += here.bits; in inflate()
1056 state->length = (unsigned)here.val; in inflate()
1061 state->mode = LIT; in inflate()
1066 state->back = -1; in inflate()
1067 state->mode = TYPE; in inflate()
1072 state->mode = BAD; in inflate()
1075 state->extra = (unsigned)(here.op) & 15; in inflate()
1076 state->mode = LENEXT; in inflate()
1079 if (state->extra) { in inflate()
1080 NEEDBITS(state->extra); in inflate()
1081 state->length += BITS(state->extra); in inflate()
1082 DROPBITS(state->extra); in inflate()
1083 state->back += state->extra; in inflate()
1085 Tracevv((stderr, "inflate: length %u\n", state->length)); in inflate()
1086 state->was = state->length; in inflate()
1087 state->mode = DIST; in inflate()
1091 here = state->distcode[BITS(state->distbits)]; in inflate()
1098 here = state->distcode[last.val + in inflate()
1104 state->back += last.bits; in inflate()
1107 state->back += here.bits; in inflate()
1110 state->mode = BAD; in inflate()
1113 state->offset = (unsigned)here.val; in inflate()
1114 state->extra = (unsigned)(here.op) & 15; in inflate()
1115 state->mode = DISTEXT; in inflate()
1118 if (state->extra) { in inflate()
1119 NEEDBITS(state->extra); in inflate()
1120 state->offset += BITS(state->extra); in inflate()
1121 DROPBITS(state->extra); in inflate()
1122 state->back += state->extra; in inflate()
1125 if (state->offset > state->dmax) { in inflate()
1127 state->mode = BAD; in inflate()
1131 Tracevv((stderr, "inflate: distance %u\n", state->offset)); in inflate()
1132 state->mode = MATCH; in inflate()
1137 if (state->offset > copy) { /* copy from window */ in inflate()
1138 copy = state->offset - copy; in inflate()
1139 if (copy > state->whave) { in inflate()
1140 if (state->sane) { in inflate()
1142 state->mode = BAD; in inflate()
1147 copy -= state->whave; in inflate()
1148 if (copy > state->length) copy = state->length; in inflate()
1151 state->length -= copy; in inflate()
1155 if (state->length == 0) state->mode = LEN; in inflate()
1159 if (copy > state->wnext) { in inflate()
1160 copy -= state->wnext; in inflate()
1161 from = state->window + (state->wsize - copy); in inflate()
1164 from = state->window + (state->wnext - copy); in inflate()
1165 if (copy > state->length) copy = state->length; in inflate()
1168 from = put - state->offset; in inflate()
1169 copy = state->length; in inflate()
1173 state->length -= copy; in inflate()
1177 if (state->length == 0) state->mode = LEN; in inflate()
1181 *put++ = (unsigned char)(state->length); in inflate()
1183 state->mode = LEN; in inflate()
1186 if (state->wrap) { in inflate()
1190 state->total += out; in inflate()
1191 if ((state->wrap & 4) && out) in inflate()
1192 strm->adler = state->check = in inflate()
1193 UPDATE_CHECK(state->check, put - out, out); in inflate()
1195 if ((state->wrap & 4) && ( in inflate()
1197 state->flags ? hold : in inflate()
1199 ZSWAP32(hold)) != state->check) { in inflate()
1201 state->mode = BAD; in inflate()
1208 state->mode = LENGTH; in inflate()
1211 if (state->wrap && state->flags) { in inflate()
1213 if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) { in inflate()
1215 state->mode = BAD; in inflate()
1222 state->mode = DONE; in inflate()
1241 error. Call updatewindow() to create and/or update the window state. in inflate()
1246 if (state->wsize || (out != strm->avail_out && state->mode < BAD && in inflate()
1247 (state->mode < CHECK || flush != Z_FINISH))) in inflate()
1249 state->mode = MEM; in inflate()
1256 state->total += out; in inflate()
1257 if ((state->wrap & 4) && out) in inflate()
1258 strm->adler = state->check = in inflate()
1259 UPDATE_CHECK(state->check, strm->next_out - out, out); in inflate()
1260 strm->data_type = (int)state->bits + (state->last ? 64 : 0) + in inflate()
1261 (state->mode == TYPE ? 128 : 0) + in inflate()
1262 (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0); in inflate()
1269 struct inflate_state FAR *state; in inflateEnd() local
1272 state = (struct inflate_state FAR *)strm->state; in inflateEnd()
1273 if (state->window != Z_NULL) ZFREE(strm, state->window); in inflateEnd()
1274 ZFREE(strm, strm->state); in inflateEnd()
1275 strm->state = Z_NULL; in inflateEnd()
1282 struct inflate_state FAR *state; in inflateGetDictionary() local
1284 /* check state */ in inflateGetDictionary()
1286 state = (struct inflate_state FAR *)strm->state; in inflateGetDictionary()
1289 if (state->whave && dictionary != Z_NULL) { in inflateGetDictionary()
1290 zmemcpy(dictionary, state->window + state->wnext, in inflateGetDictionary()
1291 state->whave - state->wnext); in inflateGetDictionary()
1292 zmemcpy(dictionary + state->whave - state->wnext, in inflateGetDictionary()
1293 state->window, state->wnext); in inflateGetDictionary()
1296 *dictLength = state->whave; in inflateGetDictionary()
1302 struct inflate_state FAR *state; in inflateSetDictionary() local
1306 /* check state */ in inflateSetDictionary()
1308 state = (struct inflate_state FAR *)strm->state; in inflateSetDictionary()
1309 if (state->wrap != 0 && state->mode != DICT) in inflateSetDictionary()
1313 if (state->mode == DICT) { in inflateSetDictionary()
1316 if (dictid != state->check) in inflateSetDictionary()
1324 state->mode = MEM; in inflateSetDictionary()
1327 state->havedict = 1; in inflateSetDictionary()
1333 struct inflate_state FAR *state; in inflateGetHeader() local
1335 /* check state */ in inflateGetHeader()
1337 state = (struct inflate_state FAR *)strm->state; in inflateGetHeader()
1338 if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; in inflateGetHeader()
1341 state->head = head; in inflateGetHeader()
1350 state. If on return *have equals four, then the pattern was found and the
1354 called again with more data and the *have state. *have is initialized to
1382 struct inflate_state FAR *state; in inflateSync() local
1386 state = (struct inflate_state FAR *)strm->state; in inflateSync()
1387 if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; in inflateSync()
1390 if (state->mode != SYNC) { in inflateSync()
1391 state->mode = SYNC; in inflateSync()
1392 state->hold >>= state->bits & 7; in inflateSync()
1393 state->bits -= state->bits & 7; in inflateSync()
1395 while (state->bits >= 8) { in inflateSync()
1396 buf[len++] = (unsigned char)(state->hold); in inflateSync()
1397 state->hold >>= 8; in inflateSync()
1398 state->bits -= 8; in inflateSync()
1400 state->have = 0; in inflateSync()
1401 syncsearch(&(state->have), buf, len); in inflateSync()
1405 len = syncsearch(&(state->have), strm->next_in, strm->avail_in); in inflateSync()
1411 if (state->have != 4) return Z_DATA_ERROR; in inflateSync()
1412 if (state->flags == -1) in inflateSync()
1413 state->wrap = 0; /* if no header yet, treat as raw */ in inflateSync()
1415 state->wrap &= ~4; /* no point in computing a check value now */ in inflateSync()
1416 flags = state->flags; in inflateSync()
1420 state->flags = flags; in inflateSync()
1421 state->mode = TYPE; in inflateSync()
1434 struct inflate_state FAR *state; in inflateSyncPoint() local
1437 state = (struct inflate_state FAR *)strm->state; in inflateSyncPoint()
1438 return state->mode == STORED && state->bits == 0; in inflateSyncPoint()
1442 struct inflate_state FAR *state; in inflateCopy() local
1450 state = (struct inflate_state FAR *)source->state; in inflateCopy()
1457 if (state->window != Z_NULL) { in inflateCopy()
1459 ZALLOC(source, 1U << state->wbits, sizeof(unsigned char)); in inflateCopy()
1466 /* copy state */ in inflateCopy()
1468 zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state)); in inflateCopy()
1470 if (state->lencode >= state->codes && in inflateCopy()
1471 state->lencode <= state->codes + ENOUGH - 1) { in inflateCopy()
1472 copy->lencode = copy->codes + (state->lencode - state->codes); in inflateCopy()
1473 copy->distcode = copy->codes + (state->distcode - state->codes); in inflateCopy()
1475 copy->next = copy->codes + (state->next - state->codes); in inflateCopy()
1477 wsize = 1U << state->wbits; in inflateCopy()
1478 zmemcpy(window, state->window, wsize); in inflateCopy()
1481 dest->state = (struct internal_state FAR *)copy; in inflateCopy()
1486 struct inflate_state FAR *state; in inflateUndermine() local
1489 state = (struct inflate_state FAR *)strm->state; in inflateUndermine()
1491 state->sane = !subvert; in inflateUndermine()
1495 state->sane = 1; in inflateUndermine()
1501 struct inflate_state FAR *state; in inflateValidate() local
1504 state = (struct inflate_state FAR *)strm->state; in inflateValidate()
1505 if (check && state->wrap) in inflateValidate()
1506 state->wrap |= 4; in inflateValidate()
1508 state->wrap &= ~4; in inflateValidate()
1513 struct inflate_state FAR *state; in inflateMark() local
1517 state = (struct inflate_state FAR *)strm->state; in inflateMark()
1518 return (long)(((unsigned long)((long)state->back)) << 16) + in inflateMark()
1519 (state->mode == COPY ? state->length : in inflateMark()
1520 (state->mode == MATCH ? state->was - state->length : 0)); in inflateMark()
1524 struct inflate_state FAR *state; in inflateCodesUsed() local
1526 state = (struct inflate_state FAR *)strm->state; in inflateCodesUsed()
1527 return (unsigned long)(state->next - state->codes); in inflateCodesUsed()