\hypertarget{Q_8ih}{
\section{Q.ih File Reference}
\label{Q_8ih}\index{Q.ih@{Q.ih}}
}
Doubly linked list, inline version. 

{\tt \#include \char`\"{}PBI/Inline.h\char`\"{}}\par
{\tt \#include \char`\"{}PBI/Attribute.h\char`\"{}}\par
{\tt \#include \char`\"{}IPBS/Q\_\-pubdefs.h\char`\"{}}\par


Include dependency graph for Q.ih:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=180pt]{Q_8ih__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=82pt]{Q_8ih__dep__incl}
\end{center}
\end{figure}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{Q_8ih_a0}{
\#define \hyperlink{Q_8ih_a0}{Q\_\-\_\-EXP\_\-PROTO}~INLINE\_\-USR\_\-EXP\_\-PROTO}
\label{Q_8ih_a0}

\begin{CompactList}\small\item\em Export Prototype spec. \item\end{CompactList}\item 
\hypertarget{Q_8ih_a1}{
\#define \hyperlink{Q_8ih_a1}{Q\_\-\_\-LCL\_\-PROTO}~INLINE\_\-USR\_\-LCL\_\-PROTO}
\label{Q_8ih_a1}

\begin{CompactList}\small\item\em Internal Prototype spec. \item\end{CompactList}\item 
\hypertarget{Q_8ih_a2}{
\#define \hyperlink{Q_8ih_a2}{Q\_\-\_\-EXP\_\-FNC}~INLINE\_\-USR\_\-EXP\_\-FNC}
\label{Q_8ih_a2}

\begin{CompactList}\small\item\em Export Function declaration. \item\end{CompactList}\item 
\hypertarget{Q_8ih_a3}{
\#define \hyperlink{Q_8ih_a3}{Q\_\-\_\-LCL\_\-FNC}~INLINE\_\-USR\_\-LCL\_\-FNC}
\label{Q_8ih_a3}

\begin{CompactList}\small\item\em Internal Function declaration. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
Q\_\-\_\-EXP\_\-PROTO void \hyperlink{Q_8ih_a4}{Q\_\-\_\-append} (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$dst, \hyperlink{struct__Q__head}{Q\_\-head} $\ast$src) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Appends the {\em src\/} que members to the {\em dst\/} que. \item\end{CompactList}\item 
Q\_\-\_\-EXP\_\-PROTO void \hyperlink{Q_8ih_a5}{Q\_\-\_\-destroy} (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$que) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Destroys the data structures associate with the que. \item\end{CompactList}\item 
Q\_\-\_\-EXP\_\-PROTO int \hyperlink{Q_8ih_a6}{Q\_\-\_\-empty} (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$que) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Returns non zero if the que is empty. \item\end{CompactList}\item 
Q\_\-\_\-EXP\_\-PROTO void \hyperlink{Q_8ih_a7}{Q\_\-\_\-init} (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$que) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Initializes a que (doubly linked list) to an empty que. \item\end{CompactList}\item 
Q\_\-\_\-EXP\_\-PROTO \hyperlink{struct__Q__node}{Q\_\-node} $\ast$ \hyperlink{Q_8ih_a8}{Q\_\-\_\-insert} (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$que, \hyperlink{struct__Q__node}{Q\_\-node} $\ast$node) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Adds a node to the tail of a previously initialized que. \item\end{CompactList}\item 
Q\_\-\_\-EXP\_\-PROTO \hyperlink{struct__Q__node}{Q\_\-node} $\ast$ \hyperlink{Q_8ih_a9}{Q\_\-\_\-jam} (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$que, \hyperlink{struct__Q__node}{Q\_\-node} $\ast$node) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Adds a node to the head of a previously initialized que. \item\end{CompactList}\item 
Q\_\-\_\-EXP\_\-PROTO void \hyperlink{Q_8ih_a10}{Q\_\-\_\-prepend} (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$dst, \hyperlink{struct__Q__head}{Q\_\-head} $\ast$src) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Prepends the {\em src\/} que members to the {\em que\/} list. \item\end{CompactList}\item 
Q\_\-\_\-EXP\_\-PROTO \hyperlink{struct__Q__node}{Q\_\-node} $\ast$ \hyperlink{Q_8ih_a11}{Q\_\-\_\-remove} (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$que) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Removes the node from the tail of a previously initialized que. An empty que returns NULL as its node. \item\end{CompactList}\item 
Q\_\-\_\-EXP\_\-PROTO \hyperlink{struct__Q__node}{Q\_\-node} $\ast$ \hyperlink{Q_8ih_a12}{Q\_\-\_\-unlink} (const \hyperlink{struct__Q__node}{Q\_\-node} $\ast$node) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Removes the specified node from the que. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Doubly linked list, inline version. 

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


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


This defines the inline versions of the Que routines. These allow the the user to build non-interlocked doubly linked lists. These routines parallel some of the functionality of the Vx\-Works {\em llxxxx\/} routines, but are portable to both Vx\-Works and host platforms.

See also the non-inlined versions of these routines which offer possible savings in code space and increased modularity at the expense of some performance. The QI routines provide the same functionality with the added feature of being interlocked, and, therefore, thread safe.

\subsection{Function Documentation}
\hypertarget{Q_8ih_a4}{
\index{Q.ih@{Q.ih}!Q__append@{Q\_\-\_\-append}}
\index{Q__append@{Q\_\-\_\-append}!Q.ih@{Q.ih}}
\subsubsection[Q\_\-\_\-append]{\setlength{\rightskip}{0pt plus 5cm}Q\_\-\_\-EXP\_\-FNC void Q\_\-\_\-append (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$ {\em dst}, \hyperlink{struct__Q__head}{Q\_\-head} $\ast$ {\em src})}}
\label{Q_8ih_a4}


Appends the {\em src\/} que members to the {\em dst\/} que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]A previously initialized que acting as the destination \item[{\em src}]A previously initialized que acting as the source\end{description}
\end{Desc}
Appends the source que to the destination que. After this operation the destination que will have consist of its original members followed by the members on the source que. The source que will be empty.\hypertarget{Q_8ih_a5}{
\index{Q.ih@{Q.ih}!Q__destroy@{Q\_\-\_\-destroy}}
\index{Q__destroy@{Q\_\-\_\-destroy}!Q.ih@{Q.ih}}
\subsubsection[Q\_\-\_\-destroy]{\setlength{\rightskip}{0pt plus 5cm}Q\_\-\_\-EXP\_\-FNC void Q\_\-\_\-destroy (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$ {\em que})}}
\label{Q_8ih_a5}


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}
Currently this routine is effectively a NO-OP, but is provided for upward compatibility, just in case at some time in the future this operations does something meaningful.\hypertarget{Q_8ih_a6}{
\index{Q.ih@{Q.ih}!Q__empty@{Q\_\-\_\-empty}}
\index{Q__empty@{Q\_\-\_\-empty}!Q.ih@{Q.ih}}
\subsubsection[Q\_\-\_\-empty]{\setlength{\rightskip}{0pt plus 5cm}Q\_\-\_\-EXP\_\-FNC int Q\_\-\_\-empty (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$ {\em que})}}
\label{Q_8ih_a6}


Returns non zero if the que is empty. 

\begin{Desc}
\item[Returns:]Non zero if the que is empty list, else 0 \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]Pointer to the que to initialize.\end{description}
\end{Desc}
\hypertarget{Q_8ih_a7}{
\index{Q.ih@{Q.ih}!Q__init@{Q\_\-\_\-init}}
\index{Q__init@{Q\_\-\_\-init}!Q.ih@{Q.ih}}
\subsubsection[Q\_\-\_\-init]{\setlength{\rightskip}{0pt plus 5cm}Q\_\-\_\-EXP\_\-FNC void Q\_\-\_\-init (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$ {\em que})}}
\label{Q_8ih_a7}


Initializes a que (doubly linked list) to an empty que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]Pointer to the que to initialize.\end{description}
\end{Desc}
The que is initialized to an empty que. This must be done before performing any other operations on the que.\hypertarget{Q_8ih_a8}{
\index{Q.ih@{Q.ih}!Q__insert@{Q\_\-\_\-insert}}
\index{Q__insert@{Q\_\-\_\-insert}!Q.ih@{Q.ih}}
\subsubsection[Q\_\-\_\-insert]{\setlength{\rightskip}{0pt plus 5cm}Q\_\-\_\-EXP\_\-FNC \hyperlink{struct__Q__node}{Q\_\-node} $\ast$ Q\_\-\_\-insert (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$ {\em que}, \hyperlink{struct__Q__node}{Q\_\-node} $\ast$ {\em node})}}
\label{Q_8ih_a8}


Adds a node to the tail of a previously initialized que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]A previously initialized que. \item[{\em node}]The node to add at the tail of the que \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the old backward link. This can be used to test whether this was the first item on the que. \par
 If return\_\-value == que, then empty\end{Desc}
Adds the specified node to the tail of the que. If all nodes are added with the Q\_\-\_\-insert routine, the que behaves as a FIFO.\hypertarget{Q_8ih_a9}{
\index{Q.ih@{Q.ih}!Q__jam@{Q\_\-\_\-jam}}
\index{Q__jam@{Q\_\-\_\-jam}!Q.ih@{Q.ih}}
\subsubsection[Q\_\-\_\-jam]{\setlength{\rightskip}{0pt plus 5cm}Q\_\-\_\-EXP\_\-FNC \hyperlink{struct__Q__node}{Q\_\-node} $\ast$ Q\_\-\_\-jam (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$ {\em que}, \hyperlink{struct__Q__node}{Q\_\-node} $\ast$ {\em node})}}
\label{Q_8ih_a9}


Adds a node to the head of a previously initialized que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]A previously initialized que. \item[{\em node}]The node to add. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the old forward link. This can be used to test whether this was the first item on the que. \par
 If return\_\-value == \&que, the\-N empty\end{Desc}
