\hypertarget{consume_8c}{
\section{consume.c File Reference}
\label{consume_8c}\index{consume.c@{consume.c}}
}
Function to populate a RIM structure. 

{\tt \#include \char`\"{}RIM/rim.h\char`\"{}}\par
{\tt \#include \char`\"{}error\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}descriptions.ic\char`\"{}}\par
{\tt \#include \char`\"{}number.ic\char`\"{}}\par
{\tt \#include \char`\"{}AG\_\-init\-RIM\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/BSWP.h\char`\"{}}\par
{\tt \#include $<$unistd.h$>$}\par


Include dependency graph for consume.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=301pt]{consume_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static unsigned \hyperlink{consume_8c_a1}{consume\-Normal} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, int fd, \hyperlink{lrd_8h_a0}{RIM\_\-type} type)
\begin{CompactList}\small\item\em Reads a collection of mapped data blocks into the RIM structure. \item\end{CompactList}\item 
static unsigned \hyperlink{consume_8c_a2}{consume\-Default} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, int fd)
\begin{CompactList}\small\item\em Reads a buffer containing default data (no map) into the RIM structure. \item\end{CompactList}\item 
static unsigned \hyperlink{consume_8c_a3}{consume\-AEM} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, int fd)
\begin{CompactList}\small\item\em Reads a buffer containing AEM data (no map) into the RIM structure. \item\end{CompactList}\item 
static unsigned \hyperlink{consume_8c_a4}{consume\-GEM} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, int fd)
\begin{CompactList}\small\item\em Reads a buffer containing GEM data (no map). \item\end{CompactList}\item 
unsigned \hyperlink{consume_8c_a5}{file\_\-read} (int fd, void $\ast$ptr, int nword)
\item 
unsigned \hyperlink{consume_8c_a6}{RIM\_\-consume\-Map} (\hyperlink{structRIM__map__}{RIM\_\-map} $\ast$map, int fd)
\begin{CompactList}\small\item\em Read map data into the map structure. \item\end{CompactList}\item 
unsigned \hyperlink{consume_8c_a7}{RIM\_\-consume} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, int fd)
\begin{CompactList}\small\item\em Reads the buffer of data into the RIM structure. \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hypertarget{consume_8c_a0}{
static const \hyperlink{lrd_8h_a0}{RIM\_\-type} \hyperlink{consume_8c_a0}{GEM\_\-type} \mbox{[}$\,$\mbox{]} = \{RIM\_\-TAM, RIM\_\-ROI, RIM\_\-TIE, RIM\_\-SCH, -1\}}
\label{consume_8c_a0}

\begin{CompactList}\small\item\em List of component types that make up the GEM configuration The GEM configuration is made up of several component types. This list is used to collect the data from these components into one file. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Function to populate a RIM structure. 

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


