GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBS / dev > pbs / rhel5-32


Interface   Data Structures   File List   Data Fields   Globals  

L.ih File Reference

Singly linked list, inline version. More...

#include <PBI/Inline.h>
#include <PBI/Attribute.h>
#include <PBS/L_pubdefs.h>

Defines

#define L__EXP_PROTO   INLINE_USR_EXP_PROTO
 Export Prototype spec.
#define L__LCL_PROTO   INLINE_USR_LCL_PROTO
 Internal Prototype spec.
#define L__EXP_FNC   INLINE_USR_EXP_FNC
 Export Function declaration.
#define L__LCL_FNC   INLINE_USR_LCL_FNC
 Internal Function declaration.

Functions

L__EXP_PROTO void L__append (L_head *dst, L_head *src) ATTR_UNUSED_OK
 Appends the src list members to the dst list.
L__EXP_PROTO void L__destroy (L_head *list) ATTR_UNUSED_OK
 Destroys the data structures associate with the list.
L__EXP_PROTO int L__empty (L_head *list) ATTR_UNUSED_OK
 Returns non zero if the list is empty list.
L__EXP_PROTO void L__init (L_head *list) ATTR_UNUSED_OK
 Initializes a list (singly linked list) to an empty list.
L__EXP_PROTO L_nodeL__insert (L_head *list, L_node *node) ATTR_UNUSED_OK
 Adds a node to the tail of a previously initialized list.
L__EXP_PROTO L_nodeL__jam (L_head *list, L_node *node) ATTR_UNUSED_OK
 Adds a node to the head of a previously initialized list.
L__EXP_PROTO void L__prepend (L_head *dst, L_head *src) ATTR_UNUSED_OK
 Prepends the src list members to the dst list.
L__EXP_PROTO L_nodeL__remove (L_head *list) ATTR_UNUSED_OK
 Removes the node from the head of a previously initialized list.. An empty list returns NULL as its node.
L__EXP_PROTO L_nodeL__unlink (const L_node *node, L_node *predecessor) ATTR_UNUSED_OK
 Removes the specified node from the list.


Detailed Description

Singly linked list, inline version.

Author:
JJRussell - russell@slac.stanford.edu

    CVS $Id: L.ih,v 1.7 2011/03/24 23:05:42 apw Exp $

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.
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.

Function Documentation

L__EXP_FNC 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.

References _L_head::blnk, _L_node::flnk, and _L_head::flnk.

Referenced by LI__append().

L__EXP_FNC 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.

L__EXP_FNC int L__empty ( L_head list  ) 

Returns non zero if the list is empty list.

Returns:
Non zero if the list is empty list, else 0
Parameters:
list Pointer to the list to initialize.

References _L_head::flnk.

L__EXP_FNC void L__init ( L_head list  ) 

Initializes a list (singly 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.

References _L_head::blnk, and _L_head::flnk.

L__EXP_FNC 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 mode
Returns:
Pointer to the old tail. 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.

References _L_head::blnk, and _L_node::flnk.

Referenced by FPA_free(), LI__insert(), and PL__insert().

L__EXP_FNC 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 == list, 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.

References _L_node::flnk, and _L_head::flnk.

Referenced by LI__jam(), and PL__jam().

L__EXP_FNC 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.

References _L_node::flnk, and _L_head::flnk.

L__EXP_FNC 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 or NULL if the list is empty. Removes the node at the head of the list. If the list is empty, NULL is returned.

References _L_node::flnk, and _L_head::flnk.

Referenced by allocate(), LI__remove(), LI__removeW(), and pl__remove().

L__EXP_FNC 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. Unlinks the specified node from a previously initialized list.

References _L_node::flnk.


Generated on Fri Aug 5 18:32:29 2011 by  doxygen 1.5.8