\doxysubsection{mksum.\+c File Reference}
\label{mksum_8c}\index{mksum.c@{mksum.c}}


Generate file signatures.  


Include dependency graph for mksum.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{mksum_8c__incl}
\end{center}
\end{figure}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{mksum_8c_ad4778e00722fe9eb12d6a3b6aaa2de9b}{rs\+\_\+sig\+\_\+s\+\_\+header}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job)
\begin{DoxyCompactList}\small\item\em State of trying to send the signature header. \end{DoxyCompactList}\item 
static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} \mbox{\hyperlink{mksum_8c_a3273cf9cab28fa7335bea2b07cdb13ce}{rs\+\_\+sig\+\_\+s\+\_\+generate}} (\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$job)
\begin{DoxyCompactList}\small\item\em State of reading a block and trying to generate its sum. \end{DoxyCompactList}\item 
\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$ \mbox{\hyperlink{mksum_8c_a235b22a6cab09bc8ea073161dd2d861c}{rs\+\_\+sig\+\_\+begin}} (size\+\_\+t block\+\_\+len, size\+\_\+t strong\+\_\+len, \mbox{\hyperlink{librsync_8h_ab6abafd1db0a3947bb3c076507f4f7c2}{rs\+\_\+magic\+\_\+number}} sig\+\_\+magic)
\begin{DoxyCompactList}\small\item\em Start generating a signature. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
Generate file signatures. 

Generating checksums is pretty easy, since we can always just process whatever data is available. When a whole block has arrived, or we\textquotesingle{}ve reached the end of the file, we write the checksum out. 

Definition in file \mbox{\hyperlink{mksum_8c_source}{mksum.\+c}}.



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



State of trying to send the signature header. 



Definition at line \mbox{\hyperlink{mksum_8c_source_l00045}{45}} of file \mbox{\hyperlink{mksum_8c_source}{mksum.\+c}}.

\mbox{\label{mksum_8c_a3273cf9cab28fa7335bea2b07cdb13ce}} 
\index{mksum.c@{mksum.c}!rs\_sig\_s\_generate@{rs\_sig\_s\_generate}}
\index{rs\_sig\_s\_generate@{rs\_sig\_s\_generate}!mksum.c@{mksum.c}}
\doxyparagraph{\texorpdfstring{rs\_sig\_s\_generate()}{rs\_sig\_s\_generate()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{librsync_8h_a7feb858ceba3b8f3cf048d49be108253}{rs\+\_\+result}} rs\+\_\+sig\+\_\+s\+\_\+generate (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$}]{job }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



State of reading a block and trying to generate its sum. 



Definition at line \mbox{\hyperlink{mksum_8c_source_l00088}{88}} of file \mbox{\hyperlink{mksum_8c_source}{mksum.\+c}}.

\mbox{\label{mksum_8c_a235b22a6cab09bc8ea073161dd2d861c}} 
\index{mksum.c@{mksum.c}!rs\_sig\_begin@{rs\_sig\_begin}}
\index{rs\_sig\_begin@{rs\_sig\_begin}!mksum.c@{mksum.c}}
\doxyparagraph{\texorpdfstring{rs\_sig\_begin()}{rs\_sig\_begin()}}
{\footnotesize\ttfamily \mbox{\hyperlink{librsync_8h_add6622b38e3fa557301a190876d5ed4a}{rs\+\_\+job\+\_\+t}} $\ast$ rs\+\_\+sig\+\_\+begin (\begin{DoxyParamCaption}\item[{size\+\_\+t}]{block\+\_\+len,  }\item[{size\+\_\+t}]{strong\+\_\+len,  }\item[{\mbox{\hyperlink{librsync_8h_ab6abafd1db0a3947bb3c076507f4f7c2}{rs\+\_\+magic\+\_\+number}}}]{sig\+\_\+magic }\end{DoxyParamCaption})}



Start generating a signature. 

It\textquotesingle{}s recommended you use \mbox{\hyperlink{librsync_8h_a3c4c3fcea2814610109536f3ae029c5e}{rs\+\_\+sig\+\_\+args()}} to get the recommended arguments for this based on the original file size.

\begin{DoxyReturn}{Returns}
A new rs\+\_\+job\+\_\+t into which the old file data can be passed.
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em sig\+\_\+magic} & Signature file format to generate (0 for \char`\"{}recommended\char`\"{}). See \mbox{\hyperlink{librsync_8h_ab6abafd1db0a3947bb3c076507f4f7c2}{rs\+\_\+magic\+\_\+number}}.\\
\hline
{\em block\+\_\+len} & Checksum block size to use (0 for \char`\"{}recommended\char`\"{}). Larger values make the signature shorter, and the delta longer.\\
\hline
{\em strong\+\_\+len} & Strongsum length in bytes to use (0 for \char`\"{}maximum\char`\"{}, -\/1 for \char`\"{}minimum\char`\"{}). Smaller values make the signature shorter but increase the risk of corruption from hash collisions.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{librsync_8h_a2e111b9ef4acef02f812ec58b8217c8c}{rs\+\_\+sig\+\_\+file()}} 
\end{DoxySeeAlso}


Definition at line \mbox{\hyperlink{mksum_8c_source_l00110}{110}} of file \mbox{\hyperlink{mksum_8c_source}{mksum.\+c}}.

