40 #include <sys/types.h>
64 pf->buf = rs_alloc(buf_len,
"file buffer");
65 pf->buf_len = buf_len;
74 rs_bzero(fb,
sizeof *fb);
90 assert(buf->
avail_in <= fb->buf_len);
91 assert(buf->
next_in >= fb->buf);
92 assert(buf->
next_in <= fb->buf + fb->buf_len);
98 rs_trace(
"seen end of file on input");
107 len = fread(fb->buf, 1, fb->buf_len, f);
111 rs_trace(
"seen end of file on input");
116 rs_error(
"error filling buf from file: %s", strerror(errno));
119 rs_error(
"no error bit, but got " FMT_SIZE
120 " return when trying to read", len);
153 assert(buf->
next_out <= fb->buf + fb->buf_len);
161 result = fwrite(fb->buf, 1, present, f);
162 if (present != result) {
163 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.
of this structure are private.