Lines Matching refs:strm
23 int zlib_inflateReset(z_streamp strm) in zlib_inflateReset() argument
27 if (strm == NULL || strm->state == NULL) return Z_STREAM_ERROR; in zlib_inflateReset()
28 state = (struct inflate_state *)strm->state; in zlib_inflateReset()
29 strm->total_in = strm->total_out = state->total = 0; in zlib_inflateReset()
30 strm->msg = NULL; in zlib_inflateReset()
31 strm->adler = 1; /* to support ill-conceived Java test suite */ in zlib_inflateReset()
49 int zlib_inflatePrime(z_streamp strm, int bits, int value)
53 if (strm == NULL || strm->state == NULL) return Z_STREAM_ERROR;
54 state = (struct inflate_state *)strm->state;
63 int zlib_inflateInit2(z_streamp strm, int windowBits) in zlib_inflateInit2() argument
67 if (strm == NULL) return Z_STREAM_ERROR; in zlib_inflateInit2()
68 strm->msg = NULL; /* in case we return an error */ in zlib_inflateInit2()
70 state = &WS(strm)->inflate_state; in zlib_inflateInit2()
71 strm->state = (struct internal_state *)state; in zlib_inflateInit2()
84 state->window = &WS(strm)->working_window[0]; in zlib_inflateInit2()
86 return zlib_inflateReset(strm); in zlib_inflateInit2()
116 static void zlib_updatewindow(z_streamp strm, unsigned out) in zlib_updatewindow() argument
121 state = (struct inflate_state *)strm->state; in zlib_updatewindow()
124 copy = out - strm->avail_out; in zlib_updatewindow()
126 memcpy(state->window, strm->next_out - state->wsize, state->wsize); in zlib_updatewindow()
133 memcpy(state->window + state->write, strm->next_out - copy, dist); in zlib_updatewindow()
136 memcpy(state->window, strm->next_out - copy, copy); in zlib_updatewindow()
161 static int zlib_inflateSyncPacket(z_streamp strm) in zlib_inflateSyncPacket() argument
165 if (strm == NULL || strm->state == NULL) return Z_STREAM_ERROR; in zlib_inflateSyncPacket()
166 state = (struct inflate_state *)strm->state; in zlib_inflateSyncPacket()
183 put = strm->next_out; \
184 left = strm->avail_out; \
185 next = strm->next_in; \
186 have = strm->avail_in; \
194 strm->next_out = put; \
195 strm->avail_out = left; \
196 strm->next_in = next; \
197 strm->avail_in = have; \
332 int zlib_inflate(z_streamp strm, int flush) in zlib_inflate() argument
353 if (strm == NULL || strm->state == NULL || in zlib_inflate()
354 (strm->next_in == NULL && strm->avail_in != 0)) in zlib_inflate()
357 state = (struct inflate_state *)strm->state; in zlib_inflate()
374 strm->msg = (char *)"incorrect header check"; in zlib_inflate()
379 strm->msg = (char *)"unknown compression method"; in zlib_inflate()
386 strm->msg = (char *)"invalid window size"; in zlib_inflate()
391 strm->adler = state->check = zlib_adler32(0L, NULL, 0); in zlib_inflate()
397 strm->adler = state->check = REVERSE(hold); in zlib_inflate()
405 strm->adler = state->check = zlib_adler32(0L, NULL, 0); in zlib_inflate()
430 strm->msg = (char *)"invalid block type"; in zlib_inflate()
439 strm->msg = (char *)"invalid stored block lengths"; in zlib_inflate()
472 strm->msg = (char *)"too many length or distance symbols"; in zlib_inflate()
493 strm->msg = (char *)"invalid code lengths set"; in zlib_inflate()
516 strm->msg = (char *)"invalid bit length repeat"; in zlib_inflate()
539 strm->msg = (char *)"invalid bit length repeat"; in zlib_inflate()
558 strm->msg = (char *)"invalid literal/lengths set"; in zlib_inflate()
567 strm->msg = (char *)"invalid distances set"; in zlib_inflate()
575 inflate_fast(strm, out); in zlib_inflate()
605 strm->msg = (char *)"invalid literal/length code"; in zlib_inflate()
636 strm->msg = (char *)"invalid distance code"; in zlib_inflate()
651 strm->msg = (char *)"invalid distance too far back"; in zlib_inflate()
657 strm->msg = (char *)"invalid distance too far back"; in zlib_inflate()
697 strm->total_out += out; in zlib_inflate()
700 strm->adler = state->check = in zlib_inflate()
705 strm->msg = (char *)"incorrect data check"; in zlib_inflate()
732 if (state->wsize || (state->mode < CHECK && out != strm->avail_out)) in zlib_inflate()
733 zlib_updatewindow(strm, out); in zlib_inflate()
735 in -= strm->avail_in; in zlib_inflate()
736 out -= strm->avail_out; in zlib_inflate()
737 strm->total_in += in; in zlib_inflate()
738 strm->total_out += out; in zlib_inflate()
741 strm->adler = state->check = in zlib_inflate()
742 UPDATE(state->check, strm->next_out - out, out); in zlib_inflate()
744 strm->data_type = state->bits + (state->last ? 64 : 0) + in zlib_inflate()
748 strm->avail_out != 0 && strm->avail_in == 0) in zlib_inflate()
749 return zlib_inflateSyncPacket(strm); in zlib_inflate()
757 int zlib_inflateEnd(z_streamp strm) in zlib_inflateEnd() argument
759 if (strm == NULL || strm->state == NULL) in zlib_inflateEnd()
765 int zlib_inflateSetDictionary(z_streamp strm, const Byte *dictionary,
772 if (strm == NULL || strm->state == NULL) return Z_STREAM_ERROR;
773 state = (struct inflate_state *)strm->state;
786 zlib_updatewindow(strm, strm->avail_out);
838 int zlib_inflateSync(z_streamp strm)
846 if (strm == NULL || strm->state == NULL) return Z_STREAM_ERROR;
847 state = (struct inflate_state *)strm->state;
848 if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
866 len = zlib_syncsearch(&(state->have), strm->next_in, strm->avail_in);
867 strm->avail_in -= len;
868 strm->next_in += len;
869 strm->total_in += len;
873 in = strm->total_in; out = strm->total_out;
874 zlib_inflateReset(strm);
875 strm->total_in = in; strm->total_out = out;