\doxysubsection{delta.\+c File Reference}
\label{delta_8c}\index{delta.c@{delta.c}}


Generate in streaming mode an rsync delta given a set of signatures, and a new file.  


Include dependency graph for delta.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{delta_8c__incl}
\end{center}
\end{figure}
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{delta_8c_ad38b7f45cf4177503166b0d00af71cff}{MAX\+\_\+\+MISS\+\_\+\+LEN}}~(\mbox{\hyperlink{job_8h_abdbdf5fbcdaed953e687867db175e4c5}{MAX\+\_\+\+DELTA\+\_\+\+CMD}} -\/ 3)
\begin{DoxyCompactList}\small\item\em Max length of a miss is 64K including 3 command bytes. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{delta_8c_a6a992cf5dc0916678a7094c21b85d5fe}{rs\+\_\+delta\+\_\+s\+\_\+scan}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job)
\begin{DoxyCompactList}\small\item\em Get a block of data if possible, and see if it matches. \end{DoxyCompactList}\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{delta_8c_a55891ddb7cdcd5790b38ced140734102}{rs\+\_\+delta\+\_\+s\+\_\+flush}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job)
\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{delta_8c_afd7b048f68dab7cb6fc927802823ea4e}{rs\+\_\+delta\+\_\+s\+\_\+end}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job)
\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{delta_8c_a5892bb518dcd0dd6ae8114e84a97cbc8}{rs\+\_\+getinput}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job, size\+\_\+t block\+\_\+len)
\item 
static int \mbox{\hyperlink{delta_8c_a02cb5f8a81c7cb63d2557023c56929e7}{rs\+\_\+findmatch}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job, rs\+\_\+long\+\_\+t $\ast$match\+\_\+pos, size\+\_\+t $\ast$match\+\_\+len)
\begin{DoxyCompactList}\small\item\em find a match at scan\+\_\+pos, returning the match\+\_\+pos and match\+\_\+len. \end{DoxyCompactList}\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{delta_8c_acc386d6304337b138b79b5712c15931a}{rs\+\_\+appendmatch}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job, rs\+\_\+long\+\_\+t match\+\_\+pos, size\+\_\+t match\+\_\+len)
\begin{DoxyCompactList}\small\item\em Append a match at match\+\_\+pos of length match\+\_\+len to the delta, extending a previous match if possible, or flushing any previous miss/match. \end{DoxyCompactList}\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{delta_8c_a832b35b9afeeb51561f08daf13738571}{rs\+\_\+appendmiss}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job, size\+\_\+t miss\+\_\+len)
\begin{DoxyCompactList}\small\item\em Append a miss of length miss\+\_\+len to the delta, extending a previous miss if possible, or flushing any previous match. \end{DoxyCompactList}\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{delta_8c_a8c7bfd74ede4c7fa74eeca10bb5d6679}{rs\+\_\+appendflush}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job)
\begin{DoxyCompactList}\small\item\em Flush any accumulating hit or miss, appending it to the delta. \end{DoxyCompactList}\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{delta_8c_a2e40db810b7290fe6d5fd1be2656e04d}{rs\+\_\+processmatch}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job)
\begin{DoxyCompactList}\small\item\em Process matching data in the scoop. \end{DoxyCompactList}\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{delta_8c_a17e651660e2da438be938cfcf4f5d0b7}{rs\+\_\+processmiss}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job)
\begin{DoxyCompactList}\small\item\em Process miss data in the scoop. \end{DoxyCompactList}\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{delta_8c_a761d7df9081cf4ab4510e1cebc7c604a}{rs\+\_\+delta\+\_\+s\+\_\+slack}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job)
\begin{DoxyCompactList}\small\item\em State function that does a slack delta containing only literal data to recreate the input. \end{DoxyCompactList}\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{delta_8c_a8df6a969396ff04b72ebff623ec4c603}{rs\+\_\+delta\+\_\+s\+\_\+header}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job)
\begin{DoxyCompactList}\small\item\em State function for writing out the header of the encoding job. \end{DoxyCompactList}\item 
\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$ \mbox{\hyperlink{delta_8c_a59fe8536218632417097d084606bb675}{rs\+\_\+delta\+\_\+begin}} (\mbox{\hyperlink{librsync_8h_afb2a9cb505daeb8e519d06686f5caabf}{rs\+\_\+signature\+\_\+t}} $\ast$sig)
\begin{DoxyCompactList}\small\item\em Prepare to compute a streaming delta. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
Generate in streaming mode an rsync delta given a set of signatures, and a new file. 

