\hypertarget{cue_8h}{
\section{cue.h File Reference}
\label{cue_8h}\index{cue.h@{cue.h}}
}
Definitions for the routines that act upon the cue structure. 

\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{cue_8h_d9b0a7c12a10194bee64c74b1f8a12ec}{
typedef struct \hyperlink{struct__LCI__cue}{\_\-LCI\_\-cue} \hyperlink{cue_8h_d9b0a7c12a10194bee64c74b1f8a12ec}{LCI\_\-cue}}
\label{cue_8h_d9b0a7c12a10194bee64c74b1f8a12ec}

\begin{CompactList}\small\item\em Declaration of the opaque cue structure. \item\end{CompactList}\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum \hyperlink{cue_8h_80526dd17bc1545bff94158fc2b3d01b}{LCI\_\-CUE\_\-END} \{ \par
\hyperlink{cue_8h_80526dd17bc1545bff94158fc2b3d01b1f92bba3e380ab46391fab6230669ab5}{LCI\_\-CUE\_\-FAILED} =  -1, 
\par
\hyperlink{cue_8h_80526dd17bc1545bff94158fc2b3d01b156d8dcd48119f6370686d3c2c62045e}{LCI\_\-CUE\_\-UNSET} =  0, 
\par
\hyperlink{cue_8h_80526dd17bc1545bff94158fc2b3d01b7fdee9671b2235403a2bc81dbf67b460}{LCI\_\-CUE\_\-SIGNALED} =  1, 
\par
\hyperlink{cue_8h_80526dd17bc1545bff94158fc2b3d01b6587ab605da94987e88946759496397d}{LCI\_\-CUE\_\-TIMEDOUT} =  2
 \}
\begin{CompactList}\small\item\em State information returned from LCI\_\-wait indicating how the cue was terminated. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{cue_8h_68e03f7db1f5486592fd6a56c74704f3}{LCI\_\-clearCue} (\hyperlink{struct__LCI__cue}{LCI\_\-cue} $\ast$cue)
\begin{CompactList}\small\item\em Clear a cue. \item\end{CompactList}\item 
void \hyperlink{cue_8h_21e53f5c9579985fb457442bee8c8c4e}{LCI\_\-clearCueCounts} (\hyperlink{struct__LCI__cue}{LCI\_\-cue} $\ast$cue)
\begin{CompactList}\small\item\em Clear cue counters. \item\end{CompactList}\item 
unsigned \hyperlink{cue_8h_06983ef6516cc9e991d7baf115e9fffd}{LCI\_\-deleteCue} (\hyperlink{struct__LCI__cue}{LCI\_\-cue} $\ast$cue)
\begin{CompactList}\small\item\em Delete a cue. \item\end{CompactList}\item 
void \hyperlink{cue_8h_d425faf1408ffb559d469279fe44722e}{LCI\_\-getCueCounts} (\hyperlink{struct__LCI__cue}{LCI\_\-cue} $\ast$cue, unsigned int $\ast$nWait, unsigned int $\ast$nSignal, unsigned int $\ast$nTimeout)
\begin{CompactList}\small\item\em Get cue counters. \item\end{CompactList}\item 
\hyperlink{struct__LCI__cue}{LCI\_\-cue} $\ast$ \hyperlink{cue_8h_31b61a3f852fcd8c2cd9dd36c5e682a4}{LCI\_\-newCue} (void)
\begin{CompactList}\small\item\em Create a new cue. \item\end{CompactList}\item 
void \hyperlink{cue_8h_9e35d61657eb30d22f26d68392f52e05}{LCI\_\-signalCue} (\hyperlink{struct__LCI__cue}{LCI\_\-cue} $\ast$cue)
\begin{CompactList}\small\item\em Signal cue completion. \item\end{CompactList}\item 
unsigned \hyperlink{cue_8h_5542d4f986974bee670ebb3cf8adeeda}{LCI\_\-waitCue} (\hyperlink{struct__LCI__cue}{LCI\_\-cue} $\ast$cue, unsigned timeout)
\begin{CompactList}\small\item\em Wait for a cue to complete or time out. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Definitions for the routines that act upon the cue structure. 

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


\subsection{Enumeration Type Documentation}
\hypertarget{cue_8h_80526dd17bc1545bff94158fc2b3d01b}{
\index{cue.h@{cue.h}!LCI_CUE_END@{LCI\_\-CUE\_\-END}}
\index{LCI_CUE_END@{LCI\_\-CUE\_\-END}!cue.h@{cue.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf LCI\_\-CUE\_\-END}}}
\label{cue_8h_80526dd17bc1545bff94158fc2b3d01b}


State information returned from LCI\_\-wait indicating how the cue was terminated. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{LCI_CUE_FAILED@{LCI\_\-CUE\_\-FAILED}!cue.h@{cue.h}}\index{cue.h@{cue.h}!LCI_CUE_FAILED@{LCI\_\-CUE\_\-FAILED}}\item[{\em 
\hypertarget{cue_8h_80526dd17bc1545bff94158fc2b3d01b1f92bba3e380ab46391fab6230669ab5}{
LCI\_\-CUE\_\-FAILED}
\label{cue_8h_80526dd17bc1545bff94158fc2b3d01b1f92bba3e380ab46391fab6230669ab5}
}]The wake-up timer failed to start. \index{LCI_CUE_UNSET@{LCI\_\-CUE\_\-UNSET}!cue.h@{cue.h}}\index{cue.h@{cue.h}!LCI_CUE_UNSET@{LCI\_\-CUE\_\-UNSET}}\item[{\em 
\hypertarget{cue_8h_80526dd17bc1545bff94158fc2b3d01b156d8dcd48119f6370686d3c2c62045e}{
LCI\_\-CUE\_\-UNSET}
\label{cue_8h_80526dd17bc1545bff94158fc2b3d01b156d8dcd48119f6370686d3c2c62045e}
}]No end state to report (the cue has never been used or is currently waiting). \index{LCI_CUE_SIGNALED@{LCI\_\-CUE\_\-SIGNALED}!cue.h@{cue.h}}\index{cue.h@{cue.h}!LCI_CUE_SIGNALED@{LCI\_\-CUE\_\-SIGNALED}}\item[{\em 
\hypertarget{cue_8h_80526dd17bc1545bff94158fc2b3d01b7fdee9671b2235403a2bc81dbf67b460}{
LCI\_\-CUE\_\-SIGNALED}
\label{cue_8h_80526dd17bc1545bff94158fc2b3d01b7fdee9671b2235403a2bc81dbf67b460}
}]The cue was signalled. \index{LCI_CUE_TIMEDOUT@{LCI\_\-CUE\_\-TIMEDOUT}!cue.h@{cue.h}}\index{cue.h@{cue.h}!LCI_CUE_TIMEDOUT@{LCI\_\-CUE\_\-TIMEDOUT}}\item[{\em 
\hypertarget{cue_8h_80526dd17bc1545bff94158fc2b3d01b6587ab605da94987e88946759496397d}{
LCI\_\-CUE\_\-TIMEDOUT}
\label{cue_8h_80526dd17bc1545bff94158fc2b3d01b6587ab605da94987e88946759496397d}
}]The wake-up timer went off. \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{cue_8h_68e03f7db1f5486592fd6a56c74704f3}{
\index{cue.h@{cue.h}!LCI_clearCue@{LCI\_\-clearCue}}
\index{LCI_clearCue@{LCI\_\-clearCue}!cue.h@{cue.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LCI\_\-clearCue ({\bf LCI\_\-cue} $\ast$ {\em cue})}}
\label{cue_8h_68e03f7db1f5486592fd6a56c74704f3}


Clear a cue. 

This routine puts the cue into a known cleared state, ready for the next wait.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cue}]Pointer to an allocated, initialised cue structure (from LCI\_\-newCue) \end{description}
\end{Desc}
\hypertarget{cue_8h_21e53f5c9579985fb457442bee8c8c4e}{
\index{cue.h@{cue.h}!LCI_clearCueCounts@{LCI\_\-clearCueCounts}}
\index{LCI_clearCueCounts@{LCI\_\-clearCueCounts}!cue.h@{cue.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LCI\_\-clearCueCounts ({\bf LCI\_\-cue} $\ast$ {\em cue})}}
\label{cue_8h_21e53f5c9579985fb457442bee8c8c4e}


Clear cue counters. 

This routine zeroes the counts of waits, signals and timeouts.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cue}]Pointer to a cue being used. \end{description}
\end{Desc}
\hypertarget{cue_8h_06983ef6516cc9e991d7baf115e9fffd}{
\index{cue.h@{cue.h}!LCI_deleteCue@{LCI\_\-deleteCue}}
\index{LCI_deleteCue@{LCI\_\-deleteCue}!cue.h@{cue.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned LCI\_\-deleteCue ({\bf LCI\_\-cue} $\ast$ {\em cue})}}
\label{cue_8h_06983ef6516cc9e991d7baf115e9fffd}


Delete a cue. 

This routine destroys the semaphore and wake-up timer and then frees the memory associated with the cue structure

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cue}]Pointer to an initialised cue structure (make sure that it is not currently running!)\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LCI\_\-SUCCESS}]if all goes well \item[{\em LCI\_\-WUTDFAIL}]if the wake-up timer could not be destroyed, because it was in a bad state \end{description}
\end{Desc}
\hypertarget{cue_8h_d425faf1408ffb559d469279fe44722e}{
\index{cue.h@{cue.h}!LCI_getCueCounts@{LCI\_\-getCueCounts}}
\index{LCI_getCueCounts@{LCI\_\-getCueCounts}!cue.h@{cue.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LCI\_\-getCueCounts ({\bf LCI\_\-cue} $\ast$ {\em cue}, unsigned int $\ast$ {\em nWait}, unsigned int $\ast$ {\em nSignal}, unsigned int $\ast$ {\em nTimeout})}}
\label{cue_8h_d425faf1408ffb559d469279fe44722e}


Get cue counters. 

This routine obtains the counts of waits, signals and timeouts since the last time the cue was cleared.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cue}]Pointer to a cue being used.\item[{\em nWait}]Address of an integer to receive the number of wait calls, or NULL if not needed.\item[{\em nSignal}]Address of an integer to receive the number of signal calls, or NULL if not needed.\item[{\em nTimeout}]Address of an integer to receive the number of timeouts, or NULL if not needed. \end{description}
\end{Desc}
\hypertarget{cue_8h_31b61a3f852fcd8c2cd9dd36c5e682a4}{
\index{cue.h@{cue.h}!LCI_newCue@{LCI\_\-newCue}}
\index{LCI_newCue@{LCI\_\-newCue}!cue.h@{cue.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf LCI\_\-cue}$\ast$ LCI\_\-newCue (void)}}
\label{cue_8h_31b61a3f852fcd8c2cd9dd36c5e682a4}


Create a new cue. 

This routine allocates memory for the cue structure then creates the timer and semaphore to be held by the structure

\begin{Desc}
\item[Returns:]Pointer to an allocated and initialised cue structure, or NULL if there is an error. \end{Desc}
\hypertarget{cue_8h_9e35d61657eb30d22f26d68392f52e05}{
\index{cue.h@{cue.h}!LCI_signalCue@{LCI\_\-signalCue}}
\index{LCI_signalCue@{LCI\_\-signalCue}!cue.h@{cue.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void LCI\_\-signalCue ({\bf LCI\_\-cue} $\ast$ {\em cue})}}
\label{cue_8h_9e35d61657eb30d22f26d68392f52e05}


Signal cue completion. 

This routine signals completion by setting the end state to LCI\_\-CUE\_\-SIGNALED and giving the semaphore

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cue}]Pointer to a cue that is being waited upon \end{description}
\end{Desc}
\hypertarget{cue_8h_5542d4f986974bee670ebb3cf8adeeda}{
\index{cue.h@{cue.h}!LCI_waitCue@{LCI\_\-waitCue}}
\index{LCI_waitCue@{LCI\_\-waitCue}!cue.h@{cue.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned LCI\_\-waitCue ({\bf LCI\_\-cue} $\ast$ {\em cue}, unsigned {\em timeout})}}
\label{cue_8h_5542d4f986974bee670ebb3cf8adeeda}


Wait for a cue to complete or time out. 

This routine starts the wake-up timer and takes the semaphore

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cue}]Pointer to an allocated, initialised cue structure (from LCI\_\-newCue)\item[{\em timeout}]Time, in microseconds, until the call times out.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em LCI\_\-CUE\_\-SIGNALED}]Another task called signal \item[{\em LCI\_\-CUE\_\-TIMEDOUT}]If the timer expired before the cue was signalled. \item[{\em LCI\_\-CUE\_\-FAILED}]Timer failed to start (because of incorrect state) \end{description}
\end{Desc}
