Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

rs_buffers_s Struct Reference

Stream through which the calling application feeds data to and from the library. More...

#include <rsync.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

Stream through which the calling application feeds data to and from the library.

On each call to rs_job_iter, the caller can make available

Buffers must be allocated and passed in by the caller. This routine never allocates, reallocates or frees buffers.

Pay attention to the meaning of the returned pointer and length values. They do not indicate the location and amount of returned data. Rather, if *out_ptr was originally set to out_buf, then the output data begins at out_buf, and has length *out_ptr - out_buf.

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_work() again passing the same next_in and avail_in, or put the remaining input data into some persistent buffer and call rs_work() with it again when there is more output space.

Parameters:
next_in   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.
avail_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.
next_out   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.
avail_out   References the size of available output buffer. Updated to the size of unused output buffer.

Returns:
The rs_result that caused iteration to stop.

See also:
rs_buffers_t , Buffers


Field Documentation

char * rs_buffers_s::next_in
 

Next input byte.

size_t rs_buffers_s::avail_in
 

Number of bytes available at next_in.

int rs_buffers_s::eof_in
 

True if there is no more data after this.

char * rs_buffers_s::next_out
 

Next output byte should be put there.

size_t rs_buffers_s::avail_out
 

Remaining free space at next_out.


The documentation for this struct was generated from the following file:
Generated at Sun Mar 18 16:54:50 2001 for librsync by doxygen 1.2.5 written by Dimitri van Heesch, © 1997-2001