The size of blocks for signature generation is determined by the block size in the incoming signature.

To calculate a signature, we need to be able to see at least one block of the new file at a time. Once we have that, we calculate its weak signature, and see if there is any block in the signature hash table that has the same weak sum. If there is one, then we also compute the strong sum of the new block, and cross check that. If they\textquotesingle{}re the same, then we can assume we have a match.

The final block of the file has to be handled a little differently, because it may be a short match. Short blocks in the signature don\textquotesingle{}t include their length -- we just allow for the final short block of the file to match any block in the signature, and if they have the same checksum we assume they must have the same length. Therefore, when we emit a COPY command, we have to send it with a length that is the same as the block matched, and not the block length from the signature.

Profiling results as of v1.\+26, 2001-\/03-\/18\+:

If everything matches, then we spend almost all our time in rs\+\_\+mdfour64 and rs\+\_\+weak\+\_\+sum, which is unavoidable and therefore a good profile.

If nothing matches, it is not so good.

2002-\/06-\/26\+: Donovan Baarda

The following is based entirely on pysync. It is much cleaner than the previous incarnation of this code. It is slightly complicated because in this case the output can block, so the main delta loop needs to stop when this happens.

In pysync a \textquotesingle{}last\textquotesingle{} attribute is used to hold the last miss or match for extending if possible. In this code, basis\+\_\+len and scan\+\_\+pos are used instead of \textquotesingle{}last\textquotesingle{}. When basis\+\_\+len \texorpdfstring{$>$}{>} 0, last is a match. When basis\+\_\+len = 0 and scan\+\_\+pos is \texorpdfstring{$>$}{>} 0, last is a miss. When both are 0, last is None (ie, nothing).

Pysync is also slightly different in that a \textquotesingle{}flush\textquotesingle{} method is available to force output of accumulated data. This \textquotesingle{}flush\textquotesingle{} is use to finalise delta calculation. In librsync input is terminated with an eof flag on the input stream. I have structured this code similar to pysync with a seperate flush function that is used when eof is reached. This allows for a flush style API if one is ever needed. Note that flush in pysync can be used for more than just terminating delta calculation, so a flush based API can in some ways be more flexible...

The input data is first scanned, then processed. Scanning identifies input data as misses or matches, and emits the instruction stream. Processing the data consumes it off the input scoop and outputs the processed miss data into the tube.

The scoop contains all data yet to be processed. The scan\+\_\+pos is an index into the scoop that indicates the point scanned to. As data is scanned, scan\+\_\+pos is incremented. As data is processed, it is removed from the scoop and scan\+\_\+pos adjusted. Everything gets complicated because the tube can block. When the tube is blocked, no data can be processed. 

Definition in file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.



