librsync  2.3.4
Data Fields
rs_buffers_s Struct Reference

Description of input and output buffers. More...

#include <librsync.h>

Data Fields

char * next_in
 Next input byte. More...
 
size_t avail_in
 Number of bytes available at next_in. More...
 
int eof_in
 True if there is no more data after this. More...
 
char * next_out
 Next output byte should be put there. 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.

If the input buffer was large enough, it will be processed directly, otherwise the data can be copied and accumulated into an internal buffer for processing. This means using larger buffers can be much more efficient.

Note also that if avail_in is nonzero on return, then not all of the input data has been consumed. This can happen either because it ran out of output buffer space, or because it processed as much data as possible directly from the input buffer and needs more input to proceed without copying into internal buffers. The caller should provide more output buffer space and/or pack the remaining input data into another buffer with more input before calling rs_job_iter() again.

See also
rs_job_iter()

Definition at line 328 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 334 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 342 of file librsync.h.

◆ eof_in

int rs_buffers_s::eof_in

True if there is no more data after this.

Definition at line 345 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 351 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 357 of file librsync.h.


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