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()
48 int zlib_inflateInit2(z_streamp strm, int windowBits) in zlib_inflateInit2() argument
52 if (strm == NULL) return Z_STREAM_ERROR; in zlib_inflateInit2()
53 strm->msg = NULL; /* in case we return an error */ in zlib_inflateInit2()
55 state = &WS(strm)->inflate_state; in zlib_inflateInit2()
56 strm->state = (struct internal_state *)state; in zlib_inflateInit2()
69 state->window = &WS(strm)->working_window[0]; in zlib_inflateInit2()
71 return zlib_inflateReset(strm); in zlib_inflateInit2()
101 static void zlib_updatewindow(z_streamp strm, unsigned out) in zlib_updatewindow() argument
106 state = (struct inflate_state *)strm->state; in zlib_updatewindow()
109 copy = out - strm->avail_out; in zlib_updatewindow()
111 memcpy(state->window, strm->next_out - state->wsize, state->wsize); in zlib_updatewindow()
118 memcpy(state->window + state->write, strm->next_out - copy, dist); in zlib_updatewindow()
121 memcpy(state->window, strm->next_out - copy, copy); in zlib_updatewindow()
146 static int zlib_inflateSyncPacket(z_streamp strm) in zlib_inflateSyncPacket() argument
150 if (strm == NULL || strm->state == NULL) return Z_STREAM_ERROR; in zlib_inflateSyncPacket()
151 state = (struct inflate_state *)strm->state; in zlib_inflateSyncPacket()
168 put = strm->next_out; \
169 left = strm->avail_out; \
170 next = strm->next_in; \
171 have = strm->avail_in; \
179 strm->next_out = put; \
180 strm->avail_out = left; \
181 strm->next_in = next; \
182 strm->avail_in = have; \
317 int zlib_inflate(z_streamp strm, int flush) in zlib_inflate() argument
338 if (strm == NULL || strm->state == NULL || in zlib_inflate()
339 (strm->next_in == NULL && strm->avail_in != 0)) in zlib_inflate()
342 state = (struct inflate_state *)strm->state; in zlib_inflate()
359 strm->msg = (char *)"incorrect header check"; in zlib_inflate()
364 strm->msg = (char *)"unknown compression method"; in zlib_inflate()
371 strm->msg = (char *)"invalid window size"; in zlib_inflate()
376 strm->adler = state->check = zlib_adler32(0L, NULL, 0); in zlib_inflate()
382 strm->adler = state->check = REVERSE(hold); in zlib_inflate()
390 strm->adler = state->check = zlib_adler32(0L, NULL, 0); in zlib_inflate()
415 strm->msg = (char *)"invalid block type"; in zlib_inflate()
424 strm->msg = (char *)"invalid stored block lengths"; in zlib_inflate()
457 strm->msg = (char *)"too many length or distance symbols"; in zlib_inflate()
478 strm->msg = (char *)"invalid code lengths set"; in zlib_inflate()
501 strm->msg = (char *)"invalid bit length repeat"; in zlib_inflate()
524 strm->msg = (char *)"invalid bit length repeat"; in zlib_inflate()
543 strm->msg = (char *)"invalid literal/lengths set"; in zlib_inflate()
552 strm->msg = (char *)"invalid distances set"; in zlib_inflate()
560 inflate_fast(strm, out); in zlib_inflate()
590 strm->msg = (char *)"invalid literal/length code"; in zlib_inflate()
621 strm->msg = (char *)"invalid distance code"; in zlib_inflate()
636 strm->msg = (char *)"invalid distance too far back"; in zlib_inflate()
642 strm->msg = (char *)"invalid distance too far back"; in zlib_inflate()
682 strm->total_out += out; in zlib_inflate()
685 strm->adler = state->check = in zlib_inflate()
690 strm->msg = (char *)"incorrect data check"; in zlib_inflate()
717 if (state->wsize || (state->mode < CHECK && out != strm->avail_out)) in zlib_inflate()
718 zlib_updatewindow(strm, out); in zlib_inflate()
720 in -= strm->avail_in; in zlib_inflate()
721 out -= strm->avail_out; in zlib_inflate()
722 strm->total_in += in; in zlib_inflate()
723 strm->total_out += out; in zlib_inflate()
726 strm->adler = state->check = in zlib_inflate()
727 UPDATE(state->check, strm->next_out - out, out); in zlib_inflate()
729 strm->data_type = state->bits + (state->last ? 64 : 0) + in zlib_inflate()
733 strm->avail_out != 0 && strm->avail_in == 0) in zlib_inflate()
734 return zlib_inflateSyncPacket(strm); in zlib_inflate()
742 int zlib_inflateEnd(z_streamp strm) in zlib_inflateEnd() argument
744 if (strm == NULL || strm->state == NULL) in zlib_inflateEnd()