\hypertarget{L_8ih}{
\section{L.ih File Reference}
\label{L_8ih}\index{L.ih@{L.ih}}
}
Singly linked list, inline version.  


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


Include dependency graph for L.ih:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=161pt]{L_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=88pt]{L_8ih__dep__incl}
\end{center}
\end{figure}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{L_8ih_a0}{
\#define \hyperlink{L_8ih_a0}{L\_\-\_\-EXP\_\-PROTO}\ INLINE\_\-USR\_\-EXP\_\-PROTO}
\label{L_8ih_a0}

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

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

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

\begin{CompactList}\small\item\em Internal Function declaration. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
L\_\-\_\-EXP\_\-PROTO void \hyperlink{L_8ih_a4}{L\_\-\_\-append} (\hyperlink{struct__L__head}{L\_\-head} $\ast$dst, \hyperlink{struct__L__head}{L\_\-head} $\ast$src) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Appends the {\em src\/} list members to the {\em dst\/} list. \item\end{CompactList}\item 
L\_\-\_\-EXP\_\-PROTO void \hyperlink{L_8ih_a5}{L\_\-\_\-destroy} (\hyperlink{struct__L__head}{L\_\-head} $\ast$list) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Destroys the data structures associate with the list. \item\end{CompactList}\item 
L\_\-\_\-EXP\_\-PROTO int \hyperlink{L_8ih_a6}{L\_\-\_\-empty} (\hyperlink{struct__L__head}{L\_\-head} $\ast$list) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Returns non zero if the list is empty list. \item\end{CompactList}\item 
L\_\-\_\-EXP\_\-PROTO void \hyperlink{L_8ih_a7}{L\_\-\_\-init} (\hyperlink{struct__L__head}{L\_\-head} $\ast$list) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Initializes a list (singly linked list) to an empty list. \item\end{CompactList}\item 
L\_\-\_\-EXP\_\-PROTO \hyperlink{struct__L__node}{L\_\-node} $\ast$ \hyperlink{L_8ih_a8}{L\_\-\_\-insert} (\hyperlink{struct__L__head}{L\_\-head} $\ast$list, \hyperlink{struct__L__node}{L\_\-node} $\ast$node) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Adds a node to the tail of a previously initialized list. \item\end{CompactList}\item 
L\_\-\_\-EXP\_\-PROTO \hyperlink{struct__L__node}{L\_\-node} $\ast$ \hyperlink{L_8ih_a9}{L\_\-\_\-jam} (\hyperlink{struct__L__head}{L\_\-head} $\ast$list, \hyperlink{struct__L__node}{L\_\-node} $\ast$node) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Adds a node to the head of a previously initialized list. \item\end{CompactList}\item 
L\_\-\_\-EXP\_\-PROTO void \hyperlink{L_8ih_a10}{L\_\-\_\-prepend} (\hyperlink{struct__L__head}{L\_\-head} $\ast$dst, \hyperlink{struct__L__head}{L\_\-head} $\ast$src) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Prepends the {\em src\/} list members to the {\em dst\/} list. \item\end{CompactList}\item 
L\_\-\_\-EXP\_\-PROTO \hyperlink{struct__L__node}{L\_\-node} $\ast$ \hyperlink{L_8ih_a11}{L\_\-\_\-remove} (\hyperlink{struct__L__head}{L\_\-head} $\ast$list) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Removes the node from the head of a previously initialized list.. An empty list returns NULL as its node. \item\end{CompactList}\item 
L\_\-\_\-EXP\_\-PROTO \hyperlink{struct__L__node}{L\_\-node} $\ast$ \hyperlink{L_8ih_a12}{L\_\-\_\-unlink} (const \hyperlink{struct__L__node}{L\_\-node} $\ast$node, \hyperlink{struct__L__node}{L\_\-node} $\ast$predecessor) ATTR\_\-UNUSED\_\-OK
\begin{CompactList}\small\item\em Removes the specified node from the list. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Singly 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: L.ih,v 1.6 2005/10/01 01:00:11 russell Exp $
\end{verbatim}\normalsize


\begin{Desc}
\item[SYNOPSIS]This defines the inline versions of the L routines. These allow the the user to build non-interlocked singly linked lists. In the non-interlocked form, they offer the slight advantage of being lower overhead, having to maintain only a single link.\end{Desc}
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 LI routines provide the same functionality with the added feature of being interlocked, and, therefore, thread safe.

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


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

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


Destroys the data structures associate with the list. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em list}]Pointer to the list 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{L_8ih_a6}{
\index{L.ih@{L.ih}!L__empty@{L\_\-\_\-empty}}
\index{L__empty@{L\_\-\_\-empty}!L.ih@{L.ih}}
\subsubsection[L\_\-\_\-empty]{\setlength{\rightskip}{0pt plus 5cm}L\_\-\_\-EXP\_\-FNC int L\_\-\_\-empty (\hyperlink{struct__L__head}{L\_\-head} $\ast$ {\em list})}}
\label{L_8ih_a6}


