\hypertarget{raw_8c}{
\section{raw.c File Reference}
\label{raw_8c}\index{raw.c@{raw.c}}
}
Implementation of the LSEC\_\-raw structure. 

{\tt \#include \char`\"{}LSEC/LSEC\_\-msgs.h\char`\"{}}\par
{\tt \#include \char`\"{}raw\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}PBI/Endianness.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-pubdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/MBA.h\char`\"{}}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$unistd.h$>$}\par
{\tt \#include $<$string.h$>$}\par


Include dependency graph for raw.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=198pt]{raw_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$ \hyperlink{raw_8c_a0}{LSEC\_\-new\-Raw} (unsigned wcnt, unsigned cap)
\begin{CompactList}\small\item\em Allocate memory for an LSEC\_\-acd\-Count structure. \item\end{CompactList}\item 
void \hyperlink{raw_8c_a1}{LSEC\_\-delete\-Raw} (\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$raw)
\begin{CompactList}\small\item\em Free memory associated with the LSEC\_\-raw structure. \item\end{CompactList}\item 
void \hyperlink{raw_8c_a2}{LSEC\_\-clear\-Raw} (\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$raw)
\begin{CompactList}\small\item\em Clear the LSEC\_\-raw structure. \item\end{CompactList}\item 
void \hyperlink{raw_8c_a3}{LSEC\_\-report\-Raw} (\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$raw, FILE $\ast$fp)
\begin{CompactList}\small\item\em Produce a formatted ASCII summary of the structure. \item\end{CompactList}\item 
unsigned \hyperlink{raw_8c_a4}{LSEC\_\-check\-Raw} (\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$raw)
\begin{CompactList}\small\item\em Clear the LSEC\_\-raw structure. \item\end{CompactList}\item 
unsigned char $\ast$ \hyperlink{raw_8c_a5}{LSEC\_\-pack\-Raw} (\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$raw, unsigned char $\ast$buf)
\begin{CompactList}\small\item\em Copy the raw portion of the current event contribution to the output buffer. \item\end{CompactList}\item 
void \hyperlink{raw_8c_a6}{LSEC\_\-add\-Raw} (\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$raw, void $\ast$src)
\begin{CompactList}\small\item\em Place the data in the next free slot. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Implementation of the LSEC\_\-raw structure. 

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


\subsection{Function Documentation}
\hypertarget{raw_8c_a6}{
\index{raw.c@{raw.c}!LSEC_addRaw@{LSEC\_\-addRaw}}
\index{LSEC_addRaw@{LSEC\_\-addRaw}!raw.c@{raw.c}}
\subsubsection[LSEC\_\-addRaw]{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-add\-Raw (\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$ {\em raw}, void $\ast$ {\em src})}}
\label{raw_8c_a6}


Place the data in the next free slot. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em raw}]Pointer to an allocated, initialised, LSEC\_\-raw structure \item[{\em src}]Pointer to the data to be added to this structure\end{description}
\end{Desc}
\hypertarget{raw_8c_a4}{
\index{raw.c@{raw.c}!LSEC_checkRaw@{LSEC\_\-checkRaw}}
\index{LSEC_checkRaw@{LSEC\_\-checkRaw}!raw.c@{raw.c}}
\subsubsection[LSEC\_\-checkRaw]{\setlength{\rightskip}{0pt plus 5cm}unsigned LSEC\_\-check\-Raw (\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$ {\em raw})}}
\label{raw_8c_a4}


Clear the LSEC\_\-raw structure. 

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LSEC\_\-SUCCESS}]If there were no errors filling this structure \item[{\em LSEC\_\-RAWOVER}]If there was an attempt to add more entries than this structure can hold @param raw Pointer to an allocated, initialise, LSEC\_\-raw structure\end{description}
\end{Desc}
\hypertarget{raw_8c_a2}{
\index{raw.c@{raw.c}!LSEC_clearRaw@{LSEC\_\-clearRaw}}
\index{LSEC_clearRaw@{LSEC\_\-clearRaw}!raw.c@{raw.c}}
\subsubsection[LSEC\_\-clearRaw]{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-clear\-Raw (\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$ {\em raw})}}
\label{raw_8c_a2}


Clear the LSEC\_\-raw structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em raw}]Pointer to an allocated, initialise, LSEC\_\-raw structure\end{description}
\end{Desc}
\hypertarget{raw_8c_a1}{
\index{raw.c@{raw.c}!LSEC_deleteRaw@{LSEC\_\-deleteRaw}}
\index{LSEC_deleteRaw@{LSEC\_\-deleteRaw}!raw.c@{raw.c}}
\subsubsection[LSEC\_\-deleteRaw]{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-delete\-Raw (\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$ {\em raw})}}
\label{raw_8c_a1}


Free memory associated with the LSEC\_\-raw structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em raw}]Pointer to an allocated, initialise, LSEC\_\-raw structure\end{description}
\end{Desc}
\hypertarget{raw_8c_a0}{
\index{raw.c@{raw.c}!LSEC_newRaw@{LSEC\_\-newRaw}}
\index{LSEC_newRaw@{LSEC\_\-newRaw}!raw.c@{raw.c}}
\subsubsection[LSEC\_\-newRaw]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{structLSEC__raw__}{LSEC\_\-raw}$\ast$ LSEC\_\-new\-Raw (unsigned {\em wcnt}, unsigned {\em cap})}}
\label{raw_8c_a0}


Allocate memory for an LSEC\_\-acd\-Count structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wcnt}]Number of words in the data stored for each event \item[{\em cap}]Capacity of the calibration task, the maximum number of events that can be collected each cycle \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to an allocated, initialise, LSEC\_\-acd\-Count structure\end{Desc}
\hypertarget{raw_8c_a5}{
\index{raw.c@{raw.c}!LSEC_packRaw@{LSEC\_\-packRaw}}
\index{LSEC_packRaw@{LSEC\_\-packRaw}!raw.c@{raw.c}}
\subsubsection[LSEC\_\-packRaw]{\setlength{\rightskip}{0pt plus 5cm}unsigned char$\ast$ LSEC\_\-pack\-Raw (\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$ {\em raw}, unsigned char $\ast$ {\em buf})}}
\label{raw_8c_a5}


Copy the raw portion of the current event contribution to the output buffer. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em raw}]Pointer to an allocated, initialised ACD raw structure \item[{\em buf}]Pointer to the buffer where the context should be placed \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the next output location to be filled.\end{Desc}
\hypertarget{raw_8c_a3}{
\index{raw.c@{raw.c}!LSEC_reportRaw@{LSEC\_\-reportRaw}}
\index{LSEC_reportRaw@{LSEC\_\-reportRaw}!raw.c@{raw.c}}
\subsubsection[LSEC\_\-reportRaw]{\setlength{\rightskip}{0pt plus 5cm}void LSEC\_\-report\-Raw (\hyperlink{structLSEC__raw__}{LSEC\_\-raw} $\ast$ {\em raw}, FILE $\ast$ {\em fp})}}
\label{raw_8c_a3}


Produce a formatted ASCII summary of the structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em raw}]Pointer to an allocated, initialise, LSEC\_\-raw structure \item[{\em fp}]Pointer to file to send the report\end{description}
\end{Desc}
