Lines Matching refs:strm
95 local int inflateStateCheck OF((z_streamp strm));
97 local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
105 local int inflateStateCheck(z_streamp strm) in inflateStateCheck() argument
108 if (strm == Z_NULL || in inflateStateCheck()
109 strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) in inflateStateCheck()
111 state = (struct inflate_state FAR *)strm->state; in inflateStateCheck()
112 if (state == Z_NULL || state->strm != strm || in inflateStateCheck()
118 int ZEXPORT inflateResetKeep(z_streamp strm) in inflateResetKeep() argument
122 if (inflateStateCheck(strm)) return Z_STREAM_ERROR; in inflateResetKeep()
123 state = (struct inflate_state FAR *)strm->state; in inflateResetKeep()
124 strm->total_in = strm->total_out = state->total = 0; in inflateResetKeep()
125 strm->msg = Z_NULL; in inflateResetKeep()
127 strm->adler = state->wrap & 1; in inflateResetKeep()
143 int ZEXPORT inflateReset(z_streamp strm) in inflateReset() argument
147 if (inflateStateCheck(strm)) return Z_STREAM_ERROR; in inflateReset()
148 state = (struct inflate_state FAR *)strm->state; in inflateReset()
152 return inflateResetKeep(strm); in inflateReset()
155 int ZEXPORT inflateReset2(z_streamp strm, int windowBits) in inflateReset2() argument
161 if (inflateStateCheck(strm)) return Z_STREAM_ERROR; in inflateReset2()
162 state = (struct inflate_state FAR *)strm->state; in inflateReset2()
181 ZFREE(strm, state->window); in inflateReset2()
188 return inflateReset(strm); in inflateReset2()
191 int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, const char *version, in inflateInit2_() argument
200 if (strm == Z_NULL) return Z_STREAM_ERROR; in inflateInit2_()
201 strm->msg = Z_NULL; /* in case we return an error */ in inflateInit2_()
202 if (strm->zalloc == (alloc_func)0) { in inflateInit2_()
206 strm->zalloc = zcalloc; in inflateInit2_()
207 strm->opaque = (voidpf)0; in inflateInit2_()
210 if (strm->zfree == (free_func)0) in inflateInit2_()
214 strm->zfree = zcfree; in inflateInit2_()
217 ZALLOC(strm, 1, sizeof(struct inflate_state)); in inflateInit2_()
220 strm->state = (struct internal_state FAR *)state; in inflateInit2_()
221 state->strm = strm; in inflateInit2_()
224 ret = inflateReset2(strm, windowBits); in inflateInit2_()
226 ZFREE(strm, state); in inflateInit2_()
227 strm->state = Z_NULL; in inflateInit2_()
232 int ZEXPORT inflateInit_(z_streamp strm, const char *version, int stream_size) in inflateInit_() argument
234 return inflateInit2_(strm, DEF_WBITS, version, stream_size); in inflateInit_()
237 int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) in inflatePrime() argument
241 if (inflateStateCheck(strm)) return Z_STREAM_ERROR; in inflatePrime()
242 state = (struct inflate_state FAR *)strm->state; in inflatePrime()
382 local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) in updatewindow() argument
387 state = (struct inflate_state FAR *)strm->state; in updatewindow()
392 ZALLOC(strm, 1U << state->wbits, in updatewindow()
461 put = strm->next_out; \
462 left = strm->avail_out; \
463 next = strm->next_in; \
464 have = strm->avail_in; \
472 strm->next_out = put; \
473 strm->avail_out = left; \
474 strm->next_in = next; \
475 strm->avail_in = have; \
605 int ZEXPORT inflate(z_streamp strm, int flush) in inflate() argument
626 if (inflateStateCheck(strm) || strm->next_out == Z_NULL || in inflate()
627 (strm->next_in == Z_NULL && strm->avail_in != 0)) in inflate()
630 state = (struct inflate_state FAR *)strm->state; in inflate()
661 strm->msg = (char *)"incorrect header check"; in inflate()
666 strm->msg = (char *)"unknown compression method"; in inflate()
675 strm->msg = (char *)"invalid window size"; in inflate()
682 strm->adler = state->check = adler32(0L, Z_NULL, 0); in inflate()
691 strm->msg = (char *)"unknown compression method"; in inflate()
696 strm->msg = (char *)"unknown header flags set"; in inflate()
812 strm->msg = (char *)"header crc mismatch"; in inflate()
822 strm->adler = state->check = crc32(0L, Z_NULL, 0); in inflate()
828 strm->adler = state->check = ZSWAP32(hold); in inflate()
837 strm->adler = state->check = adler32(0L, Z_NULL, 0); in inflate()
874 strm->msg = (char *)"invalid block type"; in inflate()
883 strm->msg = (char *)"invalid stored block lengths"; in inflate()
924 strm->msg = (char *)"too many length or distance symbols"; in inflate()
947 strm->msg = (char *)"invalid code lengths set"; in inflate()
971 strm->msg = (char *)"invalid bit length repeat"; in inflate()
994 strm->msg = (char *)"invalid bit length repeat"; in inflate()
1008 strm->msg = (char *)"invalid code -- missing end-of-block"; in inflate()
1022 strm->msg = (char *)"invalid literal/lengths set"; in inflate()
1031 strm->msg = (char *)"invalid distances set"; in inflate()
1045 inflate_fast(strm, out); in inflate()
1085 strm->msg = (char *)"invalid literal/length code"; in inflate()
1123 strm->msg = (char *)"invalid distance code"; in inflate()
1140 strm->msg = (char *)"invalid distance too far back"; in inflate()
1155 strm->msg = (char *)"invalid distance too far back"; in inflate()
1203 strm->total_out += out; in inflate()
1206 strm->adler = state->check = in inflate()
1214 strm->msg = (char *)"incorrect data check"; in inflate()
1228 strm->msg = (char *)"incorrect length check"; in inflate()
1260 if (state->wsize || (out != strm->avail_out && state->mode < BAD && in inflate()
1262 if (updatewindow(strm, strm->next_out, out - strm->avail_out)) { in inflate()
1266 in -= strm->avail_in; in inflate()
1267 out -= strm->avail_out; in inflate()
1268 strm->total_in += in; in inflate()
1269 strm->total_out += out; in inflate()
1272 strm->adler = state->check = in inflate()
1273 UPDATE_CHECK(state->check, strm->next_out - out, out); in inflate()
1274 strm->data_type = (int)state->bits + (state->last ? 64 : 0) + in inflate()
1282 int ZEXPORT inflateEnd(z_streamp strm) in inflateEnd() argument
1285 if (inflateStateCheck(strm)) in inflateEnd()
1287 state = (struct inflate_state FAR *)strm->state; in inflateEnd()
1288 if (state->window != Z_NULL) ZFREE(strm, state->window); in inflateEnd()
1289 ZFREE(strm, strm->state); in inflateEnd()
1290 strm->state = Z_NULL; in inflateEnd()
1295 int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary, in inflateGetDictionary() argument
1301 if (inflateStateCheck(strm)) return Z_STREAM_ERROR; in inflateGetDictionary()
1302 state = (struct inflate_state FAR *)strm->state; in inflateGetDictionary()
1316 int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary, in inflateSetDictionary() argument
1324 if (inflateStateCheck(strm)) return Z_STREAM_ERROR; in inflateSetDictionary()
1325 state = (struct inflate_state FAR *)strm->state; in inflateSetDictionary()
1339 ret = updatewindow(strm, dictionary + dictLength, dictLength); in inflateSetDictionary()
1349 int ZEXPORT inflateGetHeader(z_streamp strm, gz_headerp head) in inflateGetHeader() argument
1354 if (inflateStateCheck(strm)) return Z_STREAM_ERROR; in inflateGetHeader()
1355 state = (struct inflate_state FAR *)strm->state; in inflateGetHeader()
1396 int ZEXPORT inflateSync(z_streamp strm) in inflateSync() argument
1405 if (inflateStateCheck(strm)) return Z_STREAM_ERROR; in inflateSync()
1406 state = (struct inflate_state FAR *)strm->state; in inflateSync()
1407 if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; in inflateSync()
1425 len = syncsearch(&(state->have), strm->next_in, strm->avail_in); in inflateSync()
1426 strm->avail_in -= len; in inflateSync()
1427 strm->next_in += len; in inflateSync()
1428 strm->total_in += len; in inflateSync()
1437 in = strm->total_in; out = strm->total_out; in inflateSync()
1438 inflateReset(strm); in inflateSync()
1439 strm->total_in = in; strm->total_out = out; in inflateSync()
1453 int ZEXPORT inflateSyncPoint(z_streamp strm) in inflateSyncPoint() argument
1457 if (inflateStateCheck(strm)) return Z_STREAM_ERROR; in inflateSyncPoint()
1458 state = (struct inflate_state FAR *)strm->state; in inflateSyncPoint()
1491 copy->strm = dest; in inflateCopy()
1507 int ZEXPORT inflateUndermine(z_streamp strm, int subvert) in inflateUndermine() argument
1511 if (inflateStateCheck(strm)) return Z_STREAM_ERROR; in inflateUndermine()
1512 state = (struct inflate_state FAR *)strm->state; in inflateUndermine()
1523 int ZEXPORT inflateValidate(z_streamp strm, int check) in inflateValidate() argument
1527 if (inflateStateCheck(strm)) return Z_STREAM_ERROR; in inflateValidate()
1528 state = (struct inflate_state FAR *)strm->state; in inflateValidate()
1536 long ZEXPORT inflateMark(z_streamp strm) in inflateMark() argument
1540 if (inflateStateCheck(strm)) in inflateMark()
1542 state = (struct inflate_state FAR *)strm->state; in inflateMark()
1548 unsigned long ZEXPORT inflateCodesUsed(z_streamp strm) in inflateCodesUsed() argument
1551 if (inflateStateCheck(strm)) return (unsigned long)-1; in inflateCodesUsed()
1552 state = (struct inflate_state FAR *)strm->state; in inflateCodesUsed()