\hypertarget{consign_8h}{
\section{consign.h File Reference}
\label{consign_8h}\index{consign.h@{consign.h}}
}
Public definitions of the consignment structure and functions. 

{\tt \#include \char`\"{}configure.h\char`\"{}}\par
{\tt \#include \char`\"{}collect.h\char`\"{}}\par
{\tt \#include \char`\"{}LSEC/compact.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/WCT.h\char`\"{}}\par
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{consign_8h_cfc5ec600770b13a17ef5510dae69c24}{
typedef enum \hyperlink{consign_8h_2578ab03762ad1c9d200ea4340a88fb7}{\_\-LCI\_\-compLevel} \hyperlink{consign_8h_cfc5ec600770b13a17ef5510dae69c24}{LCI\_\-compLevel}}
\label{consign_8h_cfc5ec600770b13a17ef5510dae69c24}

\begin{CompactList}\small\item\em Compression level values. \item\end{CompactList}\item 
\hypertarget{consign_8h_5aebe00ebf59f29dbd70f0e653267a21}{
typedef struct \hyperlink{struct__LCI__consignment}{\_\-LCI\_\-consignment} \hyperlink{consign_8h_5aebe00ebf59f29dbd70f0e653267a21}{LCI\_\-consignment}}
\label{consign_8h_5aebe00ebf59f29dbd70f0e653267a21}

\begin{CompactList}\small\item\em Declaration of the opaque consignment structure. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{consign_8h_2578ab03762ad1c9d200ea4340a88fb7}{\_\-LCI\_\-compLevel} \{ \par
\hyperlink{consign_8h_2578ab03762ad1c9d200ea4340a88fb77571e24c14097169a2a23f76de9ebdd9}{LCI\_\-COMP\_\-NORM} =  0, 
\par
\hyperlink{consign_8h_2578ab03762ad1c9d200ea4340a88fb7433755a6572f3b06892d1431b138df84}{LCI\_\-COMP\_\-ONLY} =  1, 
\par
\hyperlink{consign_8h_2578ab03762ad1c9d200ea4340a88fb77cf4ce4ab21760315f0cae5aee036493}{LCI\_\-COMP\_\-NONE} =  2
 \}
\begin{CompactList}\small\item\em Compression level values. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned \hyperlink{consign_8h_66689a4910bbf15c75080146d1c8c568}{LCI\_\-consComplete} (\hyperlink{struct__LCI__consignment}{LCI\_\-consignment} $\ast$cns)
\begin{CompactList}\small\item\em Complete a consignment. \item\end{CompactList}\item 
\hyperlink{struct__LCI__consignment}{LCI\_\-consignment} $\ast$ \hyperlink{consign_8h_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_8h_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 
unsigned \hyperlink{consign_8h_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 
WCT\_\-time\_\-sat \hyperlink{consign_8h_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_8h_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_8h_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}
Public definitions of the consignment structure and functions. 

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


\subsection{Enumeration Type Documentation}
\hypertarget{consign_8h_2578ab03762ad1c9d200ea4340a88fb7}{
\index{consign.h@{consign.h}!_LCI_compLevel@{\_\-LCI\_\-compLevel}}
\index{_LCI_compLevel@{\_\-LCI\_\-compLevel}!consign.h@{consign.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf \_\-LCI\_\-compLevel}}}
\label{consign_8h_2578ab03762ad1c9d200ea4340a88fb7}


Compression level values. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{LCI_COMP_NORM@{LCI\_\-COMP\_\-NORM}!consign.h@{consign.h}}\index{consign.h@{consign.h}!LCI_COMP_NORM@{LCI\_\-COMP\_\-NORM}}\item[{\em 
\hypertarget{consign_8h_2578ab03762ad1c9d200ea4340a88fb77571e24c14097169a2a23f76de9ebdd9}{
LCI\_\-COMP\_\-NORM}
\label{consign_8h_2578ab03762ad1c9d200ea4340a88fb77571e24c14097169a2a23f76de9ebdd9}
}]Normal compression. \index{LCI_COMP_ONLY@{LCI\_\-COMP\_\-ONLY}!consign.h@{consign.h}}\index{consign.h@{consign.h}!LCI_COMP_ONLY@{LCI\_\-COMP\_\-ONLY}}\item[{\em 
\hypertarget{consign_8h_2578ab03762ad1c9d200ea4340a88fb7433755a6572f3b06892d1431b138df84}{
LCI\_\-COMP\_\-ONLY}
\label{consign_8h_2578ab03762ad1c9d200ea4340a88fb7433755a6572f3b06892d1431b138df84}
}]No compression, but send only data for type. \index{LCI_COMP_NONE@{LCI\_\-COMP\_\-NONE}!consign.h@{consign.h}}\index{consign.h@{consign.h}!LCI_COMP_NONE@{LCI\_\-COMP\_\-NONE}}\item[{\em 
\hypertarget{consign_8h_2578ab03762ad1c9d200ea4340a88fb77cf4ce4ab21760315f0cae5aee036493}{
LCI\_\-COMP\_\-NONE}
\label{consign_8h_2578ab03762ad1c9d200ea4340a88fb77cf4ce4ab21760315f0cae5aee036493}
}]No compression and send everything. \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{consign_8h_66689a4910bbf15c75080146d1c8c568}{
\index{consign.h@{consign.h}!LCI_consComplete@{LCI\_\-consComplete}}
\index{LCI_consComplete@{LCI\_\-consComplete}!consign.h@{consign.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned LCI\_\-consComplete ({\bf LCI\_\-consignment} $\ast$ {\em cns})}}
\label{consign_8h_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_8h_d466435bdcdc156bab5d69a0de2e70dd}{
\index{consign.h@{consign.h}!LCI_consCreate@{LCI\_\-consCreate}}
\index{LCI_consCreate@{LCI\_\-consCreate}!consign.h@{consign.h}}
\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_8h_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_8h_6082e79a9a32dd07e7dfdc8a004911cd}{
\index{consign.h@{consign.h}!LCI_consDelete@{LCI\_\-consDelete}}
\index{LCI_consDelete@{LCI\_\-consDelete}!consign.h@{consign.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LCI\_\-consDelete ({\bf LCI\_\-consignment} $\ast$ {\em cns})}}
\label{consign_8h_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_8h_e99bedf31db1bf45355a72d3834f47af}{
\index{consign.h@{consign.h}!LCI_consign@{LCI\_\-consign}}
\index{LCI_consign@{LCI\_\-consign}!consign.h@{consign.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned LCI\_\-consign ({\bf LCI\_\-consignment} $\ast$ {\em cns}, {\bf LCI\_\-compLevel} {\em comp})}}
\label{consign_8h_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_8h_57aa9f84cdabfc45665f88ae87c0a029}{
\index{consign.h@{consign.h}!LCI_consPrepare@{LCI\_\-consPrepare}}
\index{LCI_consPrepare@{LCI\_\-consPrepare}!consign.h@{consign.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}WCT\_\-time\_\-sat LCI\_\-consPrepare ({\bf LCI\_\-consignment} $\ast$ {\em cns}, unsigned {\em runid})}}
\label{consign_8h_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_8h_81e8325c637208648da80b6f5fed759b}{
\index{consign.h@{consign.h}!LCI_consReason@{LCI\_\-consReason}}
\index{LCI_consReason@{LCI\_\-consReason}!consign.h@{consign.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LCI\_\-consReason ({\bf LCI\_\-consignment} $\ast$ {\em cns}, int {\em reason})}}
\label{consign_8h_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_8h_5ed25d21180a6cfcadbf394761863ca9}{
\index{consign.h@{consign.h}!LCI_consTimes@{LCI\_\-consTimes}}
\index{LCI_consTimes@{LCI\_\-consTimes}!consign.h@{consign.h}}
\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_8h_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}
