\hypertarget{expand_8h}{
\section{expand.h File Reference}
\label{expand_8h}\index{expand.h@{expand.h}}
}
Expansion routines. 

{\tt \#include $<$unistd.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$stdio.h$>$}\par
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{expand_8h_c724d558809a9307dfa242581d84cd69}{
typedef struct \hyperlink{structQSEC__expansion__}{QSEC\_\-expansion\_\-} \hyperlink{expand_8h_c724d558809a9307dfa242581d84cd69}{QSEC\_\-expansion}}
\label{expand_8h_c724d558809a9307dfa242581d84cd69}

\begin{CompactList}\small\item\em Declaration of the opaque expansion structure. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{expand_8h_bd579e0ef022b85aef7634d9e91ad685}{QSEC\_\-clearExpansion} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp)
\begin{CompactList}\small\item\em Clear away any context from a previous cycle. \item\end{CompactList}\item 
\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$ \hyperlink{expand_8h_72b501512416cbe5684750aac0ccb6ec}{QSEC\_\-constructExpansion} (void $\ast$buffer, unsigned cap)
\begin{CompactList}\small\item\em Construct a QSEC\_\-expansion structure in a buffer. \item\end{CompactList}\item 
void \hyperlink{expand_8h_7f7c0a82d304ff6c6bd7faaab182ba3e}{QSEC\_\-deleteExpansion} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp)
\begin{CompactList}\small\item\em Free memory previously allocated with a call to QSEC\_\-newExpansion. \item\end{CompactList}\item 
unsigned \hyperlink{expand_8h_01b0ee2d3fc5a307b235f13024939d2f}{QSEC\_\-monitorExpansion} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, unsigned mon)
\begin{CompactList}\small\item\em Set the monitoring level for the expansion. \item\end{CompactList}\item 
\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$ \hyperlink{expand_8h_24de4a44e132059c487f041976a892d3}{QSEC\_\-newExpansion} (unsigned cap)
\begin{CompactList}\small\item\em Allocate memory for a QSEC\_\-expansion structure and all the substructures. \item\end{CompactList}\item 
const unsigned int $\ast$ \hyperlink{expand_8h_40cd442568e2900a369fff69f9c053ce}{QSEC\_\-recoverUser} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, const unsigned int $\ast$buf)
\begin{CompactList}\small\item\em Unpack the tables against which the events were encoded. \item\end{CompactList}\item 
void \hyperlink{expand_8h_cdafa7fc7dc224d05f57d4dbc961c437}{QSEC\_\-reportExpansion} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, FILE $\ast$fp)
\begin{CompactList}\small\item\em Report the contents of an expansion. \item\end{CompactList}\item 
void \hyperlink{expand_8h_e3833099913c64c3b056ff6f3343190a}{QSEC\_\-setFourRange} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, unsigned rng)
\begin{CompactList}\small\item\em Set the range for a calibration expansion. \item\end{CompactList}\item 
void \hyperlink{expand_8h_432e410d16b336f1be7012325929207a}{QSEC\_\-setMode} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, unsigned mode)
\begin{CompactList}\small\item\em Set the calibration mode of an expansion. \item\end{CompactList}\item 
size\_\-t \hyperlink{expand_8h_f2b835093871e036f994feb8c517c91d}{QSEC\_\-sizeofExpansion} (unsigned cap)
\begin{CompactList}\small\item\em Calculate the size of the memory block required to accomodate the expansion structure. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Expansion routines. 

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


