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