Lines Matching refs:strm

137     z_stream strm = {0};        // inflate engine (gets fired up later)
150 if (strm.avail_in == 0) {
151 strm.avail_in = fread(buf, 1, sizeof(buf), in);
152 totin += strm.avail_in;
153 strm.next_in = buf;
154 if (strm.avail_in < sizeof(buf) && ferror(in)) {
165 mode = strm.avail_in == 0 ? RAW : // empty -- will fail
166 (strm.next_in[0] & 0xf) == 8 ? ZLIB :
167 strm.next_in[0] == 0x1f ? GZIP :
169 ret = inflateInit2(&strm, mode);
177 if (strm.avail_out == 0) {
178 strm.avail_out = sizeof(win);
179 strm.next_out = win;
186 strm.data_type = 0x80;
189 unsigned before = strm.avail_out;
190 ret = inflate(&strm, Z_BLOCK);
191 totout += before - strm.avail_out;
194 if ((strm.data_type & 0xc0) == 0x80 &&
201 index = add_point(index, strm.data_type & 7, totin - strm.avail_in,
202 totout, strm.avail_out, win);
211 (strm.avail_in || ungetc(getc(in), in) != EOF))
215 ret = inflateReset2(&strm, GZIP);
220 inflateEnd(&strm);
279 static int inflatePreface(z_stream *strm, int bits, int value)
282 if (strm == Z_NULL || bits < 0 || bits > 16)
322 strm->avail_in = have >> 3;
323 strm->next_in = in;
324 strm->avail_out = 0;
325 strm->next_out = in; // not used, but can't be NULL
326 return inflate(strm, Z_NO_FLUSH);
364 z_stream strm = {0};
365 ret = inflateInit2(&strm, RAW);
369 INFLATEPRIME(&strm, point->bits, ch >> (8 - point->bits));
370 inflateSetDictionary(&strm, point->window, WINSIZE);
380 strm.avail_out = offset < WINSIZE ? (unsigned)offset : WINSIZE;
381 strm.next_out = discard;
385 strm.avail_out = left < UINT_MAX ? (unsigned)left : UINT_MAX;
386 strm.next_out = buf + len - left;
390 if (strm.avail_in == 0) {
392 strm.avail_in = fread(input, 1, CHUNK, in);
393 if (strm.avail_in < CHUNK && ferror(in)) {
397 strm.next_in = input;
399 unsigned got = strm.avail_out;
400 ret = inflate(&strm, Z_NO_FLUSH);
401 got -= strm.avail_out;
414 if (strm.avail_in >= drop) {
415 strm.avail_in -= drop;
416 strm.next_in += drop;
420 drop -= strm.avail_in;
421 strm.avail_in = 0;
429 if (strm.avail_in || ungetc(getc(in), in) != EOF) {
432 inflateReset2(&strm, GZIP);
434 if (strm.avail_in == 0) {
435 strm.avail_in = fread(input, 1, CHUNK, in);
436 if (strm.avail_in < CHUNK && ferror(in)) {
440 strm.next_in = input;
442 strm.avail_out = WINSIZE;
443 strm.next_out = discard;
444 ret = inflate(&strm, Z_BLOCK); // stop at end of header
445 } while (ret == Z_OK && (strm.data_type & 0x80) == 0);
448 inflateReset2(&strm, RAW);
455 inflateEnd(&strm);