Lines Matching refs:strm
26 * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
59 * input in strm.
96 local int updatewindow OF((z_streamp strm, unsigned out));
103 int ZEXPORT inflateResetKeep(strm)
104 z_streamp strm;
108 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
109 state = (struct inflate_state FAR *)strm->state;
110 strm->total_in = strm->total_out = state->total = 0;
111 strm->msg = Z_NULL;
113 strm->adler = state->wrap & 1;
128 int ZEXPORT inflateReset(strm)
129 z_streamp strm;
133 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
134 state = (struct inflate_state FAR *)strm->state;
138 return inflateResetKeep(strm);
141 int ZEXPORT inflateReset2(strm, windowBits)
142 z_streamp strm;
149 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
150 state = (struct inflate_state FAR *)strm->state;
169 ZFREE(strm, state->window);
176 return inflateReset(strm);
179 int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
180 z_streamp strm;
191 if (strm == Z_NULL) return Z_STREAM_ERROR;
192 strm->msg = Z_NULL; /* in case we return an error */
193 if (strm->zalloc == (alloc_func)0) {
197 strm->zalloc = zcalloc;
198 strm->opaque = (voidpf)0;
201 if (strm->zfree == (free_func)0)
205 strm->zfree = zcfree;
208 ZALLOC(strm, 1, sizeof(struct inflate_state));
211 strm->state = (struct internal_state FAR *)state;
213 ret = inflateReset2(strm, windowBits);
215 ZFREE(strm, state);
216 strm->state = Z_NULL;
221 int ZEXPORT inflateInit_(strm, version, stream_size)
222 z_streamp strm;
226 return inflateInit2_(strm, DEF_WBITS, version, stream_size);
229 int ZEXPORT inflatePrime(strm, bits, value)
230 z_streamp strm;
236 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
237 state = (struct inflate_state FAR *)strm->state;
378 local int updatewindow(strm, out)
379 z_streamp strm;
385 state = (struct inflate_state FAR *)strm->state;
390 ZALLOC(strm, 1U << state->wbits,
403 copy = out - strm->avail_out;
405 zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
412 zmemcpy(state->window + state->wnext, strm->next_out - copy, dist);
415 zmemcpy(state->window, strm->next_out - copy, copy);
460 put = strm->next_out; \
461 left = strm->avail_out; \
462 next = strm->next_in; \
463 have = strm->avail_in; \
471 strm->next_out = put; \
472 strm->avail_out = left; \
473 strm->next_in = next; \
474 strm->avail_in = have; \
587 Progress is defined as a change in either strm->avail_in or strm->avail_out.
595 strm->next_out, given the space available and the provided input--the effect
604 int ZEXPORT inflate(strm, flush)
605 z_streamp strm;
627 if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
628 (strm->next_in == Z_NULL && strm->avail_in != 0))
631 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";
681 strm->adler = state->check = adler32(0L, Z_NULL, 0);
690 strm->msg = (char *)"unknown compression method";
695 strm->msg = (char *)"unknown header flags set";
799 strm->msg = (char *)"header crc mismatch";
809 strm->adler = state->check = crc32(0L, Z_NULL, 0);
815 strm->adler = state->check = ZSWAP32(hold);
823 strm->adler = state->check = adler32(0L, Z_NULL, 0);
858 strm->msg = (char *)"invalid block type";
867 strm->msg = (char *)"invalid stored block lengths";
906 strm->msg = (char *)"too many length or distance symbols";
928 strm->msg = (char *)"invalid code lengths set";
951 strm->msg = (char *)"invalid bit length repeat";
974 strm->msg = (char *)"invalid bit length repeat";
988 strm->msg = (char *)"invalid code -- missing end-of-block";
1002 strm->msg = (char *)"invalid literal/lengths set";
1011 strm->msg = (char *)"invalid distances set";
1023 inflate_fast(strm, out);
1063 strm->msg = (char *)"invalid literal/length code";
1099 strm->msg = (char *)"invalid distance code";
1115 strm->msg = (char *)"invalid distance too far back";
1129 strm->msg = (char *)"invalid distance too far back";
1177 strm->total_out += out;
1180 strm->adler = state->check =
1188 strm->msg = (char *)"incorrect data check";
1201 strm->msg = (char *)"incorrect length check";
1231 if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
1233 if (updatewindow(strm, out)) {
1237 in -= strm->avail_in;
1238 out -= strm->avail_out;
1239 strm->total_in += in;
1240 strm->total_out += out;
1243 strm->adler = state->check =
1244 UPDATE(state->check, strm->next_out - out, out);
1245 strm->data_type = state->bits + (state->last ? 64 : 0) +
1253 int ZEXPORT inflateEnd(strm)
1254 z_streamp strm;
1257 if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
1259 state = (struct inflate_state FAR *)strm->state;
1260 if (state->window != Z_NULL) ZFREE(strm, state->window);
1261 ZFREE(strm, strm->state);
1262 strm->state = Z_NULL;
1267 int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
1268 z_streamp strm;
1279 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
1280 state = (struct inflate_state FAR *)strm->state;
1294 next = strm->next_out;
1295 avail = strm->avail_out;
1296 strm->next_out = (Bytef *)dictionary + dictLength;
1297 strm->avail_out = 0;
1298 ret = updatewindow(strm, dictLength);
1299 strm->avail_out = avail;
1300 strm->next_out = next;
1310 int ZEXPORT inflateGetHeader(strm, head)
1311 z_streamp strm;
1317 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
1318 state = (struct inflate_state FAR *)strm->state;
1361 int ZEXPORT inflateSync(strm)
1362 z_streamp strm;
1370 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
1371 state = (struct inflate_state FAR *)strm->state;
1372 if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
1390 len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
1391 strm->avail_in -= len;
1392 strm->next_in += len;
1393 strm->total_in += len;
1397 in = strm->total_in; out = strm->total_out;
1398 inflateReset(strm);
1399 strm->total_in = in; strm->total_out = out;
1412 int ZEXPORT inflateSyncPoint(strm)
1413 z_streamp strm;
1417 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
1418 state = (struct inflate_state FAR *)strm->state;
1469 int ZEXPORT inflateUndermine(strm, subvert)
1470 z_streamp strm;
1475 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
1476 state = (struct inflate_state FAR *)strm->state;
1486 long ZEXPORT inflateMark(strm)
1487 z_streamp strm;
1491 if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
1492 state = (struct inflate_state FAR *)strm->state;