Lines Matching defs:strm

575 #define inflateInit2(strm, windowBits) \
576 inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
804 #define ZALLOC(strm, items, size) \
805 (*((strm)->zalloc))((strm)->opaque, (items), (size))
806 #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
1305 z_streamp strm; /* pointer back to this zlib stream */
2040 strm->avail_in >= 6
2041 strm->avail_out >= 258
2042 start >= strm->avail_out
2056 Therefore if strm->avail_in >= 6, then there is enough input to avoid
2061 requires strm->avail_out >= 258 for each loop to avoid checking for
2064 void inflate_fast(strm, start)
2065 z_streamp strm;
2066 unsigned start; /* inflate()'s starting value for strm->avail_out */
2069 unsigned char FAR *in; /* local strm->next_in */
2071 unsigned char FAR *out; /* local strm->next_out */
2072 unsigned char FAR *beg; /* inflate()'s initial strm->next_out */
2081 unsigned long hold; /* local strm->hold */
2082 unsigned bits; /* local strm->bits */
2083 code const FAR *lcode; /* local strm->lencode */
2084 code const FAR *dcode; /* local strm->distcode */
2095 state = (struct inflate_state FAR *)strm->state;
2096 in = strm->next_in - OFF;
2097 last = in + (strm->avail_in - 5);
2098 out = strm->next_out - OFF;
2099 beg = out - (start - strm->avail_out);
2100 end = out + (strm->avail_out - 257);
2175 strm->msg = (char *)"invalid distance too far back";
2187 strm->msg = (char *)"invalid distance too far back";
2263 strm->msg = (char *)"invalid distance code";
2278 strm->msg = (char *)"invalid literal/length code";
2291 strm->next_in = in + OFF;
2292 strm->next_out = out + OFF;
2293 strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
2294 strm->avail_out = (unsigned)(out < end ?
2322 local int updatewindow OF((z_streamp strm, unsigned out));
2329 int ZEXPORT inflateReset(strm)
2330 z_streamp strm;
2334 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
2335 state = (struct inflate_state FAR *)strm->state;
2336 strm->total_in = strm->total_out = state->total = 0;
2337 strm->msg = Z_NULL;
2338 strm->adler = 1; /* to support ill-conceived Java test suite */
2354 int ZEXPORT inflatePrime(strm, bits, value)
2355 z_streamp strm;
2361 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
2362 state = (struct inflate_state FAR *)strm->state;
2370 int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
2371 z_streamp strm;
2381 if (strm == Z_NULL) return Z_STREAM_ERROR;
2382 strm->msg = Z_NULL; /* in case we return an error */
2383 if (strm->zalloc == (alloc_func)0) {
2384 strm->zalloc = zcalloc;
2385 strm->opaque = (voidpf)0;
2387 if (strm->zfree == (free_func)0) strm->zfree = zcfree;
2389 ZALLOC(strm, 1, sizeof(struct inflate_state));
2392 strm->state = (struct internal_state FAR *)state;
2404 ZFREE(strm, state);
2405 strm->state = Z_NULL;
2410 return inflateReset(strm);
2413 int ZEXPORT inflateInit_(strm, version, stream_size)
2414 z_streamp strm;
2418 return inflateInit2_(strm, DEF_WBITS, version, stream_size);
2542 local int updatewindow(strm, out)
2543 z_streamp strm;
2549 state = (struct inflate_state FAR *)strm->state;
2554 ZALLOC(strm, ((unsigned int)1) << state->wbits,
2567 copy = out - strm->avail_out;
2569 zmemcpy(state->window, strm->next_out - state->wsize, state->wsize);
2576 zmemcpy(state->window + state->write, strm->next_out - copy, dist);
2579 zmemcpy(state->window, strm->next_out - copy, copy);
2624 put = strm->next_out; \
2625 left = strm->avail_out; \
2626 next = strm->next_in; \
2627 have = strm->avail_in; \
2635 strm->next_out = put; \
2636 strm->avail_out = left; \
2637 strm->next_in = next; \
2638 strm->avail_in = have; \
2756 Progress is defined as a change in either strm->avail_in or strm->avail_out.
2764 strm->next_out, given the space available and the provided input--the effect
2773 int ZEXPORT inflate(strm, flush)
2774 z_streamp strm;
2796 if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL ||
2797 (strm->next_in == Z_NULL && strm->avail_in != 0))
2800 state = (struct inflate_state FAR *)strm->state;
2830 strm->msg = (char *)"incorrect header check";
2835 strm->msg = (char *)"unknown compression method";
2842 strm->msg = (char *)"invalid window size";
2848 strm->adler = state->check = adler32(0L, Z_NULL, 0);
2857 strm->msg = (char *)"unknown compression method";
2862 strm->msg = (char *)"unknown header flags set";
2966 strm->msg = (char *)"header crc mismatch";
2976 strm->adler = state->check = crc32(0L, Z_NULL, 0);
2982 strm->adler = state->check = REVERSE(hold);
2990 strm->adler = state->check = adler32(0L, Z_NULL, 0);
3021 strm->msg = (char *)"invalid block type";
3030 strm->msg = (char *)"invalid stored block lengths";
3066 strm->msg = (char *)"too many length or distance symbols";
3088 strm->msg = (char *)"invalid code lengths set";
3112 strm->msg = (char *)"invalid bit length repeat";
3135 strm->msg = (char *)"invalid bit length repeat";
3154 strm->msg = (char *)"invalid literal/lengths set";
3163 strm->msg = (char *)"invalid distances set";
3172 inflate_fast(strm, out);
3206 strm->msg = (char *)"invalid literal/length code";
3238 strm->msg = (char *)"invalid distance code";
3253 strm->msg = (char *)"invalid distance too far back";
3259 strm->msg = (char *)"invalid distance too far back";
3300 strm->total_out += out;
3303 strm->adler = state->check =
3311 strm->msg = (char *)"incorrect data check";
3324 strm->msg = (char *)"incorrect length check";
3354 if (state->wsize || (state->mode < CHECK && out != strm->avail_out))
3355 if (updatewindow(strm, out)) {
3359 in -= strm->avail_in;
3360 out -= strm->avail_out;
3361 strm->total_in += in;
3362 strm->total_out += out;
3365 strm->adler = state->check =
3366 UPDATE(state->check, strm->next_out - out, out);
3367 strm->data_type = state->bits + (state->last ? 64 : 0) +
3374 int ZEXPORT inflateEnd(strm)
3375 z_streamp strm;
3378 if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
3380 state = (struct inflate_state FAR *)strm->state;
3381 if (state->window != Z_NULL) ZFREE(strm, state->window);
3382 ZFREE(strm, strm->state);
3383 strm->state = Z_NULL;
3388 int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
3389 z_streamp strm;
3397 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
3398 state = (struct inflate_state FAR *)strm->state;
3411 if (updatewindow(strm, strm->avail_out)) {
3430 int ZEXPORT inflateGetHeader(strm, head)
3431 z_streamp strm;
3437 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
3438 state = (struct inflate_state FAR *)strm->state;
3483 int ZEXPORT inflateSync(strm)
3484 z_streamp strm;
3492 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
3493 state = (struct inflate_state FAR *)strm->state;
3494 if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
3512 len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
3513 strm->avail_in -= len;
3514 strm->next_in += len;
3515 strm->total_in += len;
3519 in = strm->total_in; out = strm->total_out;
3520 inflateReset(strm);
3521 strm->total_in = in; strm->total_out = out;
3534 int ZEXPORT inflateSyncPoint(strm)
3535 z_streamp strm;
3539 if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
3540 state = (struct inflate_state FAR *)strm->state;