\hypertarget{consign_8c}{
\section{consign.c File Reference}
\label{consign_8c}\index{consign.c@{consign.c}}
}
Routines that act upon the consignment structure. 

{\tt \#include \char`\"{}LCI/LCI\_\-msgs.h\char`\"{}}\par
{\tt \#include \char`\"{}consign\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}configure.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/MBA.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-pubdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/BSWP.h\char`\"{}}\par
{\tt \#include \char`\"{}MON/MON\_\-pubdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/WCT.h\char`\"{}}\par
{\tt \#include \char`\"{}ITC/ITC\_\-pubdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}LSEC/LSEC\_\-ctx.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-cid.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-dir.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-tkr.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-tem.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-gemLocate.h\char`\"{}}\par
{\tt \#include $<$string.h$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned \hyperlink{consign_8c_66689a4910bbf15c75080146d1c8c568}{LCI\_\-consComplete} (\hyperlink{struct__LCI__consignment}{LCI\_\-consignment} $\ast$cns)
\begin{CompactList}\small\item\em Complete a consignment. \item\end{CompactList}\item 
unsigned \hyperlink{consign_8c_e99bedf31db1bf45355a72d3834f47af}{LCI\_\-consign} (\hyperlink{struct__LCI__consignment}{LCI\_\-consignment} $\ast$cns, \hyperlink{consign_8h_cfc5ec600770b13a17ef5510dae69c24}{LCI\_\-compLevel} comp)
\begin{CompactList}\small\item\em Perform a consignment. \item\end{CompactList}\item 
\hyperlink{struct__LCI__consignment}{LCI\_\-consignment} $\ast$ \hyperlink{consign_8c_d466435bdcdc156bab5d69a0de2e70dd}{LCI\_\-consCreate} (unsigned cpuid, unsigned srcid, \hyperlink{struct__LCI__configuration}{LCI\_\-configuration} $\ast$cnf, \hyperlink{struct__LCI__collection}{LCI\_\-collection} $\ast$cll, LSEC\_\-compaction $\ast$cpc)
\begin{CompactList}\small\item\em Allocate memory for an LCI\_\-consigment structure and initialise (clear). \item\end{CompactList}\item 
void \hyperlink{consign_8c_6082e79a9a32dd07e7dfdc8a004911cd}{LCI\_\-consDelete} (\hyperlink{struct__LCI__consignment}{LCI\_\-consignment} $\ast$cns)
\begin{CompactList}\small\item\em Free the previously allocated consignment structure. \item\end{CompactList}\item 
WCT\_\-time\_\-sat \hyperlink{consign_8c_57aa9f84cdabfc45665f88ae87c0a029}{LCI\_\-consPrepare} (\hyperlink{struct__LCI__consignment}{LCI\_\-consignment} $\ast$cns, unsigned runid)
\begin{CompactList}\small\item\em Set the runid and start time for the first datagram of the new calibration. \item\end{CompactList}\item 
void \hyperlink{consign_8c_81e8325c637208648da80b6f5fed759b}{LCI\_\-consReason} (\hyperlink{struct__LCI__consignment}{LCI\_\-consignment} $\ast$cns, int reason)
\begin{CompactList}\small\item\em Set the current datagram close reason. \item\end{CompactList}\item 
void \hyperlink{consign_8c_5ed25d21180a6cfcadbf394761863ca9}{LCI\_\-consTimes} (\hyperlink{struct__LCI__consignment}{LCI\_\-consignment} $\ast$cns, int clear, long long $\ast$raw\_\-time, long long $\ast$tot\_\-time)
\begin{CompactList}\small\item\em Return accumulated consignment time. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Routines that act upon the consignment structure. 

\begin{Desc}
\item[Author:]James Swain \& Owen Saxton\end{Desc}
\begin{Desc}
\item[Id]\end{Desc}


\subsection{Function Documentation}
\hypertarget{consign_8c_66689a4910bbf15c75080146d1c8c568}{
\index{consign.c@{consign.c}!LCI_consComplete@{LCI\_\-consComplete}}
\index{LCI_consComplete@{LCI\_\-consComplete}!consign.c@{consign.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned LCI\_\-consComplete ({\bf LCI\_\-consignment} $\ast$ {\em cns})}}
\label{consign_8c_66689a4910bbf15c75080146d1c8c568}


Complete a consignment. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cns}]pointer to the consignment\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LCI\_\-SUCCESS}]If all goes well \end{description}
\end{Desc}
\hypertarget{consign_8c_d466435bdcdc156bab5d69a0de2e70dd}{
\index{consign.c@{consign.c}!LCI_consCreate@{LCI\_\-consCreate}}
\index{LCI_consCreate@{LCI\_\-consCreate}!consign.c@{consign.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf LCI\_\-consignment}$\ast$ LCI\_\-consCreate (unsigned {\em cpuid}, unsigned {\em srcid}, {\bf LCI\_\-configuration} $\ast$ {\em cnf}, {\bf LCI\_\-collection} $\ast$ {\em cll}, LSEC\_\-compaction $\ast$ {\em cpc})}}
\label{consign_8c_d466435bdcdc156bab5d69a0de2e70dd}


Allocate memory for an LCI\_\-consigment structure and initialise (clear). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em srcid}]ID of the data source\item[{\em cpuid}]ID of the CPU LCI is being run on\item[{\em cll}]Pointer to the collection of events to consign\item[{\em cpc}]Pointer to the compaction state information\item[{\em cnf}]Pointer to the configuration data\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to an allocated, initialised consignment (NULL if there is an error allocating memory) \end{Desc}
\hypertarget{consign_8c_6082e79a9a32dd07e7dfdc8a004911cd}{
\index{consign.c@{consign.c}!LCI_consDelete@{LCI\_\-consDelete}}
\index{LCI_consDelete@{LCI\_\-consDelete}!consign.c@{consign.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LCI\_\-consDelete ({\bf LCI\_\-consignment} $\ast$ {\em cns})}}
\label{consign_8c_6082e79a9a32dd07e7dfdc8a004911cd}


Free the previously allocated consignment structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cns}]Pointer to allocated, intialised consignment structure (from LCI\_\-consCreate) \end{description}
\end{Desc}
\hypertarget{consign_8c_e99bedf31db1bf45355a72d3834f47af}{
\index{consign.c@{consign.c}!LCI_consign@{LCI\_\-consign}}
\index{LCI_consign@{LCI\_\-consign}!consign.c@{consign.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned LCI\_\-consign ({\bf LCI\_\-consignment} $\ast$ {\em cns}, {\bf LCI\_\-compLevel} {\em comp})}}
\label{consign_8c_e99bedf31db1bf45355a72d3834f47af}


Perform a consignment. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cns}]Pointer to a consignment structure\item[{\em comp}]The compression level to use.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LCI\_\-SUCCESS}]If all goes well \end{description}
\end{Desc}
\hypertarget{consign_8c_57aa9f84cdabfc45665f88ae87c0a029}{
\index{consign.c@{consign.c}!LCI_consPrepare@{LCI\_\-consPrepare}}
\index{LCI_consPrepare@{LCI\_\-consPrepare}!consign.c@{consign.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}WCT\_\-time\_\-sat LCI\_\-consPrepare ({\bf LCI\_\-consignment} $\ast$ {\em cns}, unsigned {\em runid})}}
\label{consign_8c_57aa9f84cdabfc45665f88ae87c0a029}


