Home | History | Annotate | Download | only in zlib

Lines Matching full:len

293     uInt len;
299 len = s->stream.avail_in;
300 if (len < 2) {
301 if (len) s->inbuf[0] = s->stream.next_in[0];
303 len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file);
304 if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO;
305 s->stream.avail_in += len;
331 for (len = 0; len < 6; len++) (void)get_byte(s);
334 len = (uInt)get_byte(s);
335 len += ((uInt)get_byte(s))<<8;
336 /* len is garbage if EOF but the loop below will quit anyway */
337 while (len-- != 0 && get_byte(s) != EOF) ;
346 for (len = 0; len < 2; len++) (void)get_byte(s);
394 int ZEXPORT gzread (file, buf, len)
397 unsigned len;
410 s->stream.avail_out = len;
443 len -= s->stream.avail_out;
444 s->in += len;
445 s->out += len;
446 if (len == 0) s->z_eof = 1;
447 return (int)len;
492 if (len == s->stream.avail_out &&
495 return (int)(len - s->stream.avail_out);
532 Reads bytes from the compressed file until len-1 characters are
540 char * ZEXPORT gzgets(file, buf, len)
543 int len;
546 if (buf == Z_NULL || len <= 0) return Z_NULL;
548 while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ;
550 return b == buf && len > 0 ? Z_NULL : b;
559 int ZEXPORT gzwrite (file, buf, len)
562 unsigned len;
569 s->stream.avail_in = len;
589 s->crc = crc32(s->crc, (const Bytef *)buf, len);
591 return (int)(len - s->stream.avail_in);
607 int len;
615 for (len = 0; len < sizeof(buf); len++)
616 if (buf[len] == 0) break;
618 len = vsprintf(buf, format, va);
625 len = strlen(buf);
627 len = vsnprintf(buf, sizeof(buf), format, va);
631 if (len <= 0 || len >= (int)sizeof(buf) || buf[sizeof(buf) - 1] != 0)
633 return gzwrite(file, buf, (unsigned)len);
645 int len;
652 for (len = 0; len < sizeof(buf); len++)
653 if (buf[len] == 0) break;
655 len = sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
662 len = strlen(buf);
664 len = snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
668 if (len <= 0 || len >= sizeof(buf) || buf[sizeof(buf) - 1] != 0)
670 return gzwrite(file, buf, len);
709 uInt len;
718 len = Z_BUFSIZE - s->stream.avail_out;
720 if (len != 0) {
721 if ((uInt)fwrite(s->outbuf, 1, len, s->file) != len) {
734 if (len == 0 && s->z_err == Z_BUF_ERROR) s->z_err = Z_OK;