\subsection{Function Documentation}
\hypertarget{expand_8h_bd579e0ef022b85aef7634d9e91ad685}{
\index{expand.h@{expand.h}!QSEC_clearExpansion@{QSEC\_\-clearExpansion}}
\index{QSEC_clearExpansion@{QSEC\_\-clearExpansion}!expand.h@{expand.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QSEC\_\-clearExpansion ({\bf QSEC\_\-expansion} $\ast$ {\em exp})}}
\label{expand_8h_bd579e0ef022b85aef7634d9e91ad685}


Clear away any context from a previous cycle. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Pointer to a expansion object \end{description}
\end{Desc}
\hypertarget{expand_8h_72b501512416cbe5684750aac0ccb6ec}{
\index{expand.h@{expand.h}!QSEC_constructExpansion@{QSEC\_\-constructExpansion}}
\index{QSEC_constructExpansion@{QSEC\_\-constructExpansion}!expand.h@{expand.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QSEC\_\-expansion}$\ast$ QSEC\_\-constructExpansion (void $\ast$ {\em buffer}, unsigned {\em cap})}}
\label{expand_8h_72b501512416cbe5684750aac0ccb6ec}


Construct a QSEC\_\-expansion structure in a buffer. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cap}]Capacity of the decompression, maximum number of events in a single cycle\item[{\em buffer}]Uninitialised memory large enough to hold the expansion structure\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to an initialised expansion structure \end{Desc}
\hypertarget{expand_8h_7f7c0a82d304ff6c6bd7faaab182ba3e}{
\index{expand.h@{expand.h}!QSEC_deleteExpansion@{QSEC\_\-deleteExpansion}}
\index{QSEC_deleteExpansion@{QSEC\_\-deleteExpansion}!expand.h@{expand.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QSEC\_\-deleteExpansion ({\bf QSEC\_\-expansion} $\ast$ {\em exp})}}
\label{expand_8h_7f7c0a82d304ff6c6bd7faaab182ba3e}


Free memory previously allocated with a call to QSEC\_\-newExpansion. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Pointer to a expansion structure previously created by a call to QSEC\_\-newExpansion \end{description}
\end{Desc}
\hypertarget{expand_8h_01b0ee2d3fc5a307b235f13024939d2f}{
\index{expand.h@{expand.h}!QSEC_monitorExpansion@{QSEC\_\-monitorExpansion}}
\index{QSEC_monitorExpansion@{QSEC\_\-monitorExpansion}!expand.h@{expand.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned QSEC\_\-monitorExpansion ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, unsigned {\em mon})}}
\label{expand_8h_01b0ee2d3fc5a307b235f13024939d2f}


Set the monitoring level for the expansion. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Pointer to an initialised expansion\item[{\em mon}]Monitoring level\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Previous monitoring level \end{Desc}
\hypertarget{expand_8h_24de4a44e132059c487f041976a892d3}{
\index{expand.h@{expand.h}!QSEC_newExpansion@{QSEC\_\-newExpansion}}
\index{QSEC_newExpansion@{QSEC\_\-newExpansion}!expand.h@{expand.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QSEC\_\-expansion}$\ast$ QSEC\_\-newExpansion (unsigned {\em cap})}}
\label{expand_8h_24de4a44e132059c487f041976a892d3}


Allocate memory for a QSEC\_\-expansion structure and all the substructures. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cap}]Capacity of the decompression, maximum number of events in a single cycle\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to an allocated, initialise, QSEC\_\-expansion structure \end{Desc}
\hypertarget{expand_8h_40cd442568e2900a369fff69f9c053ce}{
\index{expand.h@{expand.h}!QSEC_recoverUser@{QSEC\_\-recoverUser}}
\index{QSEC_recoverUser@{QSEC\_\-recoverUser}!expand.h@{expand.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const unsigned int$\ast$ QSEC\_\-recoverUser ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, const unsigned int $\ast$ {\em buf})}}
\label{expand_8h_40cd442568e2900a369fff69f9c053ce}


Unpack the tables against which the events were encoded. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em buf}]Pointer to the buffer where the context is held\item[{\em exp}]Pointer to the structure containing the tables (an expansion)\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the next input location to be read or NULL if there was an error during recovery of User data \end{Desc}
\hypertarget{expand_8h_cdafa7fc7dc224d05f57d4dbc961c437}{
\index{expand.h@{expand.h}!QSEC_reportExpansion@{QSEC\_\-reportExpansion}}
\index{QSEC_reportExpansion@{QSEC\_\-reportExpansion}!expand.h@{expand.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QSEC\_\-reportExpansion ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, FILE $\ast$ {\em fp})}}
\label{expand_8h_cdafa7fc7dc224d05f57d4dbc961c437}


Report the contents of an expansion. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Pointer to a expansion object\item[{\em fp}]Pointer to the destination file \end{description}
\end{Desc}
\hypertarget{expand_8h_e3833099913c64c3b056ff6f3343190a}{
\index{expand.h@{expand.h}!QSEC_setFourRange@{QSEC\_\-setFourRange}}
\index{QSEC_setFourRange@{QSEC\_\-setFourRange}!expand.h@{expand.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QSEC\_\-setFourRange ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, unsigned {\em rng})}}
\label{expand_8h_e3833099913c64c3b056ff6f3343190a}


Set the range for a calibration expansion. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Pointer to a expansion structure\item[{\em rng}]Flag indicating 4-range or auto-range \end{description}
\end{Desc}
\hypertarget{expand_8h_432e410d16b336f1be7012325929207a}{
\index{expand.h@{expand.h}!QSEC_setMode@{QSEC\_\-setMode}}
\index{QSEC_setMode@{QSEC\_\-setMode}!expand.h@{expand.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QSEC\_\-setMode ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, unsigned {\em mode})}}
\label{expand_8h_432e410d16b336f1be7012325929207a}


Set the calibration mode of an expansion. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Pointer to a expansion structure\item[{\em mode}]Type of calibration \end{description}
\end{Desc}
\hypertarget{expand_8h_f2b835093871e036f994feb8c517c91d}{
\index{expand.h@{expand.h}!QSEC_sizeofExpansion@{QSEC\_\-sizeofExpansion}}
\index{QSEC_sizeofExpansion@{QSEC\_\-sizeofExpansion}!expand.h@{expand.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}size\_\-t QSEC\_\-sizeofExpansion (unsigned {\em cap})}}
\label{expand_8h_f2b835093871e036f994feb8c517c91d}


Calculate the size of the memory block required to accomodate the expansion structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cap}]Capacity of the decompression, maximum number of events in a single cycle\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Size of the memory block required to accomodate the expansion structure \end{Desc}
