60 pf->buf = rs_alloc(buf_len,
"file buffer");
61 pf->buf_len = buf_len;
69 rs_bzero(fb,
sizeof *fb);
85 assert(buf->
avail_in <= fb->buf_len);
86 assert(buf->
next_in >= fb->buf);
87 assert(buf->
next_in <= fb->buf + fb->buf_len);
93 rs_trace(
"seen end of file on input");
101 len = fread(fb->buf, 1, fb->buf_len, f);
105 rs_trace(
"seen end of file on input");
110 rs_error(
"error filling buf from file: %s", strerror(errno));
113 rs_error(
"no error bit, but got " FMT_SIZE
114 " return when trying to read", len);
142 assert(buf->
next_out <= fb->buf + fb->buf_len);
144 size_t present = buf->
next_out - fb->buf;
146 size_t result = fwrite(fb->buf, 1, present, f);
147 if (present != result) {
148 rs_error(
"error draining buf to file: %s", strerror(errno));
Public header for librsync.
rs_result
Return codes from nonblocking rsync operations.
@ RS_DONE
Completed successfully.
@ RS_IO_ERROR
Error in file or network IO.
Description of input and output buffers.
char * next_in
Next input byte.
size_t avail_in
Number of bytes available at next_in.
int eof_in
True if there is no more data after this.
size_t avail_out
Remaining free space at next_out.
char * next_out
Next output byte should be put there.
The contents of this structure are private.
rs_stats_t stats
Encoding statistics.
rs_long_t out_bytes
Total bytes written to output.
rs_long_t in_bytes
Total bytes read from input.