GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBS / V2-12-1 > pbs / rhel5-32


Interface   Data Structures   File List   Data Fields   Globals  

L_protos.h File Reference

Singly linked list, function proto-types, callable version. More...

#include <PBS/L_comdefs.h>

Functions

void L_append (L_head *dst, L_head *src)
 Appends the src list members to the dst list.
void L_destroy (L_head *list)
 Destroys the data structures associate with the list.
void L_init (L_head *list)
 Initializes a singulaly linked list to an empty list.
L_nodeL_insert (L_head *list, L_node *node)
 Adds a node to the tail of a previously initialized list..
L_nodeL_jam (L_head *list, L_node *node)
 Adds a node to the head of a previously initialized list.
void L_prepend (L_head *dst, L_head *src)
 Prepends the src list members to the dst list.
L_nodeL_remove (L_head *list)
 Removes the node from the head of a previously initialized list. An empty list returns NULL as its node.
L_nodeL_unlink (const L_node *node, L_node *predecessor)
 Removes the specified node from the list.


Detailed Description

Singly linked list, function proto-types, callable version.

Author:
JJRussell - russell@slac.stanford.edu

    CVS $Id: L_protos.h,v 1.4 2011/03/24 23:05:42 apw Exp $

SYNOPSIS
This defines the non-inline versions of the L routines. These allow the user to build non-interlocked singly linked lists. In general, the Q routines are more versatile, but in cases where minimum overhead is necessary the singly linked list have an advantage.
See also the non-inline versions of these routines which may save code space and increase modularity at the expense of performance. The LI routines provide the same functionality with the added feature of being interlocked, and, therefore, thread safe.

Function Documentation

void L_append ( L_head dst,
L_head src 
)

Appends the src list members to the dst list.

Parameters:
dst A previously initialized list acting as the destination
src A previously initialized list acting as the source
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.

void L_destroy ( L_head list  ) 

Destroys the data structures associate with the list.

Parameters:
list Pointer to the list to destroy.
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.

Referenced by LI_destroy().

void L_init ( L_head list  ) 

Initializes a singulaly linked list to an empty list.

Parameters:
list Pointer to the list to initialize.
The list is initialized to an empty list. This must be done before performing any other operations on the list.

Referenced by LI_init(), and PL_init().

L_node * L_insert ( L_head list,
L_node node 
)

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

Parameters:
list A previously initialized list.
node The node to add at the tail of the list
Returns:
Pointer to the old backward link. This can be used to test whether this was the first item on the list.
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.

L_node * L_jam ( L_head list,
L_node node 
)

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

Parameters:
list A previously initialized list..
node The node to add.
Returns:
Pointer to the old forward link. This can be used to test whether this was the first item on the list.
If return_value == que, then empty
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.

void L_prepend ( L_head dst,
L_head src 
)

Prepends the src list members to the dst list.

Parameters:
dst A previously initialized list acting as the destination
src A previously initialized list acting as the source
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.

Referenced by LI__prepend().

L_node * L_remove ( L_head list  ) 

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

Parameters:
list A previously initialized list.
Returns:
A pointer to the removed node of NULL if the list is empty. Removes the node at the head of the list. If the list is empty, NULL is returned.

Referenced by LI__removeW_toc().

L_node * L_unlink ( const L_node node,
L_node predecessor 
)

Removes the specified node from the list.

Parameters:
node The node to unlink from the list
predecessor The predecessor node.
Returns:
Pointer to the forward link of the removed node. Removes the specified node from a previously initialized list.


Generated on Sat May 21 06:44:08 2011 by  doxygen 1.5.8