Lines Matching defs:strm
26 * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
59 * input in strm.
95 local int inflateStateCheck(z_streamp strm) {
97 if (strm == Z_NULL ||
98 strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
100 state = (struct inflate_state FAR *)strm->state;
101 if (state == Z_NULL || state->strm != strm ||
107 int ZEXPORT inflateResetKeep(z_streamp strm) {
110 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
111 state = (struct inflate_state FAR *)strm->state;
112 strm->total_in = strm->total_out = state->total = 0;
113 strm->msg = Z_NULL;
115 strm->adler = state->wrap & 1;
131 int ZEXPORT inflateReset(z_streamp strm) {
134 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
135 state = (struct inflate_state FAR *)strm->state;
139 return inflateResetKeep(strm);
142 int ZEXPORT inflateReset2(z_streamp strm, int windowBits) {
147 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
148 state = (struct inflate_state FAR *)strm->state;
169 ZFREE(strm, state->window);
176 return inflateReset(strm);
179 int ZEXPORT inflateInit2_(z_streamp strm, int windowBits,
187 if (strm == Z_NULL) return Z_STREAM_ERROR;
188 strm->msg = Z_NULL; /* in case we return an error */
189 if (strm->zalloc == (alloc_func)0) {
193 strm->zalloc = zcalloc;
194 strm->opaque = (voidpf)0;
197 if (strm->zfree == (free_func)0)
201 strm->zfree = zcfree;
204 ZALLOC(strm, 1, sizeof(struct inflate_state));
207 strm->state = (struct internal_state FAR *)state;
208 state->strm = strm;
212 ret = inflateReset2(strm, windowBits);
214 ZFREE(strm, state);
215 strm->state = Z_NULL;
220 int ZEXPORT inflateInit_(z_streamp strm, const char *version,
222 return inflateInit2_(strm, DEF_WBITS, version, stream_size);
225 int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) {
228 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
231 state = (struct inflate_state FAR *)strm->state;
370 local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) {
374 state = (struct inflate_state FAR *)strm->state;
380 ZALLOC(strm, wsize + CHUNKCOPY_CHUNK_SIZE,
458 put = strm->next_out; \
459 left = strm->avail_out; \
460 next = strm->next_in; \
461 have = strm->avail_in; \
469 strm->next_out = put; \
470 strm->avail_out = left; \
471 strm->next_in = next; \
472 strm->avail_in = have; \
585 Progress is defined as a change in either strm->avail_in or strm->avail_out.
593 strm->next_out, given the space available and the provided input--the effect
602 int ZEXPORT inflate(z_streamp strm, int flush) {
622 if (inflateStateCheck(strm) || strm->next_out == Z_NULL ||
623 (strm->next_in == Z_NULL && strm->avail_in != 0))
626 state = (struct inflate_state FAR *)strm->state;
657 strm->msg = (char *)"incorrect header check";
662 strm->msg = (char *)"unknown compression method";
671 strm->msg = (char *)"invalid window size";
678 strm->adler = state->check = adler32(0L, Z_NULL, 0);
687 strm->msg = (char *)"unknown compression method";
692 strm->msg = (char *)"unknown header flags set";
808 strm->msg = (char *)"header crc mismatch";
818 strm->adler = state->check = crc32(0L, Z_NULL, 0);
824 strm->adler = state->check = ZSWAP32(hold);
833 strm->adler = state->check = adler32(0L, Z_NULL, 0);
870 strm->msg = (char *)"invalid block type";
879 strm->msg = (char *)"invalid stored block lengths";
920 strm->msg = (char *)"too many length or distance symbols";
943 strm->msg = (char *)"invalid code lengths set";
967 strm->msg = (char *)"invalid bit length repeat";
990 strm->msg = (char *)"invalid bit length repeat";
1004 strm->msg = (char *)"invalid code -- missing end-of-block";
1018 strm->msg = (char *)"invalid literal/lengths set";
1027 strm->msg = (char *)"invalid distances set";
1042 inflate_fast_chunk_(strm, out);
1082 strm->msg = (char *)"invalid literal/length code";
1120 strm->msg = (char *)"invalid distance code";
1137 strm->msg = (char *)"invalid distance too far back";
1152 strm->msg = (char *)"invalid distance too far back";
1199 strm->total_out += out;
1202 strm->adler = state->check =
1210 strm->msg = (char *)"incorrect data check";
1224 strm->msg = (char *)"incorrect length check";
1279 if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
1281 if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
1285 in -= strm->avail_in;
1286 out -= strm->avail_out;
1287 strm->total_in += in;
1288 strm->total_out += out;
1291 strm->adler = state->check =
1292 UPDATE_CHECK(state->check, strm->next_out - out, out);
1293 strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
1301 int ZEXPORT inflateEnd(z_streamp strm) {
1303 if (inflateStateCheck(strm))
1305 state = (struct inflate_state FAR *)strm->state;
1306 if (state->window != Z_NULL) ZFREE(strm, state->window);
1307 ZFREE(strm, strm->state);
1308 strm->state = Z_NULL;
1313 int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary,
1318 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1319 state = (struct inflate_state FAR *)strm->state;
1333 int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary,
1340 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1341 state = (struct inflate_state FAR *)strm->state;
1355 ret = updatewindow(strm, dictionary + dictLength, dictLength);
1365 int ZEXPORT inflateGetHeader(z_streamp strm, gz_headerp head) {
1369 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1370 state = (struct inflate_state FAR *)strm->state;
1410 int ZEXPORT inflateSync(z_streamp strm) {
1418 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1419 state = (struct inflate_state FAR *)strm->state;
1420 if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
1438 len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
1439 strm->avail_in -= len;
1440 strm->next_in += len;
1441 strm->total_in += len;
1450 in = strm->total_in; out = strm->total_out;
1451 inflateReset(strm);
1452 strm->total_in = in; strm->total_out = out;
1466 int ZEXPORT inflateSyncPoint(z_streamp strm) {
1469 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1470 state = (struct inflate_state FAR *)strm->state;
1503 copy->strm = dest;
1519 int ZEXPORT inflateUndermine(z_streamp strm, int subvert) {
1522 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1523 state = (struct inflate_state FAR *)strm->state;
1534 int ZEXPORT inflateValidate(z_streamp strm, int check) {
1537 if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
1538 state = (struct inflate_state FAR *)strm->state;
1546 long ZEXPORT inflateMark(z_streamp strm) {
1549 if (inflateStateCheck(strm))
1551 state = (struct inflate_state FAR *)strm->state;
1557 unsigned long ZEXPORT inflateCodesUsed(z_streamp strm) {
1559 if (inflateStateCheck(strm)) return (unsigned long)-1;
1560 state = (struct inflate_state FAR *)strm->state;