\subsection{Function Documentation}
\hypertarget{consume_8c_a3}{
\index{consume.c@{consume.c}!consumeAEM@{consumeAEM}}
\index{consumeAEM@{consumeAEM}!consume.c@{consume.c}}
\subsubsection[consumeAEM]{\setlength{\rightskip}{0pt plus 5cm}unsigned consume\-AEM (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, int {\em fd})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{consume_8c_a3}


Reads a buffer containing AEM data (no map) into the RIM structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the RIM structure to populate \item[{\em fd}]Descriptor of a file opened for reading \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]If the data are transferred successfully \item[{\em RIM\_\-FILE\_\-END}]If the end of the file is reached \item[{\em RIM\_\-FILE\_\-READ}]If there is an error reading from the file\end{description}
\end{Desc}
\hypertarget{consume_8c_a2}{
\index{consume.c@{consume.c}!consumeDefault@{consumeDefault}}
\index{consumeDefault@{consumeDefault}!consume.c@{consume.c}}
\subsubsection[consumeDefault]{\setlength{\rightskip}{0pt plus 5cm}unsigned consume\-Default (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, int {\em fd})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{consume_8c_a2}


Reads a buffer containing default data (no map) into the RIM structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the RIM structure to populate \item[{\em fd}]Descriptor of a file opened for reading \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]If the data are transferred successfully \item[{\em RIM\_\-FILE\_\-END}]If the end of the file is reached \item[{\em RIM\_\-FILE\_\-READ}]If there is an error reading from the file\end{description}
\end{Desc}
\hypertarget{consume_8c_a4}{
\index{consume.c@{consume.c}!consumeGEM@{consumeGEM}}
\index{consumeGEM@{consumeGEM}!consume.c@{consume.c}}
\subsubsection[consumeGEM]{\setlength{\rightskip}{0pt plus 5cm}unsigned consume\-GEM (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, int {\em fd})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{consume_8c_a4}


Reads a buffer containing GEM data (no map). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the RIM structure to populate \item[{\em fd}]Descriptor of a file opened for reading \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]If the data are transferred successfully \item[{\em RIM\_\-FILE\_\-END}]If the end of the file is reached \item[{\em RIM\_\-FILE\_\-READ}]If there is an error reading from the file\end{description}
\end{Desc}
\hypertarget{consume_8c_a1}{
\index{consume.c@{consume.c}!consumeNormal@{consumeNormal}}
\index{consumeNormal@{consumeNormal}!consume.c@{consume.c}}
\subsubsection[consumeNormal]{\setlength{\rightskip}{0pt plus 5cm}unsigned consume\-Normal (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, int {\em fd}, \hyperlink{lrd_8h_a0}{RIM\_\-type} {\em type})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{consume_8c_a1}


Reads a collection of mapped data blocks into the RIM structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the RIM structure to populate \item[{\em fd}]Descriptor of a file opened for reading \item[{\em type}]The data type \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-CPT\_\-NONE}]The type ID does not appear to be associated to a LAT component \item[{\em RIM\_\-MAP\_\-NONE}]The component type specified is a singleton \item[{\em RIM\_\-FILE\_\-END}]If the end of the file is reached \item[{\em RIM\_\-FILE\_\-READ}]If there is an error reading from the file \item[{\em RIM\_\-SUCCESS}]The data was successfully transfered into the RIM structure\end{description}
\end{Desc}
\hypertarget{consume_8c_a5}{
\index{consume.c@{consume.c}!file_read@{file\_\-read}}
\index{file_read@{file\_\-read}!consume.c@{consume.c}}
\subsubsection[file\_\-read]{\setlength{\rightskip}{0pt plus 5cm}unsigned file\_\-read (int {\em fd}, void $\ast$ {\em ptr}, int {\em nword})}}
\label{consume_8c_a5}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fd}]Descriptor of a file opened for reading \item[{\em ptr}]Pointer to the buffer to populate with data from file \item[{\em nword}]Number of 32-bit words to read from the file \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]If all goes well \item[{\em RIM\_\-FILE\_\-END}]If the end of the file is reached \item[{\em RIM\_\-FILE\_\-READ}]If there is an error reading from the file\end{description}
\end{Desc}
\hypertarget{consume_8c_a7}{
\index{consume.c@{consume.c}!RIM_consume@{RIM\_\-consume}}
\index{RIM_consume@{RIM\_\-consume}!consume.c@{consume.c}}
\subsubsection[RIM\_\-consume]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-consume (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, int {\em fd})}}
\label{consume_8c_a7}


Reads the buffer of data into the RIM structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the RIM structure to populate \item[{\em fd}]Descriptor of a file opened for reading \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]The data was successfully transfered into the RIM structure \item[{\em RIM\_\-TYPE\_\-UK}]The type identifier at the start of the buffer did not correspond to a known type \item[{\em RIM\_\-CPT\_\-NONE}]The type ID does not appear to be associated to a LAT component \item[{\em RIM\_\-MAP\_\-NONE}]The data was of a singleton type, by an attempt to recover a map was made \item[{\em RIM\_\-FILE\_\-END}]If the end of the file is reached \item[{\em RIM\_\-FILE\_\-READ}]If there is an error reading from the file\end{description}
\end{Desc}
\hypertarget{consume_8c_a6}{
\index{consume.c@{consume.c}!RIM_consumeMap@{RIM\_\-consumeMap}}
\index{RIM_consumeMap@{RIM\_\-consumeMap}!consume.c@{consume.c}}
\subsubsection[RIM\_\-consumeMap]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-consume\-Map (\hyperlink{structRIM__map__}{RIM\_\-map} $\ast$ {\em map}, int {\em fd})}}
\label{consume_8c_a6}


Read map data into the map structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em map}]Map structure to populate from file \item[{\em fd}]Descriptor of a file opened for reading \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]if all goes well \item[{\em RIM\_\-FILE\_\-READ}]if an error occures whilst the file is being read \item[{\em RIM\_\-FILE\_\-END}]if the end of the file is unexpectedly encountered\end{description}
\end{Desc}