Set the runid and start time for the first datagram of the new calibration. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cns}]Pointer to allocated, intialised consignment structure (from LCI\_\-consCreate)\item[{\em runid}]32-bit number identifying the calibration run\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The run start time (as a 64-bit Spectrum Astro time) \end{Desc}
\hypertarget{consign_8c_81e8325c637208648da80b6f5fed759b}{
\index{consign.c@{consign.c}!LCI_consReason@{LCI\_\-consReason}}
\index{LCI_consReason@{LCI\_\-consReason}!consign.c@{consign.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LCI\_\-consReason ({\bf LCI\_\-consignment} $\ast$ {\em cns}, int {\em reason})}}
\label{consign_8c_81e8325c637208648da80b6f5fed759b}


Set the current datagram close reason. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cns}]Pointer to the consignment structure\item[{\em reason}]The reason code to be set \end{description}
\end{Desc}
\hypertarget{consign_8c_5ed25d21180a6cfcadbf394761863ca9}{
\index{consign.c@{consign.c}!LCI_consTimes@{LCI\_\-consTimes}}
\index{LCI_consTimes@{LCI\_\-consTimes}!consign.c@{consign.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LCI\_\-consTimes ({\bf LCI\_\-consignment} $\ast$ {\em cns}, int {\em clear}, long long $\ast$ {\em raw\_\-time}, long long $\ast$ {\em tot\_\-time})}}
\label{consign_8c_5ed25d21180a6cfcadbf394761863ca9}


Return accumulated consignment time. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cns}]Pointer to a consignment structure.\item[{\em clear}]If TRUE, clear the time after copying it.\item[{\em raw\_\-time}]Address of a variable to receive the accumulated time taken to process raw consignments, or NULL if no time wanted.\item[{\em tot\_\-time}]Address of a variable to receive the accumulated time taken to do total consignments, or NULL if no time wanted. \end{description}
\end{Desc}
