Lines Matching refs:buf
418 int ZEXPORT gzread (file, buf, len)
420 voidp buf;
424 Bytef *start = (Bytef*)buf; /* starting point for crc computation */
432 next_out = (Byte*)buf;
433 s->stream.next_out = (Bytef*)buf;
557 read, or a newline character is read and transferred to buf, or an
560 gzgets returns buf, or Z_NULL in case of error.
564 char * ZEXPORT gzgets(file, buf, len)
566 char *buf;
569 char *b = buf;
570 if (buf == Z_NULL || len <= 0) return Z_NULL;
572 while (--len > 0 && gzread(file, buf, 1) == 1 && *buf++ != '\n') ;
573 *buf = '\0';
574 return b == buf && len > 0 ? Z_NULL : b;
583 int ZEXPORT gzwrite (file, buf, len)
585 voidpc buf;
592 s->stream.next_in = (Bytef*)buf;
613 s->crc = crc32(s->crc, (const Bytef *)buf, len);
629 char buf[Z_PRINTF_BUFSIZE];
633 buf[sizeof(buf) - 1] = 0;
637 (void)vsprintf(buf, format, va);
639 for (len = 0; len < sizeof(buf); len++)
640 if (buf[len] == 0) break;
642 len = vsprintf(buf, format, va);
647 (void)vsnprintf(buf, sizeof(buf), format, va);
649 len = strlen(buf);
651 len = vsnprintf(buf, sizeof(buf), format, va);
655 if (len <= 0 || len >= (int)sizeof(buf) || buf[sizeof(buf) - 1] != 0)
657 return gzwrite(file, buf, (unsigned)len);
668 char buf[Z_PRINTF_BUFSIZE];
671 buf[sizeof(buf) - 1] = 0;
674 sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
676 for (len = 0; len < sizeof(buf); len++)
677 if (buf[len] == 0) break;
679 len = sprintf(buf, format, a1, a2, a3, a4, a5, a6, a7, a8,
684 snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
686 len = strlen(buf);
688 len = snprintf(buf, sizeof(buf), format, a1, a2, a3, a4, a5, a6, a7, a8,
692 if (len <= 0 || len >= sizeof(buf) || buf[sizeof(buf) - 1] != 0)
694 return gzwrite(file, buf, len);