Adds the specified node to the head of the que. If all nodes are added with the Q\_\-\_\-jam routine, the que behaves as a LIFO.\hypertarget{Q_8ih_a10}{
\index{Q.ih@{Q.ih}!Q__prepend@{Q\_\-\_\-prepend}}
\index{Q__prepend@{Q\_\-\_\-prepend}!Q.ih@{Q.ih}}
\subsubsection[Q\_\-\_\-prepend]{\setlength{\rightskip}{0pt plus 5cm}Q\_\-\_\-EXP\_\-FNC void Q\_\-\_\-prepend (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$ {\em dst}, \hyperlink{struct__Q__head}{Q\_\-head} $\ast$ {\em src})}}
\label{Q_8ih_a10}


Prepends the {\em src\/} que members to the {\em que\/} list. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em dst}]A previously initialized que acting as the destination \item[{\em src}]A previously initialized que acting as the source\end{description}
\end{Desc}
Prepends the source que to the destination que. After this operation the destination que will have consist of its original members preceded by the members on the source que. The source que will be empty.\hypertarget{Q_8ih_a11}{
\index{Q.ih@{Q.ih}!Q__remove@{Q\_\-\_\-remove}}
\index{Q__remove@{Q\_\-\_\-remove}!Q.ih@{Q.ih}}
\subsubsection[Q\_\-\_\-remove]{\setlength{\rightskip}{0pt plus 5cm}Q\_\-\_\-EXP\_\-FNC \hyperlink{struct__Q__node}{Q\_\-node} $\ast$ Q\_\-\_\-remove (\hyperlink{struct__Q__head}{Q\_\-head} $\ast$ {\em que})}}
\label{Q_8ih_a11}


Removes the node from the tail of a previously initialized que. An empty que returns NULL as its node. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em que}]A previously initialized que. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A pointer to the removed node of NULL if the que is empty.\end{Desc}
Removes the node at the head of the que. If the que is empty, NULL is returned.\hypertarget{Q_8ih_a12}{
\index{Q.ih@{Q.ih}!Q__unlink@{Q\_\-\_\-unlink}}
\index{Q__unlink@{Q\_\-\_\-unlink}!Q.ih@{Q.ih}}
\subsubsection[Q\_\-\_\-unlink]{\setlength{\rightskip}{0pt plus 5cm}Q\_\-\_\-EXP\_\-FNC \hyperlink{struct__Q__node}{Q\_\-node} $\ast$ Q\_\-\_\-unlink (const \hyperlink{struct__Q__node}{Q\_\-node} $\ast$ {\em node})}}
\label{Q_8ih_a12}


Removes the specified node from the que. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em node}]The node to unlink from the que \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the forward link of the removed node.\end{Desc}
Removes the specified node from a previously initialized que.