\hypertarget{FCS_8c}{
\section{FCS.c File Reference}
\label{FCS_8c}\index{FCS.c@{FCS.c}}
}
Utilities to compute a Fletcher checksum. 

{\tt \#include \char`\"{}LDT/FCS.h\char`\"{}}\par
{\tt \#include \char`\"{}dprintf.h\char`\"{}}\par
{\tt \#include \char`\"{}PBI/Unions.h\char`\"{}}\par


Include dependency graph for FCS.c:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=132pt]{FCS_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned int \hyperlink{FCS_8c_5329f8d8d2b5e4e6730fd74964e086a8}{FCS\_\-calculate16} (const unsigned short int $\ast$data, unsigned int cnt)
\begin{CompactList}\small\item\em Calculates the 32-bit Fletcher checksum over the 16-bit {\em data\/} array. \item\end{CompactList}\item 
unsigned int \hyperlink{FCS_8c_6950e18a6008412d69dacc4595801f52}{FCS\_\-calculate32} (const unsigned int $\ast$data, unsigned int cnt)
\begin{CompactList}\small\item\em Calculates the 32-bit Fletcher checksum over the 32-bit {\em data\/} array. \item\end{CompactList}\item 
void \hyperlink{FCS_8c_6ab726e571a1c37f98567f1b2aca67a3}{FCS\_\-construct} (\hyperlink{struct__FCS__checksum}{FCS\_\-checksum} $\ast$checksum)
\begin{CompactList}\small\item\em Constructs a Fletcher checksum context. This is used when the data to be checksummed is {\em not\/} in one contigious array. \item\end{CompactList}\item 
void \hyperlink{FCS_8c_e4f6011c2122688da4a53ad40a325083}{FCS\_\-accumulate16} (\hyperlink{struct__FCS__checksum}{FCS\_\-checksum} $\ast$checksum, const unsigned short int $\ast$data, unsigned int cnt)
\begin{CompactList}\small\item\em Updates the current Fletcher checksum. \item\end{CompactList}\item 
void \hyperlink{FCS_8c_2ccd2ea158d626367eff30e2ab6c8eb2}{FCS\_\-accumulate32} (\hyperlink{struct__FCS__checksum}{FCS\_\-checksum} $\ast$checksum, const unsigned int $\ast$data, unsigned int cnt)
\begin{CompactList}\small\item\em Updates the current Fletcher checksum. \item\end{CompactList}\item 
unsigned int \hyperlink{FCS_8c_e0aa031cc7e68bd45ff68d5fae3e957c}{FCS\_\-get} (const \hyperlink{struct__FCS__checksum}{FCS\_\-checksum} $\ast$checksum)
\begin{CompactList}\small\item\em Processes the Fletcher checksum context, returning the current value of the checksum. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Utilities to compute a Fletcher checksum. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}

   CVS $Id: FCS.c,v 1.1 2009/04/30 00:32:16 russell Exp $
\end{verbatim}
\normalsize
 

\subsection{Function Documentation}
\hypertarget{FCS_8c_e4f6011c2122688da4a53ad40a325083}{
\index{FCS.c@{FCS.c}!FCS_accumulate16@{FCS\_\-accumulate16}}
\index{FCS_accumulate16@{FCS\_\-accumulate16}!FCS.c@{FCS.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void FCS\_\-accumulate16 ({\bf FCS\_\-checksum} $\ast$ {\em checksum}, const unsigned short int $\ast$ {\em data}, unsigned int {\em cnt})}}
\label{FCS_8c_e4f6011c2122688da4a53ad40a325083}


Updates the current Fletcher checksum. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em checksum}]The Fletcher checksum context. \item[{\em data}]The 16-bit data array to add to the current checksum \item[{\em cnt}]The count of elements in {\em data\/} \end{description}
\end{Desc}
\hypertarget{FCS_8c_2ccd2ea158d626367eff30e2ab6c8eb2}{
\index{FCS.c@{FCS.c}!FCS_accumulate32@{FCS\_\-accumulate32}}
\index{FCS_accumulate32@{FCS\_\-accumulate32}!FCS.c@{FCS.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void FCS\_\-accumulate32 ({\bf FCS\_\-checksum} $\ast$ {\em checksum}, const unsigned int $\ast$ {\em data}, unsigned int {\em cnt})}}
\label{FCS_8c_2ccd2ea158d626367eff30e2ab6c8eb2}


Updates the current Fletcher checksum. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em checksum}]The Fletcher checksum context. \item[{\em data}]The 32-bit data array to add to the current checksum \item[{\em cnt}]The count of elements in {\em data\/} \end{description}
\end{Desc}
\hypertarget{FCS_8c_5329f8d8d2b5e4e6730fd74964e086a8}{
\index{FCS.c@{FCS.c}!FCS_calculate16@{FCS\_\-calculate16}}
\index{FCS_calculate16@{FCS\_\-calculate16}!FCS.c@{FCS.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int FCS\_\-calculate16 (const unsigned short int $\ast$ {\em data}, unsigned int {\em cnt})}}
\label{FCS_8c_5329f8d8d2b5e4e6730fd74964e086a8}


Calculates the 32-bit Fletcher checksum over the 16-bit {\em data\/} array. 

\begin{Desc}
\item[Returns:]The 32-bit Fletcher checksum\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]The 16-bit data array to checksum \item[{\em cnt}]The count of elements in {\em data\/} \end{description}
\end{Desc}
\hypertarget{FCS_8c_6950e18a6008412d69dacc4595801f52}{
\index{FCS.c@{FCS.c}!FCS_calculate32@{FCS\_\-calculate32}}
\index{FCS_calculate32@{FCS\_\-calculate32}!FCS.c@{FCS.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int FCS\_\-calculate32 (const unsigned int $\ast$ {\em data}, unsigned int {\em cnt})}}
\label{FCS_8c_6950e18a6008412d69dacc4595801f52}


Calculates the 32-bit Fletcher checksum over the 32-bit {\em data\/} array. 

\begin{Desc}
\item[Returns:]The 32-bit Fletcher checksum\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]The 32-bit data array to checksum \item[{\em cnt}]The count of elements in {\em data\/} \end{description}
\end{Desc}
\hypertarget{FCS_8c_6ab726e571a1c37f98567f1b2aca67a3}{
\index{FCS.c@{FCS.c}!FCS_construct@{FCS\_\-construct}}
\index{FCS_construct@{FCS\_\-construct}!FCS.c@{FCS.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void FCS\_\-construct ({\bf FCS\_\-checksum} $\ast$ {\em checksum})}}
\label{FCS_8c_6ab726e571a1c37f98567f1b2aca67a3}


Constructs a Fletcher checksum context. This is used when the data to be checksummed is {\em not\/} in one contigious array. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em checksum}]The Fletcher checksum context to be constructed. \end{description}
\end{Desc}
\hypertarget{FCS_8c_e0aa031cc7e68bd45ff68d5fae3e957c}{
\index{FCS.c@{FCS.c}!FCS_get@{FCS\_\-get}}
\index{FCS_get@{FCS\_\-get}!FCS.c@{FCS.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int FCS\_\-get (const {\bf FCS\_\-checksum} $\ast$ {\em checksum})}}
\label{FCS_8c_e0aa031cc7e68bd45ff68d5fae3e957c}


Processes the Fletcher checksum context, returning the current value of the checksum. 

\begin{Desc}
\item[Returns:]The current value of the 32-bit Fletcher checksum\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em checksum}]The Fletcher checksum context. \end{description}
\end{Desc}
