Lines Matching full:state
19 /* Memory management for the inflate state. Useful for allocating arch-specific extension blocks. */
46 struct inflate_state *state; in inflateStateCheck() local
49 state = (struct inflate_state *)strm->state; in inflateStateCheck()
50 if (state == NULL || state->strm != strm || state->mode < HEAD || state->mode > SYNC) in inflateStateCheck()
56 struct inflate_state *state; in PREFIX() local
60 state = (struct inflate_state *)strm->state; in PREFIX()
61 strm->total_in = strm->total_out = state->total = 0; in PREFIX()
63 if (state->wrap) /* to support ill-conceived Java test suite */ in PREFIX()
64 strm->adler = state->wrap & 1; in PREFIX()
65 state->mode = HEAD; in PREFIX()
66 state->check = ADLER32_INITIAL_VALUE; in PREFIX()
67 state->last = 0; in PREFIX()
68 state->havedict = 0; in PREFIX()
69 state->flags = -1; in PREFIX()
70 state->dmax = 32768U; in PREFIX()
71 state->head = NULL; in PREFIX()
72 state->hold = 0; in PREFIX()
73 state->bits = 0; in PREFIX()
74 state->lencode = state->distcode = state->next = state->codes; in PREFIX()
75 state->sane = 1; in PREFIX()
76 state->back = -1; in PREFIX()
83 struct inflate_state *state; in PREFIX() local
87 state = (struct inflate_state *)strm->state; in PREFIX()
88 state->wsize = 0; in PREFIX()
89 state->whave = 0; in PREFIX()
90 state->wnext = 0; in PREFIX()
96 struct inflate_state *state; in PREFIX() local
98 /* get the state */ in PREFIX()
101 state = (struct inflate_state *)strm->state; in PREFIX()
118 if (state->window != NULL && state->wbits != (unsigned)windowBits) { in PREFIX()
119 ZFREE_WINDOW(strm, state->window); in PREFIX()
120 state->window = NULL; in PREFIX()
123 /* update state and reset the rest of it */ in PREFIX()
124 state->wrap = wrap; in PREFIX()
125 state->wbits = (unsigned)windowBits; in PREFIX()
131 struct inflate_state *state; in PREFIX() local
150 state = (struct inflate_state *) ZALLOC_STATE(strm, 1, sizeof(struct inflate_state)); in PREFIX()
151 if (state == NULL) in PREFIX()
154 strm->state = (struct internal_state *)state; in PREFIX()
155 state->strm = strm; in PREFIX()
156 state->window = NULL; in PREFIX()
157 state->mode = HEAD; /* to pass state test in inflateReset2() */ in PREFIX()
158 state->chunksize = functable.chunksize(); in PREFIX()
161 ZFREE_STATE(strm, state); in PREFIX()
162 strm->state = NULL; in PREFIX()
172 struct inflate_state *state; in PREFIX() local
177 state = (struct inflate_state *)strm->state; in PREFIX()
179 state->hold = 0; in PREFIX()
180 state->bits = 0; in PREFIX()
183 if (bits > 16 || state->bits + (unsigned int)bits > 32) in PREFIX()
186 state->hold += (unsigned)value << state->bits; in PREFIX()
187 state->bits += (unsigned int)bits; in PREFIX()
192 Return state with length and distance decoding tables and index sizes set to
196 void Z_INTERNAL fixedtables(struct inflate_state *state) { in fixedtables() argument
197 state->lencode = lenfix; in fixedtables()
198 state->lenbits = 9; in fixedtables()
199 state->distcode = distfix; in fixedtables()
200 state->distbits = 5; in fixedtables()
203 int Z_INTERNAL inflate_ensure_window(struct inflate_state *state) { in inflate_ensure_window() argument
205 if (state->window == NULL) { in inflate_ensure_window()
206 unsigned wsize = 1U << state->wbits; in inflate_ensure_window()
207 …state->window = (unsigned char *) ZALLOC_WINDOW(state->strm, wsize + state->chunksize, sizeof(unsi… in inflate_ensure_window()
208 if (state->window == Z_NULL) in inflate_ensure_window()
210 memset(state->window + wsize, 0, state->chunksize); in inflate_ensure_window()
214 if (state->wsize == 0) { in inflate_ensure_window()
215 state->wsize = 1U << state->wbits; in inflate_ensure_window()
216 state->wnext = 0; in inflate_ensure_window()
217 state->whave = 0; in inflate_ensure_window()
238 struct inflate_state *state; in updatewindow() local
241 state = (struct inflate_state *)strm->state; in updatewindow()
243 if (inflate_ensure_window(state)) return 1; in updatewindow()
245 /* copy state->wsize or less output bytes into the circular window */ in updatewindow()
246 if (copy >= state->wsize) { in updatewindow()
247 memcpy(state->window, end - state->wsize, state->wsize); in updatewindow()
248 state->wnext = 0; in updatewindow()
249 state->whave = state->wsize; in updatewindow()
251 dist = state->wsize - state->wnext; in updatewindow()
254 memcpy(state->window + state->wnext, end - copy, dist); in updatewindow()
257 memcpy(state->window, end - copy, copy); in updatewindow()
258 state->wnext = copy; in updatewindow()
259 state->whave = state->wsize; in updatewindow()
261 state->wnext += dist; in updatewindow()
262 if (state->wnext == state->wsize) in updatewindow()
263 state->wnext = 0; in updatewindow()
264 if (state->whave < state->wsize) in updatewindow()
265 state->whave += dist; in updatewindow()
287 inflate() uses a state machine to process as much input data and generate as
288 much output data as possible before returning. The state machine is
291 for (;;) switch (state) {
297 state = STATEm;
304 next state. The NEEDBITS() macro is usually the way the state evaluates
327 state information is maintained to continue the loop where it left off
329 would all have to actually be part of the saved state in case NEEDBITS()
338 state = STATEx;
341 As shown above, if the next state is also the next case, then the break
344 A state may also return if there is not enough output space available to
345 complete that state. Those states are copying stored data, writing a
369 struct inflate_state *state; in PREFIX() local
392 state = (struct inflate_state *)strm->state; in PREFIX()
393 if (state->mode == TYPE) /* skip check */ in PREFIX()
394 state->mode = TYPEDO; in PREFIX()
400 switch (state->mode) { in PREFIX()
402 if (state->wrap == 0) { in PREFIX()
403 state->mode = TYPEDO; in PREFIX()
408 if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ in PREFIX()
409 if (state->wbits == 0) in PREFIX()
410 state->wbits = 15; in PREFIX()
411 state->check = PREFIX(crc32)(0L, NULL, 0); in PREFIX()
412 CRC2(state->check, hold); in PREFIX()
414 state->mode = FLAGS; in PREFIX()
417 if (state->head != NULL) in PREFIX()
418 state->head->done = -1; in PREFIX()
419 if (!(state->wrap & 1) || /* check if zlib header allowed */ in PREFIX()
425 state->mode = BAD; in PREFIX()
430 state->mode = BAD; in PREFIX()
435 if (state->wbits == 0) in PREFIX()
436 state->wbits = len; in PREFIX()
437 if (len > 15 || len > state->wbits) { in PREFIX()
439 state->mode = BAD; in PREFIX()
442 state->dmax = 1U << len; in PREFIX()
443 state->flags = 0; /* indicate zlib header */ in PREFIX()
445 strm->adler = state->check = ADLER32_INITIAL_VALUE; in PREFIX()
446 state->mode = hold & 0x200 ? DICTID : TYPE; in PREFIX()
453 state->flags = (int)(hold); in PREFIX()
454 if ((state->flags & 0xff) != Z_DEFLATED) { in PREFIX()
456 state->mode = BAD; in PREFIX()
459 if (state->flags & 0xe000) { in PREFIX()
461 state->mode = BAD; in PREFIX()
464 if (state->head != NULL) in PREFIX()
465 state->head->text = (int)((hold >> 8) & 1); in PREFIX()
466 if ((state->flags & 0x0200) && (state->wrap & 4)) in PREFIX()
467 CRC2(state->check, hold); in PREFIX()
469 state->mode = TIME; in PREFIX()
473 if (state->head != NULL) in PREFIX()
474 state->head->time = hold; in PREFIX()
475 if ((state->flags & 0x0200) && (state->wrap & 4)) in PREFIX()
476 CRC4(state->check, hold); in PREFIX()
478 state->mode = OS; in PREFIX()
482 if (state->head != NULL) { in PREFIX()
483 state->head->xflags = (int)(hold & 0xff); in PREFIX()
484 state->head->os = (int)(hold >> 8); in PREFIX()
486 if ((state->flags & 0x0200) && (state->wrap & 4)) in PREFIX()
487 CRC2(state->check, hold); in PREFIX()
489 state->mode = EXLEN; in PREFIX()
492 if (state->flags & 0x0400) { in PREFIX()
494 state->length = (uint16_t)hold; in PREFIX()
495 if (state->head != NULL) in PREFIX()
496 state->head->extra_len = (uint16_t)hold; in PREFIX()
497 if ((state->flags & 0x0200) && (state->wrap & 4)) in PREFIX()
498 CRC2(state->check, hold); in PREFIX()
500 } else if (state->head != NULL) { in PREFIX()
501 state->head->extra = NULL; in PREFIX()
503 state->mode = EXTRA; in PREFIX()
506 if (state->flags & 0x0400) { in PREFIX()
507 copy = state->length; in PREFIX()
511 if (state->head != NULL && in PREFIX()
512 state->head->extra != NULL) { in PREFIX()
513 len = state->head->extra_len - state->length; in PREFIX()
514 memcpy(state->head->extra + len, next, in PREFIX()
515 len + copy > state->head->extra_max ? in PREFIX()
516 state->head->extra_max - len : copy); in PREFIX()
518 if ((state->flags & 0x0200) && (state->wrap & 4)) in PREFIX()
519 state->check = PREFIX(crc32)(state->check, next, copy); in PREFIX()
522 state->length -= copy; in PREFIX()
524 if (state->length) in PREFIX()
527 state->length = 0; in PREFIX()
528 state->mode = NAME; in PREFIX()
531 if (state->flags & 0x0800) { in PREFIX()
536 … if (state->head != NULL && state->head->name != NULL && state->length < state->head->name_max) in PREFIX()
537 state->head->name[state->length++] = (unsigned char)len; in PREFIX()
539 if ((state->flags & 0x0200) && (state->wrap & 4)) in PREFIX()
540 state->check = PREFIX(crc32)(state->check, next, copy); in PREFIX()
545 } else if (state->head != NULL) { in PREFIX()
546 state->head->name = NULL; in PREFIX()
548 state->length = 0; in PREFIX()
549 state->mode = COMMENT; in PREFIX()
552 if (state->flags & 0x1000) { in PREFIX()
557 if (state->head != NULL && state->head->comment != NULL in PREFIX()
558 && state->length < state->head->comm_max) in PREFIX()
559 state->head->comment[state->length++] = (unsigned char)len; in PREFIX()
561 if ((state->flags & 0x0200) && (state->wrap & 4)) in PREFIX()
562 state->check = PREFIX(crc32)(state->check, next, copy); in PREFIX()
567 } else if (state->head != NULL) { in PREFIX()
568 state->head->comment = NULL; in PREFIX()
570 state->mode = HCRC; in PREFIX()
573 if (state->flags & 0x0200) { in PREFIX()
575 if ((state->wrap & 4) && hold != (state->check & 0xffff)) { in PREFIX()
577 state->mode = BAD; in PREFIX()
582 if (state->head != NULL) { in PREFIX()
583 state->head->hcrc = (int)((state->flags >> 9) & 1); in PREFIX()
584 state->head->done = 1; in PREFIX()
586 strm->adler = state->check = PREFIX(crc32)(0L, NULL, 0); in PREFIX()
587 state->mode = TYPE; in PREFIX()
592 strm->adler = state->check = ZSWAP32(hold); in PREFIX()
594 state->mode = DICT; in PREFIX()
597 if (state->havedict == 0) { in PREFIX()
601 strm->adler = state->check = ADLER32_INITIAL_VALUE; in PREFIX()
602 state->mode = TYPE; in PREFIX()
611 if (state->last) { in PREFIX()
613 state->mode = CHECK; in PREFIX()
617 state->last = BITS(1); in PREFIX()
621 Tracev((stderr, "inflate: stored block%s\n", state->last ? " (last)" : "")); in PREFIX()
622 state->mode = STORED; in PREFIX()
625 fixedtables(state); in PREFIX()
626 … Tracev((stderr, "inflate: fixed codes block%s\n", state->last ? " (last)" : "")); in PREFIX()
627 state->mode = LEN_; /* decode codes */ in PREFIX()
634 … Tracev((stderr, "inflate: dynamic codes block%s\n", state->last ? " (last)" : "")); in PREFIX()
635 state->mode = TABLE; in PREFIX()
639 state->mode = BAD; in PREFIX()
650 state->mode = BAD; in PREFIX()
653 state->length = (uint16_t)hold; in PREFIX()
654 Tracev((stderr, "inflate: stored length %u\n", state->length)); in PREFIX()
656 state->mode = COPY_; in PREFIX()
661 state->mode = COPY; in PREFIX()
665 copy = state->length; in PREFIX()
675 state->length -= copy; in PREFIX()
679 state->mode = TYPE; in PREFIX()
685 state->nlen = BITS(5) + 257; in PREFIX()
687 state->ndist = BITS(5) + 1; in PREFIX()
689 state->ncode = BITS(4) + 4; in PREFIX()
692 if (state->nlen > 286 || state->ndist > 30) { in PREFIX()
694 state->mode = BAD; in PREFIX()
699 state->have = 0; in PREFIX()
700 state->mode = LENLENS; in PREFIX()
704 while (state->have < state->ncode) { in PREFIX()
706 state->lens[order[state->have++]] = (uint16_t)BITS(3); in PREFIX()
709 while (state->have < 19) in PREFIX()
710 state->lens[order[state->have++]] = 0; in PREFIX()
711 state->next = state->codes; in PREFIX()
712 state->lencode = (const code *)(state->next); in PREFIX()
713 state->lenbits = 7; in PREFIX()
714 … ret = zng_inflate_table(CODES, state->lens, 19, &(state->next), &(state->lenbits), state->work); in PREFIX()
717 state->mode = BAD; in PREFIX()
721 state->have = 0; in PREFIX()
722 state->mode = CODELENS; in PREFIX()
726 while (state->have < state->nlen + state->ndist) { in PREFIX()
728 here = state->lencode[BITS(state->lenbits)]; in PREFIX()
734 state->lens[state->have++] = here.val; in PREFIX()
739 if (state->have == 0) { in PREFIX()
741 state->mode = BAD; in PREFIX()
744 len = state->lens[state->have - 1]; in PREFIX()
760 if (state->have + copy > state->nlen + state->ndist) { in PREFIX()
762 state->mode = BAD; in PREFIX()
767 state->lens[state->have++] = (uint16_t)len; in PREFIX()
773 if (state->mode == BAD) in PREFIX()
777 if (state->lens[256] == 0) { in PREFIX()
779 state->mode = BAD; in PREFIX()
786 state->next = state->codes; in PREFIX()
787 state->lencode = (const code *)(state->next); in PREFIX()
788 state->lenbits = 9; in PREFIX()
789 …ret = zng_inflate_table(LENS, state->lens, state->nlen, &(state->next), &(state->lenbits), state->… in PREFIX()
792 state->mode = BAD; in PREFIX()
795 state->distcode = (const code *)(state->next); in PREFIX()
796 state->distbits = 6; in PREFIX()
797 ret = zng_inflate_table(DISTS, state->lens + state->nlen, state->ndist, in PREFIX()
798 &(state->next), &(state->distbits), state->work); in PREFIX()
801 state->mode = BAD; in PREFIX()
805 state->mode = LEN_; in PREFIX()
810 state->mode = LEN; in PREFIX()
819 if (state->mode == TYPE) in PREFIX()
820 state->back = -1; in PREFIX()
823 state->back = 0; in PREFIX()
827 here = state->lencode[BITS(state->lenbits)]; in PREFIX()
835 here = state->lencode[last.val + (BITS(last.bits + last.op) >> last.bits)]; in PREFIX()
841 state->back += last.bits; in PREFIX()
844 state->back += here.bits; in PREFIX()
845 state->length = here.val; in PREFIX()
852 state->mode = LIT; in PREFIX()
859 state->back = -1; in PREFIX()
860 state->mode = TYPE; in PREFIX()
867 state->mode = BAD; in PREFIX()
872 state->extra = (here.op & 15); in PREFIX()
873 state->mode = LENEXT; in PREFIX()
877 if (state->extra) { in PREFIX()
878 NEEDBITS(state->extra); in PREFIX()
879 state->length += BITS(state->extra); in PREFIX()
880 DROPBITS(state->extra); in PREFIX()
881 state->back += state->extra; in PREFIX()
883 Tracevv((stderr, "inflate: length %u\n", state->length)); in PREFIX()
884 state->was = state->length; in PREFIX()
885 state->mode = DIST; in PREFIX()
890 here = state->distcode[BITS(state->distbits)]; in PREFIX()
898 here = state->distcode[last.val + (BITS(last.bits + last.op) >> last.bits)]; in PREFIX()
904 state->back += last.bits; in PREFIX()
907 state->back += here.bits; in PREFIX()
910 state->mode = BAD; in PREFIX()
913 state->offset = here.val; in PREFIX()
914 state->extra = (here.op & 15); in PREFIX()
915 state->mode = DISTEXT; in PREFIX()
919 if (state->extra) { in PREFIX()
920 NEEDBITS(state->extra); in PREFIX()
921 state->offset += BITS(state->extra); in PREFIX()
922 DROPBITS(state->extra); in PREFIX()
923 state->back += state->extra; in PREFIX()
926 if (state->offset > state->dmax) { in PREFIX()
928 state->mode = BAD; in PREFIX()
932 Tracevv((stderr, "inflate: distance %u\n", state->offset)); in PREFIX()
933 state->mode = MATCH; in PREFIX()
939 if (state->offset > copy) { /* copy from window */ in PREFIX()
940 copy = state->offset - copy; in PREFIX()
941 if (copy > state->whave) { in PREFIX()
942 if (state->sane) { in PREFIX()
944 state->mode = BAD; in PREFIX()
949 copy -= state->whave; in PREFIX()
950 if (copy > state->length) in PREFIX()
951 copy = state->length; in PREFIX()
955 state->length -= copy; in PREFIX()
959 if (state->length == 0) in PREFIX()
960 state->mode = LEN; in PREFIX()
964 if (copy > state->wnext) { in PREFIX()
965 copy -= state->wnext; in PREFIX()
966 from = state->window + (state->wsize - copy); in PREFIX()
968 from = state->window + (state->wnext - copy); in PREFIX()
970 if (copy > state->length) in PREFIX()
971 copy = state->length; in PREFIX()
977 copy = state->length; in PREFIX()
981 put = functable.chunkmemset_safe(put, state->offset, copy, left); in PREFIX()
984 state->length -= copy; in PREFIX()
985 if (state->length == 0) in PREFIX()
986 state->mode = LEN; in PREFIX()
992 *put++ = (unsigned char)(state->length); in PREFIX()
994 state->mode = LEN; in PREFIX()
998 if (state->wrap) { in PREFIX()
1002 state->total += out; in PREFIX()
1003 if (INFLATE_NEED_CHECKSUM(strm) && (state->wrap & 4) && out) in PREFIX()
1004 strm->adler = state->check = UPDATE(state->check, put - out, out); in PREFIX()
1006 if ((state->wrap & 4) && ( in PREFIX()
1008 state->flags ? hold : in PREFIX()
1010 ZSWAP32(hold)) != state->check) { in PREFIX()
1012 state->mode = BAD; in PREFIX()
1019 state->mode = LENGTH; in PREFIX()
1022 if (state->wrap && state->flags) { in PREFIX()
1024 if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) { in PREFIX()
1026 state->mode = BAD; in PREFIX()
1033 state->mode = DONE; in PREFIX()
1056 error. Call updatewindow() to create and/or update the window state. in PREFIX()
1062 (state->wsize || (out != strm->avail_out && state->mode < BAD && in PREFIX()
1063 (state->mode < CHECK || flush != Z_FINISH)))) { in PREFIX()
1065 state->mode = MEM; in PREFIX()
1073 state->total += out; in PREFIX()
1074 if (INFLATE_NEED_CHECKSUM(strm) && (state->wrap & 4) && out) in PREFIX()
1075 strm->adler = state->check = UPDATE(state->check, strm->next_out - out, out); in PREFIX()
1076 strm->data_type = (int)state->bits + (state->last ? 64 : 0) + in PREFIX()
1077 … (state->mode == TYPE ? 128 : 0) + (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0); in PREFIX()
1084 struct inflate_state *state; in PREFIX() local
1087 state = (struct inflate_state *)strm->state; in PREFIX()
1088 if (state->window != NULL) in PREFIX()
1089 ZFREE_WINDOW(strm, state->window); in PREFIX()
1090 ZFREE_STATE(strm, strm->state); in PREFIX()
1091 strm->state = NULL; in PREFIX()
1097 struct inflate_state *state; in PREFIX() local
1099 /* check state */ in PREFIX()
1102 state = (struct inflate_state *)strm->state; in PREFIX()
1105 if (state->whave && dictionary != NULL) { in PREFIX()
1106 memcpy(dictionary, state->window + state->wnext, state->whave - state->wnext); in PREFIX()
1107 memcpy(dictionary + state->whave - state->wnext, state->window, state->wnext); in PREFIX()
1110 *dictLength = state->whave; in PREFIX()
1115 struct inflate_state *state; in PREFIX() local
1119 /* check state */ in PREFIX()
1122 state = (struct inflate_state *)strm->state; in PREFIX()
1123 if (state->wrap != 0 && state->mode != DICT) in PREFIX()
1127 if (state->mode == DICT) { in PREFIX()
1129 if (dictid != state->check) in PREFIX()
1137 state->mode = MEM; in PREFIX()
1140 state->havedict = 1; in PREFIX()
1146 struct inflate_state *state; in PREFIX() local
1148 /* check state */ in PREFIX()
1151 state = (struct inflate_state *)strm->state; in PREFIX()
1152 if ((state->wrap & 2) == 0) in PREFIX()
1156 state->head = head; in PREFIX()
1165 state. If on return *have equals four, then the pattern was found and the
1169 called again with more data and the *have state. *have is initialized to
1196 struct inflate_state *state; in PREFIX() local
1201 state = (struct inflate_state *)strm->state; in PREFIX()
1202 if (strm->avail_in == 0 && state->bits < 8) in PREFIX()
1206 if (state->mode != SYNC) { in PREFIX()
1207 state->mode = SYNC; in PREFIX()
1208 state->hold <<= state->bits & 7; in PREFIX()
1209 state->bits -= state->bits & 7; in PREFIX()
1211 while (state->bits >= 8) { in PREFIX()
1212 buf[len++] = (unsigned char)(state->hold); in PREFIX()
1213 state->hold >>= 8; in PREFIX()
1214 state->bits -= 8; in PREFIX()
1216 state->have = 0; in PREFIX()
1217 syncsearch(&(state->have), buf, len); in PREFIX()
1221 len = syncsearch(&(state->have), strm->next_in, strm->avail_in); in PREFIX()
1227 if (state->have != 4) in PREFIX()
1229 if (state->flags == -1) in PREFIX()
1230 state->wrap = 0; /* if no header yet, treat as raw */ in PREFIX()
1232 state->wrap &= ~4; /* no point in computing a check value now */ in PREFIX()
1233 flags = state->flags; in PREFIX()
1239 state->flags = flags; in PREFIX()
1240 state->mode = TYPE; in PREFIX()
1253 struct inflate_state *state; in PREFIX() local
1257 state = (struct inflate_state *)strm->state; in PREFIX()
1258 return state->mode == STORED && state->bits == 0; in PREFIX()
1262 struct inflate_state *state; in PREFIX() local
1270 state = (struct inflate_state *)source->state; in PREFIX()
1278 if (state->window != NULL) { in PREFIX()
1279 window = (unsigned char *) ZALLOC_WINDOW(source, 1U << state->wbits, sizeof(unsigned char)); in PREFIX()
1286 /* copy state */ in PREFIX()
1288 ZCOPY_STATE((void *)copy, (void *)state, sizeof(struct inflate_state)); in PREFIX()
1290 if (state->lencode >= state->codes && state->lencode <= state->codes + ENOUGH - 1) { in PREFIX()
1291 copy->lencode = copy->codes + (state->lencode - state->codes); in PREFIX()
1292 copy->distcode = copy->codes + (state->distcode - state->codes); in PREFIX()
1294 copy->next = copy->codes + (state->next - state->codes); in PREFIX()
1296 wsize = 1U << state->wbits; in PREFIX()
1297 memcpy(window, state->window, wsize); in PREFIX()
1300 dest->state = (struct internal_state *)copy; in PREFIX()
1305 struct inflate_state *state; in PREFIX() local
1309 state = (struct inflate_state *)strm->state; in PREFIX()
1311 state->sane = !subvert; in PREFIX()
1315 state->sane = 1; in PREFIX()
1321 struct inflate_state *state; in PREFIX() local
1325 state = (struct inflate_state *)strm->state; in PREFIX()
1326 if (check && state->wrap) in PREFIX()
1327 state->wrap |= 4; in PREFIX()
1329 state->wrap &= ~4; in PREFIX()
1334 struct inflate_state *state; in PREFIX() local
1339 state = (struct inflate_state *)strm->state; in PREFIX()
1340 return ((long)(state->back) << 16) + (state->mode == COPY ? state->length : in PREFIX()
1341 (state->mode == MATCH ? state->was - state->length : 0)); in PREFIX()
1345 struct inflate_state *state; in PREFIX() local
1346 if (strm == NULL || strm->state == NULL) in PREFIX()
1348 state = (struct inflate_state *)strm->state; in PREFIX()
1349 return (unsigned long)(state->next - state->codes); in PREFIX()