Lines Matching refs:stream
84 z_stream stream;
85 int z_err; /* error code for last stream operation */
138 s->stream.zalloc = (alloc_func)0;
139 s->stream.zfree = (free_func)0;
140 s->stream.opaque = (voidpf)0;
141 s->stream.next_in = s->inbuf = Z_NULL;
142 s->stream.next_out = s->outbuf = Z_NULL;
143 s->stream.avail_in = s->stream.avail_out = 0;
182 err = deflateInit2(&(s->stream), level,
186 s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
192 s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);
194 err = inflateInit2(&(s->stream), -MAX_WBITS);
197 * after the compressed stream in order to complete decompression and
199 * present after the compressed stream.
205 s->stream.avail_out = Z_BUFSIZE;
226 s->start = ftell(s->file) - s->stream.avail_in;
271 if (s->stream.avail_out == 0) {
273 s->stream.next_out = s->outbuf;
277 s->stream.avail_out = Z_BUFSIZE;
280 return deflateParams (&(s->stream), level, strategy);
286 IN assertion: the stream s has been sucessfully opened for reading.
292 if (s->stream.avail_in == 0) {
294 s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
295 if (s->stream.avail_in == 0) {
300 s->stream.next_in = s->inbuf;
302 s->stream.avail_in--;
303 return *(s->stream.next_in)++;
307 Check the gzip header of a gz_stream opened for reading. Set the stream
311 IN assertion: the stream s has already been created sucessfully;
312 s->stream.avail_in is zero for the first time, but may be non-zero
326 len = s->stream.avail_in;
328 if (len) s->inbuf[0] = s->stream.next_in[0];
332 s->stream.avail_in += len;
333 s->stream.next_in = s->inbuf;
334 if (s->stream.avail_in < 2) {
335 s->transparent = s->stream.avail_in;
341 if (s->stream.next_in[0] != gz_magic[0] ||
342 s->stream.next_in[1] != gz_magic[1]) {
346 s->stream.avail_in -= 2;
347 s->stream.next_in += 2;
391 if (s->stream.state != NULL) {
396 err = deflateEnd(&(s->stream));
399 err = inflateEnd(&(s->stream));
428 Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */
436 s->stream.next_out = (Bytef*)buf;
437 s->stream.avail_out = len;
439 if (s->stream.avail_out && s->back != EOF) {
441 s->stream.next_out++;
442 s->stream.avail_out--;
452 while (s->stream.avail_out != 0) {
456 uInt n = s->stream.avail_in;
457 if (n > s->stream.avail_out) n = s->stream.avail_out;
459 zmemcpy(s->stream.next_out, s->stream.next_in, n);
461 s->stream.next_out = next_out;
462 s->stream.next_in += n;
463 s->stream.avail_out -= n;
464 s->stream.avail_in -= n;
466 if (s->stream.avail_out > 0) {
467 s->stream.avail_out -=
468 (uInt)fread(next_out, 1, s->stream.avail_out, s->file);
470 len -= s->stream.avail_out;
476 if (s->stream.avail_in == 0 && !s->z_eof) {
479 s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
480 if (s->stream.avail_in == 0) {
487 s->stream.next_in = s->inbuf;
489 s->in += s->stream.avail_in;
490 s->out += s->stream.avail_out;
491 s->z_err = inflate(&(s->stream), Z_NO_FLUSH);
492 s->in -= s->stream.avail_in;
493 s->out -= s->stream.avail_out;
497 s->crc = z_crc32(s->crc, start, (uInt)(s->stream.next_out - start));
498 start = s->stream.next_out;
510 inflateReset(&(s->stream));
517 s->crc = z_crc32(s->crc, start, (uInt)(s->stream.next_out - start));
519 if (len == s->stream.avail_out &&
522 return (int)(len - s->stream.avail_out);
540 Push one byte back onto the stream.
595 s->stream.next_in = (Bytef*)buf;
596 s->stream.avail_in = len;
598 while (s->stream.avail_in != 0) {
600 if (s->stream.avail_out == 0) {
602 s->stream.next_out = s->outbuf;
607 s->stream.avail_out = Z_BUFSIZE;
609 s->in += s->stream.avail_in;
610 s->out += s->stream.avail_out;
611 s->z_err = deflate(&(s->stream), Z_NO_FLUSH);
612 s->in -= s->stream.avail_in;
613 s->out -= s->stream.avail_out;
618 return (int)(len - s->stream.avail_in);
742 s->stream.avail_in = 0; /* should be zero already anyway */
745 len = Z_BUFSIZE - s->stream.avail_out;
752 s->stream.next_out = s->outbuf;
753 s->stream.avail_out = Z_BUFSIZE;
756 s->out += s->stream.avail_out;
757 s->z_err = deflate(&(s->stream), flush);
758 s->out -= s->stream.avail_out;
766 done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
790 the beginning of the uncompressed stream, or -1 in case of error.
844 s->stream.avail_in = 0;
845 s->stream.next_in = s->inbuf;
894 s->stream.avail_in = 0;
895 s->stream.next_in = s->inbuf;
897 if (!s->transparent) (void)inflateReset(&s->stream);
906 uncompressed data stream.
916 input stream, otherwise zero.
925 * on a gz_stream. Handle end-of-stream error explicitly here.
1028 m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);