\doxysubsubsection{Macro Definition Documentation}
\mbox{\label{delta_8c_ad38b7f45cf4177503166b0d00af71cff}} 
\index{delta.c@{delta.c}!MAX\_MISS\_LEN@{MAX\_MISS\_LEN}}
\index{MAX\_MISS\_LEN@{MAX\_MISS\_LEN}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{MAX\_MISS\_LEN}{MAX\_MISS\_LEN}}
{\footnotesize\ttfamily \#define MAX\+\_\+\+MISS\+\_\+\+LEN~(\mbox{\hyperlink{job_8h_abdbdf5fbcdaed953e687867db175e4c5}{MAX\+\_\+\+DELTA\+\_\+\+CMD}} -\/ 3)}



Max length of a miss is 64K including 3 command bytes. 



Definition at line \mbox{\hyperlink{delta_8c_source_l00103}{103}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.



\doxysubsubsection{Function Documentation}
\mbox{\label{delta_8c_a6a992cf5dc0916678a7094c21b85d5fe}} 
\index{delta.c@{delta.c}!rs\_delta\_s\_scan@{rs\_delta\_s\_scan}}
\index{rs\_delta\_s\_scan@{rs\_delta\_s\_scan}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_delta\_s\_scan()}{rs\_delta\_s\_scan()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} rs\+\_\+delta\+\_\+s\+\_\+scan (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Get a block of data if possible, and see if it matches. 

On each call, we try to process all of the input data available on the scoop and input buffer. 

Definition at line \mbox{\hyperlink{delta_8c_source_l00122}{122}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

\mbox{\label{delta_8c_a55891ddb7cdcd5790b38ced140734102}} 
\index{delta.c@{delta.c}!rs\_delta\_s\_flush@{rs\_delta\_s\_flush}}
\index{rs\_delta\_s\_flush@{rs\_delta\_s\_flush}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_delta\_s\_flush()}{rs\_delta\_s\_flush()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} rs\+\_\+delta\+\_\+s\+\_\+flush (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Definition at line \mbox{\hyperlink{delta_8c_source_l00164}{164}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

\mbox{\label{delta_8c_afd7b048f68dab7cb6fc927802823ea4e}} 
\index{delta.c@{delta.c}!rs\_delta\_s\_end@{rs\_delta\_s\_end}}
\index{rs\_delta\_s\_end@{rs\_delta\_s\_end}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_delta\_s\_end()}{rs\_delta\_s\_end()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} rs\+\_\+delta\+\_\+s\+\_\+end (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Definition at line \mbox{\hyperlink{delta_8c_source_l00204}{204}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

\mbox{\label{delta_8c_a5892bb518dcd0dd6ae8114e84a97cbc8}} 
\index{delta.c@{delta.c}!rs\_getinput@{rs\_getinput}}
\index{rs\_getinput@{rs\_getinput}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_getinput()}{rs\_getinput()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} rs\+\_\+getinput (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job,  }\item[{size\+\_\+t}]{block\+\_\+len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Definition at line \mbox{\hyperlink{delta_8c_source_l00210}{210}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

\mbox{\label{delta_8c_a02cb5f8a81c7cb63d2557023c56929e7}} 
\index{delta.c@{delta.c}!rs\_findmatch@{rs\_findmatch}}
\index{rs\_findmatch@{rs\_findmatch}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_findmatch()}{rs\_findmatch()}}
{\footnotesize\ttfamily static int rs\+\_\+findmatch (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job,  }\item[{rs\+\_\+long\+\_\+t $\ast$}]{match\+\_\+pos,  }\item[{size\+\_\+t $\ast$}]{match\+\_\+len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



find a match at scan\+\_\+pos, returning the match\+\_\+pos and match\+\_\+len. 

Note that this will calculate weak\+\_\+sum if required. It will also determine the match\+\_\+len.

This routine could be modified to do xdelta style matches that would extend matches past block boundaries by matching backwards and forwards beyond the block boundaries. Extending backwards would require decrementing scan\+\_\+pos as appropriate. 

Definition at line \mbox{\hyperlink{delta_8c_source_l00229}{229}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

\mbox{\label{delta_8c_acc386d6304337b138b79b5712c15931a}} 
\index{delta.c@{delta.c}!rs\_appendmatch@{rs\_appendmatch}}
\index{rs\_appendmatch@{rs\_appendmatch}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_appendmatch()}{rs\_appendmatch()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} rs\+\_\+appendmatch (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job,  }\item[{rs\+\_\+long\+\_\+t}]{match\+\_\+pos,  }\item[{size\+\_\+t}]{match\+\_\+len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Append a match at match\+\_\+pos of length match\+\_\+len to the delta, extending a previous match if possible, or flushing any previous miss/match. 



Definition at line \mbox{\hyperlink{delta_8c_source_l00258}{258}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

\mbox{\label{delta_8c_a832b35b9afeeb51561f08daf13738571}} 
\index{delta.c@{delta.c}!rs\_appendmiss@{rs\_appendmiss}}
\index{rs\_appendmiss@{rs\_appendmiss}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_appendmiss()}{rs\_appendmiss()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} rs\+\_\+appendmiss (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job,  }\item[{size\+\_\+t}]{miss\+\_\+len }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Append a miss of length miss\+\_\+len to the delta, extending a previous miss if possible, or flushing any previous match. 

This also breaks misses up into 32KB segments to avoid accumulating too much in memory. 

Definition at line \mbox{\hyperlink{delta_8c_source_l00288}{288}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

\mbox{\label{delta_8c_a8c7bfd74ede4c7fa74eeca10bb5d6679}} 
\index{delta.c@{delta.c}!rs\_appendflush@{rs\_appendflush}}
\index{rs\_appendflush@{rs\_appendflush}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_appendflush()}{rs\_appendflush()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} rs\+\_\+appendflush (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Flush any accumulating hit or miss, appending it to the delta. 



Definition at line \mbox{\hyperlink{delta_8c_source_l00302}{302}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

\mbox{\label{delta_8c_a2e40db810b7290fe6d5fd1be2656e04d}} 
\index{delta.c@{delta.c}!rs\_processmatch@{rs\_processmatch}}
\index{rs\_processmatch@{rs\_processmatch}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_processmatch()}{rs\_processmatch()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} rs\+\_\+processmatch (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Process matching data in the scoop. 

The scoop contains match data at scan\+\_\+buf of length scan\+\_\+pos. This function processes that match data, returning RS\+\_\+\+DONE if it completes, or RS\+\_\+\+BLOCKED if it gets blocked. After it completes scan\+\_\+pos is reset to still point at the next unscanned data.

This function currently just removes data from the scoop and adjusts scan\+\_\+pos appropriately. In the future this could be used for something like context compressing of miss data. Note that it also calls rs\+\_\+tube\+\_\+catchup to output any pending output. 

Definition at line \mbox{\hyperlink{delta_8c_source_l00332}{332}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

\mbox{\label{delta_8c_a17e651660e2da438be938cfcf4f5d0b7}} 
\index{delta.c@{delta.c}!rs\_processmiss@{rs\_processmiss}}
\index{rs\_processmiss@{rs\_processmiss}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_processmiss()}{rs\_processmiss()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} rs\+\_\+processmiss (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



Process miss data in the scoop. 

The scoop contains miss data at scan\+\_\+buf of length scan\+\_\+pos. This function processes that miss data, returning RS\+\_\+\+DONE if it completes, or RS\+\_\+\+BLOCKED if it gets blocked. After it completes scan\+\_\+pos is reset to still point at the next unscanned data.

This function uses rs\+\_\+tube\+\_\+copy to queue copying from the scoop into output. and uses rs\+\_\+tube\+\_\+catchup to do the copying. This automaticly removes data from the scoop, but this can block. While rs\+\_\+tube\+\_\+catchup is blocked, scan\+\_\+pos does not point at legit data, so scanning can also not proceed.

In the future this could do compression of miss data before outputing it. 

Definition at line \mbox{\hyperlink{delta_8c_source_l00355}{355}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

\mbox{\label{delta_8c_a761d7df9081cf4ab4510e1cebc7c604a}} 
\index{delta.c@{delta.c}!rs\_delta\_s\_slack@{rs\_delta\_s\_slack}}
\index{rs\_delta\_s\_slack@{rs\_delta\_s\_slack}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_delta\_s\_slack()}{rs\_delta\_s\_slack()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} rs\+\_\+delta\+\_\+s\+\_\+slack (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



State function that does a slack delta containing only literal data to recreate the input. 



Definition at line \mbox{\hyperlink{delta_8c_source_l00367}{367}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

\mbox{\label{delta_8c_a8df6a969396ff04b72ebff623ec4c603}} 
\index{delta.c@{delta.c}!rs\_delta\_s\_header@{rs\_delta\_s\_header}}
\index{rs\_delta\_s\_header@{rs\_delta\_s\_header}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_delta\_s\_header()}{rs\_delta\_s\_header()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} rs\+\_\+delta\+\_\+s\+\_\+header (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



State function for writing out the header of the encoding job. 



Definition at line \mbox{\hyperlink{delta_8c_source_l00384}{384}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

\mbox{\label{delta_8c_a59fe8536218632417097d084606bb675}} 
\index{delta.c@{delta.c}!rs\_delta\_begin@{rs\_delta\_begin}}
\index{rs\_delta\_begin@{rs\_delta\_begin}!delta.c@{delta.c}}
\doxyparagraph{\texorpdfstring{rs\_delta\_begin()}{rs\_delta\_begin()}}
{\footnotesize\ttfamily \mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$ rs\+\_\+delta\+\_\+begin (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_afb2a9cb505daeb8e519d06686f5caabf}{rs\+\_\+signature\+\_\+t}} $\ast$}]{sig }\end{DoxyParamCaption})}



Prepare to compute a streaming delta. 

\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000004}{Todo}}]Add a version of this that takes a \mbox{\hyperlink{librsync_8h_ab6abafd1db0a3947bb3c076507f4f7c2}{rs\+\_\+magic\+\_\+number}} controlling the delta format. \end{DoxyRefDesc}


Definition at line \mbox{\hyperlink{delta_8c_source_l00396}{396}} of file \mbox{\hyperlink{delta_8c_source}{delta.\+c}}.