Returns non zero if the list is empty list. 

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


Initializes a list (singly linked list) to an empty list. 

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


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em list}]A previously initialized list. \item[{\em node}]The node to add at the tail of the mode \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the old tail. This can be used to test whether this was the first item on the list.\end{Desc}
If return\_\-value == list then empty

Adds the specified node to the tail of the list. If all nodes are added with the L\_\-\_\-insert routine, the list behaves as a FIFO. \hypertarget{L_8ih_a9}{
\index{L.ih@{L.ih}!L__jam@{L\_\-\_\-jam}}
\index{L__jam@{L\_\-\_\-jam}!L.ih@{L.ih}}
\subsubsection[L\_\-\_\-jam]{\setlength{\rightskip}{0pt plus 5cm}L\_\-\_\-EXP\_\-FNC \hyperlink{struct__L__node}{L\_\-node} $\ast$ L\_\-\_\-jam (\hyperlink{struct__L__head}{L\_\-head} $\ast$ {\em list}, \hyperlink{struct__L__node}{L\_\-node} $\ast$ {\em node})}}
\label{L_8ih_a9}


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em list}]A previously initialized list. \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 list. \par
 If return\_\-value == list, then empty\end{Desc}
Adds the specified node to the head of the list. If all nodes are added with the L\_\-\_\-jam routine, the list behaves as a LIFO. \hypertarget{L_8ih_a10}{
\index{L.ih@{L.ih}!L__prepend@{L\_\-\_\-prepend}}
\index{L__prepend@{L\_\-\_\-prepend}!L.ih@{L.ih}}
\subsubsection[L\_\-\_\-prepend]{\setlength{\rightskip}{0pt plus 5cm}L\_\-\_\-EXP\_\-FNC void L\_\-\_\-prepend (\hyperlink{struct__L__head}{L\_\-head} $\ast$ {\em dst}, \hyperlink{struct__L__head}{L\_\-head} $\ast$ {\em src})}}
\label{L_8ih_a10}


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

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


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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em list}]A previously initialized list. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A pointer to the removed node or 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{L_8ih_a12}{
\index{L.ih@{L.ih}!L__unlink@{L\_\-\_\-unlink}}
\index{L__unlink@{L\_\-\_\-unlink}!L.ih@{L.ih}}
\subsubsection[L\_\-\_\-unlink]{\setlength{\rightskip}{0pt plus 5cm}L\_\-\_\-EXP\_\-FNC \hyperlink{struct__L__node}{L\_\-node} $\ast$ L\_\-\_\-unlink (const \hyperlink{struct__L__node}{L\_\-node} $\ast$ {\em node}, \hyperlink{struct__L__node}{L\_\-node} $\ast$ {\em predecessor})}}
\label{L_8ih_a12}


Removes the specified node from the list. 

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