\doxysubsection{rs\+\_\+buffers\+\_\+s Struct Reference}
\label{structrs__buffers__s}\index{rs\_buffers\_s@{rs\_buffers\_s}}


Description of input and output buffers.  




{\ttfamily \#include $<$librsync.\+h$>$}

\doxysubsubsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
char $\ast$ \mbox{\hyperlink{structrs__buffers__s_a6d5d12a1ced9a3a8891259e09c80ec20}{next\+\_\+in}}
\begin{DoxyCompactList}\small\item\em Next input byte. \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{structrs__buffers__s_a7bd5f1ea3c26587bf1106c1594712735}{avail\+\_\+in}}
\begin{DoxyCompactList}\small\item\em Number of bytes available at next\+\_\+in. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{structrs__buffers__s_aa6783da2d894c77178155759cd12d16f}{eof\+\_\+in}}
\begin{DoxyCompactList}\small\item\em True if there is no more data after this. \end{DoxyCompactList}\item 
char $\ast$ \mbox{\hyperlink{structrs__buffers__s_af3a6532c3e300a07783d61680cbdc11f}{next\+\_\+out}}
\begin{DoxyCompactList}\small\item\em Next output byte should be put there. \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{structrs__buffers__s_ae60f3db2f518d74aee13a02b7c9619a2}{avail\+\_\+out}}
\begin{DoxyCompactList}\small\item\em Remaining free space at next\+\_\+out. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
Description of input and output buffers. 

On each call to \mbox{\hyperlink{librsync_8h_aede8e0f42424b9aa29093f94b59ea029}{rs\+\_\+job\+\_\+iter()}}, the caller can make available


\begin{DoxyItemize}
\item \mbox{\hyperlink{structrs__buffers__s_a7bd5f1ea3c26587bf1106c1594712735}{avail\+\_\+in}} bytes of input data at \mbox{\hyperlink{structrs__buffers__s_a6d5d12a1ced9a3a8891259e09c80ec20}{next\+\_\+in}}
\item \mbox{\hyperlink{structrs__buffers__s_ae60f3db2f518d74aee13a02b7c9619a2}{avail\+\_\+out}} bytes of output space at \mbox{\hyperlink{structrs__buffers__s_af3a6532c3e300a07783d61680cbdc11f}{next\+\_\+out}}
\item or some of both
\end{DoxyItemize}

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 {\bfseries{remaining}} buffer. So, on return, \mbox{\hyperlink{structrs__buffers__s_ae60f3db2f518d74aee13a02b7c9619a2}{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\textquotesingle{}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 \mbox{\hyperlink{structrs__buffers__s_a7bd5f1ea3c26587bf1106c1594712735}{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 \mbox{\hyperlink{librsync_8h_aede8e0f42424b9aa29093f94b59ea029}{rs\+\_\+job\+\_\+iter()}} again.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{librsync_8h_aede8e0f42424b9aa29093f94b59ea029}{rs\+\_\+job\+\_\+iter()}} 
\end{DoxySeeAlso}


Definition at line \mbox{\hyperlink{librsync_8h_source_l00328}{328}} of file \mbox{\hyperlink{librsync_8h_source}{librsync.\+h}}.



\doxysubsubsection{Field Documentation}
\mbox{\label{structrs__buffers__s_a6d5d12a1ced9a3a8891259e09c80ec20}} 
\index{rs\_buffers\_s@{rs\_buffers\_s}!next\_in@{next\_in}}
\index{next\_in@{next\_in}!rs\_buffers\_s@{rs\_buffers\_s}}
\doxyparagraph{\texorpdfstring{next\_in}{next\_in}}
{\footnotesize\ttfamily char$\ast$ 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 \mbox{\hyperlink{librsync_8h_source_l00334}{334}} of file \mbox{\hyperlink{librsync_8h_source}{librsync.\+h}}.

\mbox{\label{structrs__buffers__s_a7bd5f1ea3c26587bf1106c1594712735}} 
\index{rs\_buffers\_s@{rs\_buffers\_s}!avail\_in@{avail\_in}}
\index{avail\_in@{avail\_in}!rs\_buffers\_s@{rs\_buffers\_s}}
\doxyparagraph{\texorpdfstring{avail\_in}{avail\_in}}
{\footnotesize\ttfamily 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 \mbox{\hyperlink{librsync_8h_source_l00342}{342}} of file \mbox{\hyperlink{librsync_8h_source}{librsync.\+h}}.

\mbox{\label{structrs__buffers__s_aa6783da2d894c77178155759cd12d16f}} 
\index{rs\_buffers\_s@{rs\_buffers\_s}!eof\_in@{eof\_in}}
\index{eof\_in@{eof\_in}!rs\_buffers\_s@{rs\_buffers\_s}}
\doxyparagraph{\texorpdfstring{eof\_in}{eof\_in}}
{\footnotesize\ttfamily int rs\+\_\+buffers\+\_\+s\+::eof\+\_\+in}



True if there is no more data after this. 



Definition at line \mbox{\hyperlink{librsync_8h_source_l00345}{345}} of file \mbox{\hyperlink{librsync_8h_source}{librsync.\+h}}.

\mbox{\label{structrs__buffers__s_af3a6532c3e300a07783d61680cbdc11f}} 
\index{rs\_buffers\_s@{rs\_buffers\_s}!next\_out@{next\_out}}
\index{next\_out@{next\_out}!rs\_buffers\_s@{rs\_buffers\_s}}
\doxyparagraph{\texorpdfstring{next\_out}{next\_out}}
{\footnotesize\ttfamily char$\ast$ 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 \mbox{\hyperlink{librsync_8h_source_l00351}{351}} of file \mbox{\hyperlink{librsync_8h_source}{librsync.\+h}}.

\mbox{\label{structrs__buffers__s_ae60f3db2f518d74aee13a02b7c9619a2}} 
\index{rs\_buffers\_s@{rs\_buffers\_s}!avail\_out@{avail\_out}}
\index{avail\_out@{avail\_out}!rs\_buffers\_s@{rs\_buffers\_s}}
\doxyparagraph{\texorpdfstring{avail\_out}{avail\_out}}
{\footnotesize\ttfamily 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 \mbox{\hyperlink{librsync_8h_source_l00357}{357}} of file \mbox{\hyperlink{librsync_8h_source}{librsync.\+h}}.



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{librsync_8h}{librsync.\+h}}\end{DoxyCompactItemize}
