Lines Matching defs:stream

63     z_stream stream;
64 int z_err; /* error code for last stream operation */
74 int fatal; /* fatal stream error => all other ops fail */
125 s->stream.zalloc = (alloc_func)0;
126 s->stream.zfree = (free_func)0;
127 s->stream.opaque = (voidpf)0;
128 s->stream.next_in = s->inbuf = Z_NULL;
129 s->stream.next_out = s->outbuf = Z_NULL;
130 s->stream.avail_in = s->stream.avail_out = 0;
186 err = deflateInit2(&(s->stream), level,
190 s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE);
198 s->stream.next_in = s->inbuf = (Byte*)ALLOC((len > Z_BUFSIZE) ? len : Z_BUFSIZE);
200 s->stream.avail_in = len;
207 err = inflateInit2(&(s->stream), -MAX_WBITS);
210 * after the compressed stream in order to complete decompression and
212 * present after the compressed stream.
218 s->stream.avail_out = Z_BUFSIZE;
241 s->start = s->stream.next_in - s->inbuf;
284 Associate a gzFile with the stdio stream fp.
313 if (s->stream.avail_out == 0) {
315 s->stream.next_out = s->outbuf;
319 s->stream.avail_out = Z_BUFSIZE;
322 return deflateParams (&(s->stream), level, strategy);
328 IN assertion: the stream s has been sucessfully opened for reading.
334 if (s->stream.avail_in == 0) {
336 s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
337 if (s->stream.avail_in == 0) {
342 s->stream.next_in = s->inbuf;
344 s->stream.avail_in--;
345 return *(s->stream.next_in)++;
349 Check the gzip header of a gz_stream opened for reading. Set the stream
353 IN assertion: the stream s has already been created sucessfully;
354 s->stream.avail_in is zero for the first time, but may be non-zero
370 if (len != 0) s->stream.avail_in++, s->stream.next_in--;
372 s->stream.avail_in++, s->stream.next_in--;
375 s->z_err = s->stream.avail_in != 0 ? Z_OK : Z_STREAM_END;
383 len = s->stream.avail_in;
385 if (len) s->inbuf[0] = s->stream.next_in[0];
389 s->stream.avail_in += len;
390 s->stream.next_in = s->inbuf;
391 if (s->stream.avail_in < 2) {
392 s->transparent = s->stream.avail_in;
398 if (s->stream.next_in[0] != gz_magic[0] ||
399 s->stream.next_in[1] != gz_magic[1]) {
403 s->stream.avail_in -= 2;
404 s->stream.next_in += 2;
450 if (s->stream.state != NULL) {
455 err = deflateEnd(&(s->stream));
458 err = inflateEnd(&(s->stream));
491 Byte *next_out; /* == stream.next_out but not forced far (for ZLIB_MSDOS) */
499 s->stream.next_out = (Bytef*)buf;
500 s->stream.avail_out = len;
502 if (s->stream.avail_out && s->back != EOF) {
504 s->stream.next_out++;
505 s->stream.avail_out--;
515 while (s->stream.avail_out != 0) {
519 uInt n = s->stream.avail_in;
520 if (n > s->stream.avail_out) n = s->stream.avail_out;
522 zmemcpy(s->stream.next_out, s->stream.next_in, n);
524 s->stream.next_out = next_out;
525 s->stream.next_in += n;
526 s->stream.avail_out -= n;
527 s->stream.avail_in -= n;
529 if (s->stream.avail_out > 0) {
530 s->stream.avail_out -=
531 (uInt)fread(next_out, 1, s->stream.avail_out, s->file);
533 len -= s->stream.avail_out;
539 if (s->stream.avail_in == 0 && !s->z_eof) {
542 s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file);
543 if (s->stream.avail_in == 0) {
550 s->stream.next_in = s->inbuf;
552 s->in += s->stream.avail_in;
553 s->out += s->stream.avail_out;
554 s->z_err = inflate(&(s->stream), Z_NO_FLUSH);
555 s->in -= s->stream.avail_in;
556 s->out -= s->stream.avail_out;
563 s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
564 start = s->stream.next_out;
580 inflateReset(&(s->stream));
597 s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start));
599 if (len == s->stream.avail_out &&
602 return (int)(len - s->stream.avail_out);
620 Push one byte back onto the stream.
675 s->stream.next_in = (Bytef*)buf;
676 s->stream.avail_in = len;
678 while (s->stream.avail_in != 0) {
680 if (s->stream.avail_out == 0) {
682 s->stream.next_out = s->outbuf;
687 s->stream.avail_out = Z_BUFSIZE;
689 s->in += s->stream.avail_in;
690 s->out += s->stream.avail_out;
691 s->z_err = deflate(&(s->stream), Z_NO_FLUSH);
692 s->in -= s->stream.avail_in;
693 s->out -= s->stream.avail_out;
698 return (int)(len - s->stream.avail_in);
860 s->stream.avail_in = 0; /* should be zero already anyway */
863 len = Z_BUFSIZE - s->stream.avail_out;
870 s->stream.next_out = s->outbuf;
871 s->stream.avail_out = Z_BUFSIZE;
874 s->out += s->stream.avail_out;
875 s->z_err = deflate(&(s->stream), flush);
876 s->out -= s->stream.avail_out;
884 done = (s->stream.avail_out != 0 || s->z_err == Z_STREAM_END);
908 the beginning of the uncompressed stream, or -1 in case of error.
962 s->stream.avail_in = 0;
963 s->stream.next_in = s->inbuf;
1012 s->stream.avail_in = 0;
1013 s->stream.next_in = s->inbuf;
1015 if (!s->transparent) (void)inflateReset(&s->stream);
1039 uncompressed data stream.
1049 input stream, otherwise zero.
1058 * on a gz_stream. Handle end-of-stream error explicitly here.
1161 m = (char*)(*errnum == Z_ERRNO ? zstrerror(errno) : s->stream.msg);