\hypertarget{create_8c}{
\section{create.c File Reference}
\label{create_8c}\index{create.c@{create.c}}
}
Function to create files from 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 create.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=294pt]{create_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static unsigned \hyperlink{create_8c_a1}{create\-Normal} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, int fd, \hyperlink{lrd_8h_a0}{RIM\_\-type} type)
\begin{CompactList}\small\item\em Writes the data for this type into the file. \item\end{CompactList}\item 
static unsigned \hyperlink{create_8c_a2}{create\-Default} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, int fd)
\begin{CompactList}\small\item\em Writes the default data to file. \item\end{CompactList}\item 
static unsigned \hyperlink{create_8c_a3}{create\-GEM} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, int fd)
\begin{CompactList}\small\item\em Writes the GEM data to file. \item\end{CompactList}\item 
static unsigned \hyperlink{create_8c_a4}{create\-AEM} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, int fd)
\begin{CompactList}\small\item\em Write the AEM data to file. \item\end{CompactList}\item 
unsigned \hyperlink{create_8c_a5}{file\_\-write} (int fd, void $\ast$ptr, int nword)
\item 
unsigned \hyperlink{create_8c_a6}{RIM\_\-create\-Map} (\hyperlink{structRIM__map__}{RIM\_\-map} $\ast$map, int fd)
\begin{CompactList}\small\item\em Write out the data of a RIM\_\-map structure. \item\end{CompactList}\item 
unsigned \hyperlink{create_8c_a7}{RIM\_\-create\-Mask} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim)
\begin{CompactList}\small\item\em Creates a bitmask indicating which types can successfully be used with RIM\_\-create. \item\end{CompactList}\item 
unsigned \hyperlink{create_8c_a8}{RIM\_\-create} (\hyperlink{rim_8h_a0}{RIM} $\ast$rim, \hyperlink{lrd_8h_a0}{RIM\_\-type} type, int fd)
\begin{CompactList}\small\item\em Create a single binary configuration file containing the data of one component (or the default data). \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hypertarget{create_8c_a0}{
static \hyperlink{lrd_8h_a0}{RIM\_\-type} \hyperlink{create_8c_a0}{GEM\_\-type} \mbox{[}$\,$\mbox{]} = \{RIM\_\-TAM, RIM\_\-ROI, RIM\_\-TIE, RIM\_\-SCH, -1\}}
\label{create_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 create files from 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{create_8c_a4}{
\index{create.c@{create.c}!createAEM@{createAEM}}
\index{createAEM@{createAEM}!create.c@{create.c}}
\subsubsection[createAEM]{\setlength{\rightskip}{0pt plus 5cm}unsigned create\-AEM (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, int {\em fd})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{create_8c_a4}


Write the AEM data to file. 

\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\_\-WRITE}]if one of the file write operations failed\end{description}
\end{Desc}
\hypertarget{create_8c_a2}{
\index{create.c@{create.c}!createDefault@{createDefault}}
\index{createDefault@{createDefault}!create.c@{create.c}}
\subsubsection[createDefault]{\setlength{\rightskip}{0pt plus 5cm}unsigned create\-Default (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, int {\em fd})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{create_8c_a2}


Writes the default data to file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fd}]Descriptor of a file opened for writing \item[{\em rim}]RIM structure to use as a source \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]if all goes well \item[{\em RIM\_\-FILE\_\-WRITE}]if one of the file write operations failed\end{description}
\end{Desc}
\hypertarget{create_8c_a3}{
\index{create.c@{create.c}!createGEM@{createGEM}}
\index{createGEM@{createGEM}!create.c@{create.c}}
\subsubsection[createGEM]{\setlength{\rightskip}{0pt plus 5cm}unsigned create\-GEM (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, int {\em fd})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{create_8c_a3}


Writes the GEM data to file. 

\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\_\-WRITE}]if one of the file write operations failed\end{description}
\end{Desc}
\hypertarget{create_8c_a1}{
\index{create.c@{create.c}!createNormal@{createNormal}}
\index{createNormal@{createNormal}!create.c@{create.c}}
\subsubsection[createNormal]{\setlength{\rightskip}{0pt plus 5cm}unsigned create\-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{create_8c_a1}


Writes the data for this type into the file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fd}]Descriptor of a file opened for writing \item[{\em rim}]RIM structure to use as a source \item[{\em type}]Component type to write out \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]if all goes well \item[{\em RIM\_\-FILE\_\-WRITE}]if one of the file write operations failed\end{description}
\end{Desc}
\hypertarget{create_8c_a5}{
\index{create.c@{create.c}!file_write@{file\_\-write}}
\index{file_write@{file\_\-write}!create.c@{create.c}}
\subsubsection[file\_\-write]{\setlength{\rightskip}{0pt plus 5cm}unsigned file\_\-write (int {\em fd}, void $\ast$ {\em ptr}, int {\em nword})}}
\label{create_8c_a5}


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em fd}]Descriptor of a file opened for writing \item[{\em ptr}]Pointer to the buffer to write to file \item[{\em nword}]Number of 32-bit words to write to 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\_\-READ}]If there is an error writing to the file\end{description}
\end{Desc}
\hypertarget{create_8c_a8}{
\index{create.c@{create.c}!RIM_create@{RIM\_\-create}}
\index{RIM_create@{RIM\_\-create}!create.c@{create.c}}
\subsubsection[RIM\_\-create]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-create (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim}, \hyperlink{lrd_8h_a0}{RIM\_\-type} {\em type}, int {\em fd})}}
\label{create_8c_a8}


Create a single binary configuration file containing the data of one component (or the default data). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]RIM structure to use as a source \item[{\em type}]Component type to write out \item[{\em fd}]Descriptor of a file opened for writing \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]if all goes well \item[{\em RIM\_\-FILE\_\-WRITE}]if one of the file write operations failed \item[{\em RIM\_\-MAP\_\-NONE}]if the selected type is not written seperately \item[{\em RIM\_\-CPT\_\-NONE}]if the selected type has not data specified\end{description}
\end{Desc}
\hypertarget{create_8c_a6}{
\index{create.c@{create.c}!RIM_createMap@{RIM\_\-createMap}}
\index{RIM_createMap@{RIM\_\-createMap}!create.c@{create.c}}
\subsubsection[RIM\_\-createMap]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-create\-Map (\hyperlink{structRIM__map__}{RIM\_\-map} $\ast$ {\em map}, int {\em fd})}}
\label{create_8c_a6}


Write out the data of a RIM\_\-map structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em map}]Pointer to the RIM\_\-map whose data should be written to file \item[{\em fd}]Descriptor of a file opened for writing \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em RIM\_\-SUCCESS}]if all goes well \item[{\em RIM\_\-FILE\_\-WRITE}]if one of the file write operations failed\end{description}
\end{Desc}
\hypertarget{create_8c_a7}{
\index{create.c@{create.c}!RIM_createMask@{RIM\_\-createMask}}
\index{RIM_createMask@{RIM\_\-createMask}!create.c@{create.c}}
\subsubsection[RIM\_\-createMask]{\setlength{\rightskip}{0pt plus 5cm}unsigned RIM\_\-create\-Mask (\hyperlink{rim_8h_a0}{RIM} $\ast$ {\em rim})}}
\label{create_8c_a7}


Creates a bitmask indicating which types can successfully be used with RIM\_\-create. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rim}]Pointer to the in-memory model \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Bit mask indicating the types of files that can be created\end{Desc}
