• Home
  • Raw
  • Download

Lines Matching refs:strm

22 #define INFLATE_RESET_HOOK(strm) do {} while (0)  argument
23 #define INFLATE_TYPEDO_HOOK(strm, flush) do {} while (0) argument
24 #define INFLATE_NEED_UPDATEWINDOW(strm) 1 argument
25 #define INFLATE_NEED_CHECKSUM(strm) 1 argument
33 int zlib_inflateReset(z_streamp strm) in zlib_inflateReset() argument
37 if (strm == NULL || strm->state == NULL) return Z_STREAM_ERROR; in zlib_inflateReset()
38 state = (struct inflate_state *)strm->state; in zlib_inflateReset()
39 strm->total_in = strm->total_out = state->total = 0; in zlib_inflateReset()
40 strm->msg = NULL; in zlib_inflateReset()
41 strm->adler = 1; /* to support ill-conceived Java test suite */ in zlib_inflateReset()
55 INFLATE_RESET_HOOK(strm); in zlib_inflateReset()
59 int zlib_inflateInit2(z_streamp strm, int windowBits) in zlib_inflateInit2() argument
63 if (strm == NULL) return Z_STREAM_ERROR; in zlib_inflateInit2()
64 strm->msg = NULL; /* in case we return an error */ in zlib_inflateInit2()
66 state = &WS(strm)->inflate_state; in zlib_inflateInit2()
67 strm->state = (struct internal_state *)state; in zlib_inflateInit2()
85 state->window = PTR_ALIGN(&WS(strm)->working_window[0], PAGE_SIZE); in zlib_inflateInit2()
87 state->window = &WS(strm)->working_window[0]; in zlib_inflateInit2()
90 return zlib_inflateReset(strm); in zlib_inflateInit2()
120 static void zlib_updatewindow(z_streamp strm, unsigned out) in zlib_updatewindow() argument
125 state = (struct inflate_state *)strm->state; in zlib_updatewindow()
128 copy = out - strm->avail_out; in zlib_updatewindow()
130 memcpy(state->window, strm->next_out - state->wsize, state->wsize); in zlib_updatewindow()
137 memcpy(state->window + state->write, strm->next_out - copy, dist); in zlib_updatewindow()
140 memcpy(state->window, strm->next_out - copy, copy); in zlib_updatewindow()
165 static int zlib_inflateSyncPacket(z_streamp strm) in zlib_inflateSyncPacket() argument
169 if (strm == NULL || strm->state == NULL) return Z_STREAM_ERROR; in zlib_inflateSyncPacket()
170 state = (struct inflate_state *)strm->state; in zlib_inflateSyncPacket()
187 put = strm->next_out; \
188 left = strm->avail_out; \
189 next = strm->next_in; \
190 have = strm->avail_in; \
198 strm->next_out = put; \
199 strm->avail_out = left; \
200 strm->next_in = next; \
201 strm->avail_in = have; \
331 int zlib_inflate(z_streamp strm, int flush) in zlib_inflate() argument
352 if (strm == NULL || strm->state == NULL || in zlib_inflate()
353 (strm->next_in == NULL && strm->avail_in != 0)) in zlib_inflate()
356 state = (struct inflate_state *)strm->state; in zlib_inflate()
373 strm->msg = (char *)"incorrect header check"; in zlib_inflate()
378 strm->msg = (char *)"unknown compression method"; in zlib_inflate()
385 strm->msg = (char *)"invalid window size"; in zlib_inflate()
390 strm->adler = state->check = zlib_adler32(0L, NULL, 0); in zlib_inflate()
396 strm->adler = state->check = REVERSE(hold); in zlib_inflate()
405 strm->adler = state->check = zlib_adler32(0L, NULL, 0); in zlib_inflate()
412 INFLATE_TYPEDO_HOOK(strm, flush); in zlib_inflate()
433 strm->msg = (char *)"invalid block type"; in zlib_inflate()
442 strm->msg = (char *)"invalid stored block lengths"; in zlib_inflate()
476 strm->msg = (char *)"too many length or distance symbols"; in zlib_inflate()
498 strm->msg = (char *)"invalid code lengths set"; in zlib_inflate()
522 strm->msg = (char *)"invalid bit length repeat"; in zlib_inflate()
545 strm->msg = (char *)"invalid bit length repeat"; in zlib_inflate()
564 strm->msg = (char *)"invalid literal/lengths set"; in zlib_inflate()
573 strm->msg = (char *)"invalid distances set"; in zlib_inflate()
582 inflate_fast(strm, out); in zlib_inflate()
612 strm->msg = (char *)"invalid literal/length code"; in zlib_inflate()
645 strm->msg = (char *)"invalid distance code"; in zlib_inflate()
661 strm->msg = (char *)"invalid distance too far back"; in zlib_inflate()
667 strm->msg = (char *)"invalid distance too far back"; in zlib_inflate()
708 strm->total_out += out; in zlib_inflate()
710 if (INFLATE_NEED_CHECKSUM(strm) && out) in zlib_inflate()
711 strm->adler = state->check = in zlib_inflate()
716 strm->msg = (char *)"incorrect data check"; in zlib_inflate()
744 if (INFLATE_NEED_UPDATEWINDOW(strm) && in zlib_inflate()
745 (state->wsize || (state->mode < CHECK && out != strm->avail_out))) in zlib_inflate()
746 zlib_updatewindow(strm, out); in zlib_inflate()
748 in -= strm->avail_in; in zlib_inflate()
749 out -= strm->avail_out; in zlib_inflate()
750 strm->total_in += in; in zlib_inflate()
751 strm->total_out += out; in zlib_inflate()
753 if (INFLATE_NEED_CHECKSUM(strm) && state->wrap && out) in zlib_inflate()
754 strm->adler = state->check = in zlib_inflate()
755 UPDATE(state->check, strm->next_out - out, out); in zlib_inflate()
757 strm->data_type = state->bits + (state->last ? 64 : 0) + in zlib_inflate()
761 strm->avail_out != 0 && strm->avail_in == 0) in zlib_inflate()
762 return zlib_inflateSyncPacket(strm); in zlib_inflate()
770 int zlib_inflateEnd(z_streamp strm) in zlib_inflateEnd() argument
772 if (strm == NULL || strm->state == NULL) in zlib_inflateEnd()