\hypertarget{LL_8ih}{
\section{LL.ih File Reference}
\label{LL_8ih}\index{LL.ih@{LL.ih}}
}
Defines the inline Linked List (LL) routines. 


{\tt \#include \char`\"{}BBC/inline.h\char`\"{}}\par
{\tt \#include \char`\"{}BBC/LL\_\-pubdefs.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{LL_8ih_a0}{LL\_\-\_\-EXT\_\-PROTO}\ INLINE\_\-USR\_\-EXT\_\-PROTO
\item 
\#define \hyperlink{LL_8ih_a1}{LL\_\-\_\-LCL\_\-PROTO}\ INLINE\_\-USR\_\-LCL\_\-PROTO
\item 
\#define \hyperlink{LL_8ih_a2}{LL\_\-\_\-EXT\_\-FNC}\ INLINE\_\-USR\_\-EXT\_\-FNC
\item 
\#define \hyperlink{LL_8ih_a3}{LL\_\-\_\-LCL\_\-FNC}\ INLINE\_\-USR\_\-LCL\_\-FNC
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
LL\_\-\_\-EXT\_\-PROTO void \hyperlink{LL_8ih_a4}{LL\_\-\_\-destroy} (struct \hyperlink{struct__LL__list}{\_\-LL\_\-list} $\ast$list)
\begin{CompactList}\small\item\em Destroys the data structures associate with a linked list.\item\end{CompactList}\item 
LL\_\-\_\-EXT\_\-PROTO void \hyperlink{LL_8ih_a5}{LL\_\-\_\-init} (struct \hyperlink{struct__LL__list}{\_\-LL\_\-list} $\ast$list)
\begin{CompactList}\small\item\em Initializes the list head of a doubly linked list to an empty list.\item\end{CompactList}\item 
LL\_\-\_\-EXT\_\-PROTO struct \hyperlink{struct__LL__node}{\_\-LL\_\-node} $\ast$ \hyperlink{LL_8ih_a6}{LL\_\-\_\-insert} (struct \hyperlink{struct__LL__list}{\_\-LL\_\-list} $\ast$list, struct \hyperlink{struct__LL__node}{\_\-LL\_\-node} $\ast$node)
\begin{CompactList}\small\item\em Adds a node to the tail of a previously initialized linked list.\item\end{CompactList}\item 
LL\_\-\_\-EXT\_\-PROTO struct \hyperlink{struct__LL__node}{\_\-LL\_\-node} $\ast$ \hyperlink{LL_8ih_a7}{LL\_\-\_\-jam} (struct \hyperlink{struct__LL__list}{\_\-LL\_\-list} $\ast$list, struct \hyperlink{struct__LL__node}{\_\-LL\_\-node} $\ast$node)
\begin{CompactList}\small\item\em Adds a node to the head of a previously initialized linked list.\item\end{CompactList}\item 
LL\_\-\_\-EXT\_\-PROTO struct \hyperlink{struct__LL__node}{\_\-LL\_\-node} $\ast$ \hyperlink{LL_8ih_a8}{LL\_\-\_\-remove} (struct \hyperlink{struct__LL__list}{\_\-LL\_\-list} $\ast$list)
\begin{CompactList}\small\item\em Removes the node from the tail of a previously initialized linked list. An empty list returns NULL as its node.\item\end{CompactList}\item 
LL\_\-\_\-EXT\_\-PROTO struct \hyperlink{struct__LL__node}{\_\-LL\_\-node} $\ast$ \hyperlink{LL_8ih_a9}{LL\_\-\_\-unlink} (struct \hyperlink{struct__LL__node}{\_\-LL\_\-node} $\ast$node)
\begin{CompactList}\small\item\em Removes the specified node from the linked list.\item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Defines the inline Linked List (LL) routines.



\begin{Desc}
\item[Author: ]\par
JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}
This defines the inline versions of the Linked List routines. These allow the user to build non-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.

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 LLI routines provide the same functionality with the added feature of being interlocked, and, therefore, thread safe.



\subsection{Define Documentation}
\hypertarget{LL_8ih_a2}{
\index{LL.ih@{LL.ih}!LL__EXT_FNC@{LL\_\-\_\-EXT\_\-FNC}}
\index{LL__EXT_FNC@{LL\_\-\_\-EXT\_\-FNC}!LL.ih@{LL.ih}}
\subsubsection[LL\_\-\_\-EXT\_\-FNC]{\setlength{\rightskip}{0pt plus 5cm}\#define LL\_\-\_\-EXT\_\-FNC\ INLINE\_\-USR\_\-EXT\_\-FNC}}
\label{LL_8ih_a2}


External Function declaration \hypertarget{LL_8ih_a0}{
\index{LL.ih@{LL.ih}!LL__EXT_PROTO@{LL\_\-\_\-EXT\_\-PROTO}}
\index{LL__EXT_PROTO@{LL\_\-\_\-EXT\_\-PROTO}!LL.ih@{LL.ih}}
\subsubsection[LL\_\-\_\-EXT\_\-PROTO]{\setlength{\rightskip}{0pt plus 5cm}\#define LL\_\-\_\-EXT\_\-PROTO\ INLINE\_\-USR\_\-EXT\_\-PROTO}}
\label{LL_8ih_a0}


External Prototype spec \hypertarget{LL_8ih_a3}{
\index{LL.ih@{LL.ih}!LL__LCL_FNC@{LL\_\-\_\-LCL\_\-FNC}}
\index{LL__LCL_FNC@{LL\_\-\_\-LCL\_\-FNC}!LL.ih@{LL.ih}}
\subsubsection[LL\_\-\_\-LCL\_\-FNC]{\setlength{\rightskip}{0pt plus 5cm}\#define LL\_\-\_\-LCL\_\-FNC\ INLINE\_\-USR\_\-LCL\_\-FNC}}
\label{LL_8ih_a3}


Internal Function declaration \hypertarget{LL_8ih_a1}{
\index{LL.ih@{LL.ih}!LL__LCL_PROTO@{LL\_\-\_\-LCL\_\-PROTO}}
\index{LL__LCL_PROTO@{LL\_\-\_\-LCL\_\-PROTO}!LL.ih@{LL.ih}}
\subsubsection[LL\_\-\_\-LCL\_\-PROTO]{\setlength{\rightskip}{0pt plus 5cm}\#define LL\_\-\_\-LCL\_\-PROTO\ INLINE\_\-USR\_\-LCL\_\-PROTO}}
\label{LL_8ih_a1}


Internal Prototype spec 

\subsection{Function Documentation}
\hypertarget{LL_8ih_a4}{
\index{LL.ih@{LL.ih}!LL__destroy@{LL\_\-\_\-destroy}}
\index{LL__destroy@{LL\_\-\_\-destroy}!LL.ih@{LL.ih}}
\subsubsection[LL\_\-\_\-destroy]{\setlength{\rightskip}{0pt plus 5cm}LL\_\-\_\-EXT\_\-FNC void LL\_\-\_\-destroy (struct \hyperlink{struct__LL__list}{\_\-LL\_\-list} $\ast$ {\em list})}}
\label{LL_8ih_a4}


Destroys the data structures associate with a linked list.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
list}]Pointer to the link list head 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{LL_8ih_a5}{
\index{LL.ih@{LL.ih}!LL__init@{LL\_\-\_\-init}}
\index{LL__init@{LL\_\-\_\-init}!LL.ih@{LL.ih}}
\subsubsection[LL\_\-\_\-init]{\setlength{\rightskip}{0pt plus 5cm}LL\_\-\_\-EXT\_\-FNC void LL\_\-\_\-init (struct \hyperlink{struct__LL__list}{\_\-LL\_\-list} $\ast$ {\em list})}}
\label{LL_8ih_a5}


Initializes the list head of a doubly linked list to an empty list.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
list}]Pointer to the link list head to initialize.\end{description}
\end{Desc}
The linked list head is initialized to an empty list. This must be done before performing any other operations on the linked list. \hypertarget{LL_8ih_a6}{
\index{LL.ih@{LL.ih}!LL__insert@{LL\_\-\_\-insert}}
\index{LL__insert@{LL\_\-\_\-insert}!LL.ih@{LL.ih}}
\subsubsection[LL\_\-\_\-insert]{\setlength{\rightskip}{0pt plus 5cm}LL\_\-\_\-EXT\_\-FNC struct \hyperlink{struct__LL__node}{\_\-LL\_\-node} $\ast$ LL\_\-\_\-insert (struct \hyperlink{struct__LL__list}{\_\-LL\_\-list} $\ast$ {\em list}, struct \hyperlink{struct__LL__node}{\_\-LL\_\-node} $\ast$ {\em node})}}
\label{LL_8ih_a6}


Adds a node to the tail of a previously initialized linked list.

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


Adds a node to the head of a previously initialized linked list.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
list}]A previously initialized linked list head. \item[{\em 
node}]The node to add.  \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
Pointer to the old forward link. This can be used to test  whether this was the first item on the queue. \par
 If return\_\-value == \&list, the empty)\end{Desc}
Adds the specified node to the head of the list. If all nodes are added with the LL\_\-\_\-jam routine, the list behaves as a LIFO. \hypertarget{LL_8ih_a8}{
\index{LL.ih@{LL.ih}!LL__remove@{LL\_\-\_\-remove}}
\index{LL__remove@{LL\_\-\_\-remove}!LL.ih@{LL.ih}}
\subsubsection[LL\_\-\_\-remove]{\setlength{\rightskip}{0pt plus 5cm}LL\_\-\_\-EXT\_\-FNC struct \hyperlink{struct__LL__node}{\_\-LL\_\-node} $\ast$ LL\_\-\_\-remove (struct \hyperlink{struct__LL__list}{\_\-LL\_\-list} $\ast$ {\em list})}}
\label{LL_8ih_a8}


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

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
list}]A previously initialized linked list head. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
A pointer to the removed node of NULL if the list is empty. \end{Desc}


Removes the node at the head of the list. If the list is empty, NULL is  returned. \hypertarget{LL_8ih_a9}{
\index{LL.ih@{LL.ih}!LL__unlink@{LL\_\-\_\-unlink}}
\index{LL__unlink@{LL\_\-\_\-unlink}!LL.ih@{LL.ih}}
\subsubsection[LL\_\-\_\-unlink]{\setlength{\rightskip}{0pt plus 5cm}LL\_\-\_\-EXT\_\-FNC struct \hyperlink{struct__LL__node}{\_\-LL\_\-node} $\ast$ LL\_\-\_\-unlink (struct \hyperlink{struct__LL__node}{\_\-LL\_\-node} $\ast$ {\em node})}}
\label{LL_8ih_a9}


Removes the specified node from the linked list.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
node}]The node to unlink from the list \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
Pointer to the forward link of the removed node. \end{Desc}


Removes the specified node from a previously initialized linked list. This is a dangerous operation unless the stability of the que is guaranteed. 