librsync  2.0.1
Data Fields
rs_buffers_s Struct Reference

Description of input and output buffers. More...

Data Fields

char * next_in
 Next input byte. More...
 
size_t avail_in
 Number of bytes available at next_in References the length of available input. More...
 
int eof_in
 True if there is no more data after this. More...
 
char * next_out
 Next output byte should be put there References a pointer which on entry points to the start of the output buffer. More...
 
size_t avail_out
 Remaining free space at next_out. More...
 

Detailed Description

Description of input and output buffers.

On each call to rs_job_iter(), the caller can make available

Buffers must be allocated and passed in by the caller.

On input, the buffers structure must contain the address and length of the input and output buffers. The library updates these values to indicate the amount of remaining buffer. So, on return, avail_out is not the amount of output data produced, but rather the amount of output buffer space still available.

This means that the values on return are consistent with the values on entry, and suitable to be passed in on a second call, but they don't directly tell you how much output data was produced.

Note also that if *avail_in is nonzero on return, then not all of the input data has been consumed. The caller should either provide more output buffer space and call rs_job_iter() again passing the same next_in and avail_in, or put the remaining input data into some persistent buffer and call rs_job_iter() with it again when there is more output space.

See also
rs_job_iter()

Definition at line 361 of file librsync.h.

Field Documentation

§ next_in

char* rs_buffers_s::next_in

Next input byte.

References a pointer which on entry should point to the start of the data to be encoded. Updated to point to the byte after the last one consumed.

Definition at line 367 of file librsync.h.

§ avail_in

size_t rs_buffers_s::avail_in

Number of bytes available at next_in References the length of available input.

Updated to be the number of unused data bytes, which will be zero if all the input was consumed. May be zero if there is no new input, but the caller just wants to drain output.

Definition at line 376 of file librsync.h.

§ eof_in

int rs_buffers_s::eof_in

True if there is no more data after this.

Definition at line 381 of file librsync.h.

§ next_out

char* rs_buffers_s::next_out

Next output byte should be put there References a pointer which on entry points to the start of the output buffer.

Updated to point to the byte after the last one filled.

Definition at line 389 of file librsync.h.

§ avail_out

size_t rs_buffers_s::avail_out

Remaining free space at next_out.

References the size of available output buffer. Updated to the size of unused output buffer.

Definition at line 397 of file librsync.h.


The documentation for this struct was generated from the following file: