\hypertarget{QI_8c}{
\section{QI.c File Reference}
\label{QI_8c}\index{QI.c@{QI.c}}
}
Implements the non-inline Que Interlocked (QI) routines. 

{\tt \#include \char`\"{}IPBS/Q\_\-protos.h\char`\"{}}\par
{\tt \#include \char`\"{}IPBS/RW\_\-protos.h\char`\"{}}\par
{\tt \#include \char`\"{}IPBS/QI.h\char`\"{}}\par


Include dependency graph for QI.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=396pt]{QI_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{QI_8c_a0}{QI\_\-destroy} (\hyperlink{struct__QI__head}{QI\_\-head} $\ast$que)
\begin{CompactList}\small\item\em Destroys the data structures associate with the que. \item\end{CompactList}\item 
int \hyperlink{QI_8c_a1}{QI\_\-init} (\hyperlink{struct__QI__head}{QI\_\-head} $\ast$que, \hyperlink{QI__type_8h_a0}{QI\_\-type} type)
\begin{CompactList}\small\item\em Initializes the que to an empty que of the specified type. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Implements the non-inline Que Interlocked (QI) routines. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}    CVS $Id: QI.c,v 1.1.1.1 2006/02/10 21:45:33 saxton Exp $
\end{verbatim}
\normalsize


This implements the non-inline versions of the interlocked Que routines These allow the user to build interlocked doubly linked lists. These routines parallel some of the functionality of the Vx\-Works {\em ll\-XXXX\/} routines, but are portable to both Vx\-Works and host platforms and have the interlocked mechanism as a built-in feature.

See also the non-inline versions of these routines which may save code space and increase modularity at the expense of performance. The Q routines provide the same functionality without the added feature of being interlocked, and, therefore, thread safe.

\subsection{Function Documentation}
\hypertarget{QI_8c_a0}{
\index{QI.c@{QI.c}!QI_destroy@{QI\_\-destroy}}
\index{QI_destroy@{QI\_\-destroy}!QI.c@{QI.c}}
\subsubsection[QI\_\-destroy]{\setlength{\rightskip}{0pt plus 5cm}int QI\_\-destroy (\hyperlink{struct__QI__head}{QI\_\-head} $\ast$ {\em que})}}
\label{QI_8c_a0}


Destroys the data structures associate with the que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]Pointer to the que to destroy.\end{description}
\end{Desc}
This routine frees any resources the que gathered when it was initialized. The actual resources released depends on both the platform and whether blocking and timeouts were requested.\hypertarget{QI_8c_a1}{
\index{QI.c@{QI.c}!QI_init@{QI\_\-init}}
\index{QI_init@{QI\_\-init}!QI.c@{QI.c}}
\subsubsection[QI\_\-init]{\setlength{\rightskip}{0pt plus 5cm}int QI\_\-init (\hyperlink{struct__QI__head}{QI\_\-head} $\ast$ {\em que}, \hyperlink{QI__type_8h_a0}{QI\_\-type} {\em type})}}
\label{QI_8c_a1}


Initializes the que to an empty que of the specified type. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]Pointer to the que to initialize. \item[{\em type}]The type of interlocked que. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0,Success}]\item[{\em ENOMEM,Insufficient}]memory \item[{\em ENOTSUP,Type}]not supported.\end{description}
\end{Desc}
The que is initialized to an empty que. This must be done before performing any other operations on the que. The {\em type\/} determines whether the que is capable of blocking when attempting to remove a node from an empty que. See the {\em enum\/} QI\_\-opt\_\-blocking for the available blocking types. For ques that block, one can also specify that timeouts are available. Since timeout support may demand additional resources, the user is asked to state upfront whether timeouts are needed.

\begin{Desc}
\item[Note:]Conspicious by its absence is an interlocked unlink. This is deliberate. There is no safe way to provide a routine to unlink a node in an interlocked fashion. If the node was located without any interlocks on the que, there is no guarantee that by the time the mythical QI\_\-unlink routine gets called and interlocks the que, that the node is still on the que.\end{Desc}
