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(strm) in inflateStateCheck() argument
106 z_streamp strm; in inflateStateCheck()
109 if (strm == Z_NULL ||
110 strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
112 state = (struct inflate_state FAR *)strm->state;
113 if (state == Z_NULL || state->strm != strm ||
119 int ZEXPORT inflateResetKeep(strm) in inflateResetKeep() argument
120 z_streamp strm; in inflateResetKeep()
124 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
125 state = (struct inflate_state FAR *)strm->state;
126 strm->total_in = strm->total_out = state->total = 0;
127 strm->msg = Z_NULL;
129 strm->adler = state->wrap & 1;
144 int ZEXPORT inflateReset(strm) in inflateReset() argument
145 z_streamp strm; in inflateReset()
149 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
150 state = (struct inflate_state FAR *)strm->state;
154 return inflateResetKeep(strm);
157 int ZEXPORT inflateReset2(strm, windowBits) in inflateReset2() argument
158 z_streamp strm; in inflateReset2()
165 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
166 state = (struct inflate_state FAR *)strm->state;
185 ZFREE(strm, state->window);
192 return inflateReset(strm);
195 int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) in inflateInit2_() argument
196 z_streamp strm; in inflateInit2_()
207 if (strm == Z_NULL) return Z_STREAM_ERROR;
208 strm->msg = Z_NULL; /* in case we return an error */
209 if (strm->zalloc == (alloc_func)0) {
213 strm->zalloc = zcalloc;
214 strm->opaque = (voidpf)0;
217 if (strm->zfree == (free_func)0)
221 strm->zfree = zcfree;
224 ZALLOC(strm, 1, sizeof(struct inflate_state));
227 strm->state = (struct internal_state FAR *)state;
228 state->strm = strm;
231 ret = inflateReset2(strm, windowBits);
233 ZFREE(strm, state);
234 strm->state = Z_NULL;
239 int ZEXPORT inflateInit_(strm, version, stream_size) in inflateInit_() argument
240 z_streamp strm; in inflateInit_()
244 return inflateInit2_(strm, DEF_WBITS, version, stream_size);
247 int ZEXPORT inflatePrime(strm, bits, value) in inflatePrime() argument
248 z_streamp strm; in inflatePrime()
254 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
255 state = (struct inflate_state FAR *)strm->state;
396 local int updatewindow(strm, end, copy) in updatewindow() argument
397 z_streamp strm; in updatewindow()
404 state = (struct inflate_state FAR *)strm->state;
409 ZALLOC(strm, 1U << state->wbits,
478 put = strm->next_out; \
479 left = strm->avail_out; \
480 next = strm->next_in; \
481 have = strm->avail_in; \
489 strm->next_out = put; \
490 strm->avail_out = left; \
491 strm->next_in = next; \
492 strm->avail_in = have; \
622 int ZEXPORT inflate(strm, flush) in inflate() argument
623 z_streamp strm; in inflate()
645 if (inflateStateCheck(strm) || strm->next_out == Z_NULL ||
646 (strm->next_in == Z_NULL && strm->avail_in != 0))
649 state = (struct inflate_state FAR *)strm->state;
681 strm->msg = (char *)"incorrect header check";
686 strm->msg = (char *)"unknown compression method";
695 strm->msg = (char *)"invalid window size";
701 strm->adler = state->check = adler32(0L, Z_NULL, 0);
710 strm->msg = (char *)"unknown compression method";
715 strm->msg = (char *)"unknown header flags set";
823 strm->msg = (char *)"header crc mismatch";
833 strm->adler = state->check = crc32(0L, Z_NULL, 0);
839 strm->adler = state->check = ZSWAP32(hold);
847 strm->adler = state->check = adler32(0L, Z_NULL, 0);
882 strm->msg = (char *)"invalid block type";
891 strm->msg = (char *)"invalid stored block lengths";
930 strm->msg = (char *)"too many length or distance symbols";
952 strm->msg = (char *)"invalid code lengths set";
975 strm->msg = (char *)"invalid bit length repeat";
998 strm->msg = (char *)"invalid bit length repeat";
1012 strm->msg = (char *)"invalid code -- missing end-of-block";
1026 strm->msg = (char *)"invalid literal/lengths set";
1035 strm->msg = (char *)"invalid distances set";
1047 inflate_fast(strm, out);
1087 strm->msg = (char *)"invalid literal/length code";
1123 strm->msg = (char *)"invalid distance code";
1139 strm->msg = (char *)"invalid distance too far back";
1153 strm->msg = (char *)"invalid distance too far back";
1201 strm->total_out += out;
1204 strm->adler = state->check =
1212 strm->msg = (char *)"incorrect data check";
1225 strm->msg = (char *)"incorrect length check";
1255 if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
1257 if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
1261 in -= strm->avail_in;
1262 out -= strm->avail_out;
1263 strm->total_in += in;
1264 strm->total_out += out;
1267 strm->adler = state->check =
1268 UPDATE(state->check, strm->next_out - out, out);
1269 strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
1277 int ZEXPORT inflateEnd(strm) in inflateEnd() argument
1278 z_streamp strm; in inflateEnd()
1281 if (inflateStateCheck(strm))
1283 state = (struct inflate_state FAR *)strm->state;
1284 if (state->window != Z_NULL) ZFREE(strm, state->window);
1285 ZFREE(strm, strm->state);
1286 strm->state = Z_NULL;
1291 int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength) in inflateGetDictionary() argument
1292 z_streamp strm; in inflateGetDictionary()
1299 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1300 state = (struct inflate_state FAR *)strm->state;
1314 int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) in inflateSetDictionary() argument
1315 z_streamp strm; in inflateSetDictionary()
1324 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1325 state = (struct inflate_state FAR *)strm->state;
1339 ret = updatewindow(strm, dictionary + dictLength, dictLength);
1349 int ZEXPORT inflateGetHeader(strm, head) in inflateGetHeader() argument
1350 z_streamp strm; in inflateGetHeader()
1356 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1357 state = (struct inflate_state FAR *)strm->state;
1400 int ZEXPORT inflateSync(strm) in inflateSync() argument
1401 z_streamp strm; in inflateSync()
1409 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1410 state = (struct inflate_state FAR *)strm->state;
1411 if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
1429 len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
1430 strm->avail_in -= len;
1431 strm->next_in += len;
1432 strm->total_in += len;
1436 in = strm->total_in; out = strm->total_out;
1437 inflateReset(strm);
1438 strm->total_in = in; strm->total_out = out;
1451 int ZEXPORT inflateSyncPoint(strm) in inflateSyncPoint() argument
1452 z_streamp strm; in inflateSyncPoint()
1456 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1457 state = (struct inflate_state FAR *)strm->state;
1492 copy->strm = dest;
1508 int ZEXPORT inflateUndermine(strm, subvert) in inflateUndermine() argument
1509 z_streamp strm; in inflateUndermine()
1514 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1515 state = (struct inflate_state FAR *)strm->state;
1526 int ZEXPORT inflateValidate(strm, check) in inflateValidate() argument
1527 z_streamp strm; in inflateValidate()
1532 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1533 state = (struct inflate_state FAR *)strm->state;
1541 long ZEXPORT inflateMark(strm) in inflateMark() argument
1542 z_streamp strm; in inflateMark()
1546 if (inflateStateCheck(strm))
1548 state = (struct inflate_state FAR *)strm->state;
1554 unsigned long ZEXPORT inflateCodesUsed(strm) in inflateCodesUsed() argument
1555 z_streamp strm; in inflateCodesUsed()
1558 if (inflateStateCheck(strm)) return (unsigned long)-1;
1559 state = (struct inflate_state FAR *)strm->state;