Lines Matching defs:strm
134 z_stream strm = {0}; // inflate engine (gets fired up later)
147 if (strm.avail_in == 0) {
148 strm.avail_in = fread(buf, 1, sizeof(buf), in);
149 totin += strm.avail_in;
150 strm.next_in = buf;
151 if (strm.avail_in < sizeof(buf) && ferror(in)) {
162 mode = strm.avail_in == 0 ? RAW : // empty -- will fail
163 (strm.next_in[0] & 0xf) == 8 ? ZLIB :
164 strm.next_in[0] == 0x1f ? GZIP :
166 ret = inflateInit2(&strm, mode);
174 if (strm.avail_out == 0) {
175 strm.avail_out = sizeof(win);
176 strm.next_out = win;
183 strm.data_type = 0x80;
186 unsigned before = strm.avail_out;
187 ret = inflate(&strm, Z_BLOCK);
188 totout += before - strm.avail_out;
191 if ((strm.data_type & 0xc0) == 0x80 &&
198 index = add_point(index, strm.data_type & 7, totin - strm.avail_in,
199 totout, strm.avail_out, win);
208 (strm.avail_in || ungetc(getc(in), in) != EOF))
212 ret = inflateReset2(&strm, GZIP);
217 inflateEnd(&strm);
276 static int inflatePreface(z_stream *strm, int bits, int value) {
278 if (strm == Z_NULL || bits < 0 || bits > 16)
318 strm->avail_in = have >> 3;
319 strm->next_in = in;
320 strm->avail_out = 0;
321 strm->next_out = in; // not used, but can't be NULL
322 return inflate(strm, Z_NO_FLUSH);
359 z_stream strm = {0};
360 ret = inflateInit2(&strm, RAW);
364 INFLATEPRIME(&strm, point->bits, ch >> (8 - point->bits));
365 inflateSetDictionary(&strm, point->window, WINSIZE);
375 strm.avail_out = offset < WINSIZE ? (unsigned)offset : WINSIZE;
376 strm.next_out = discard;
380 strm.avail_out = left < UINT_MAX ? (unsigned)left : UINT_MAX;
381 strm.next_out = buf + len - left;
385 if (strm.avail_in == 0) {
387 strm.avail_in = fread(input, 1, CHUNK, in);
388 if (strm.avail_in < CHUNK && ferror(in)) {
392 strm.next_in = input;
394 unsigned got = strm.avail_out;
395 ret = inflate(&strm, Z_NO_FLUSH);
396 got -= strm.avail_out;
409 if (strm.avail_in >= drop) {
410 strm.avail_in -= drop;
411 strm.next_in += drop;
415 drop -= strm.avail_in;
416 strm.avail_in = 0;
424 if (strm.avail_in || ungetc(getc(in), in) != EOF) {
427 inflateReset2(&strm, GZIP);
429 if (strm.avail_in == 0) {
430 strm.avail_in = fread(input, 1, CHUNK, in);
431 if (strm.avail_in < CHUNK && ferror(in)) {
435 strm.next_in = input;
437 strm.avail_out = WINSIZE;
438 strm.next_out = discard;
439 ret = inflate(&strm, Z_BLOCK); // stop at end of header
440 } while (ret == Z_OK && (strm.data_type & 0x80) == 0);
443 inflateReset2(&strm, RAW);
450 inflateEnd(&strm);