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));
Description of input and output buffers.
size_t avail_out
Remaining free space at next_out.
char * next_out
Next output byte should be put there.
size_t avail_in
Number of bytes available at next_in.
rs_long_t out_bytes
Total bytes written to output.
Error in file or network IO.
rs_stats_t stats
Encoding statistics.
rs_long_t in_bytes
Total bytes read from input.
Public header for librsync.
char * next_in
Next input byte.
rs_result
Return codes from nonblocking rsync operations.
int eof_in
True if there is no more data after this.
The contents of this structure are private.