60 pf->buf = rs_alloc(buf_len,
"file buffer");
61 pf->buf_len = buf_len;
70 rs_bzero(fb,
sizeof *fb);
86 assert(buf->
avail_in <= fb->buf_len);
87 assert(buf->
next_in >= fb->buf);
88 assert(buf->
next_in <= fb->buf + fb->buf_len);
94 rs_trace(
"seen end of file on input");
103 len = fread(fb->buf, 1, fb->buf_len, f);
107 rs_trace(
"seen end of file on input");
112 rs_error(
"error filling buf from file: %s", strerror(errno));
115 rs_error(
"no error bit, but got " FMT_SIZE
116 " return when trying to read", len);
149 assert(buf->
next_out <= fb->buf + fb->buf_len);
157 result = fwrite(fb->buf, 1, present, f);
158 if (present != result) {
159 rs_error(
"error draining buf to file: %s", strerror(errno));