Main Page   Interface   Data Structures   File List   Data Fields   Globals  

LL.ih File Reference

Defines the inline Linked List (LL) routines. More...

#include "BBC/inline.h"
#include "BBC/LL_pubdefs.h"

Defines

#define LL__EXT_PROTO   INLINE_USR_EXT_PROTO
#define LL__LCL_PROTO   INLINE_USR_LCL_PROTO
#define LL__EXT_FNC   INLINE_USR_EXT_FNC
#define LL__LCL_FNC   INLINE_USR_LCL_FNC

Functions

LL__EXT_PROTO void LL__destroy (struct _LL_list *list)
 Destroys the data structures associate with a linked list. More...

LL__EXT_PROTO void LL__init (struct _LL_list *list)
 Initializes the list head of a doubly linked list to an empty list. More...

LL__EXT_PROTO struct _LL_nodeLL__insert (struct _LL_list *list, struct _LL_node *node)
 Adds a node to the tail of a previously initialized linked list. More...

LL__EXT_PROTO struct _LL_nodeLL__jam (struct _LL_list *list, struct _LL_node *node)
 Adds a node to the head of a previously initialized linked list. More...

LL__EXT_PROTO struct _LL_nodeLL__remove (struct _LL_list *list)
 Removes the node from the tail of a previously initialized linked list. An empty list returns NULL as its node. More...

LL__EXT_PROTO struct _LL_nodeLL__unlink (struct _LL_node *node)
 Removes the specified node from the linked list. More...


Detailed Description

Defines the inline Linked List (LL) routines.

Author:
JJRussell - russell@slac.stanford.edu
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 VxWorks llXXXX routines, but are portable to both VxWorks 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.


Define Documentation

#define LL__EXT_FNC   INLINE_USR_EXT_FNC
 

External Function declaration

#define LL__EXT_PROTO   INLINE_USR_EXT_PROTO
 

External Prototype spec

#define LL__LCL_FNC   INLINE_USR_LCL_FNC
 

Internal Function declaration

#define LL__LCL_PROTO   INLINE_USR_LCL_PROTO
 

Internal Prototype spec


Function Documentation

LL__EXT_FNC void LL__destroy struct _LL_list   list
 

Destroys the data structures associate with a linked list.

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

LL__EXT_FNC void LL__init struct _LL_list   list
 

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

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

LL__EXT_FNC struct _LL_node * LL__insert struct _LL_list   list,
struct _LL_node   node
 

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

Parameters:
list  A previously initialized linked list head.
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 queue.
If return_value == &list, the empty)
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.

LL__EXT_FNC struct _LL_node * LL__jam struct _LL_list   list,
struct _LL_node   node
 

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

Parameters:
list  A previously initialized linked list head.
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 queue.
If return_value == &list, the empty)
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.

LL__EXT_FNC struct _LL_node * LL__remove struct _LL_list   list
 

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

Parameters:
list  A previously initialized linked list head.
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.

LL__EXT_FNC struct _LL_node * LL__unlink struct _LL_node   node
 

Removes the specified node from the linked list.

Parameters:
node  The node to unlink from the list
Returns:
Pointer to the forward link of the removed node.

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


Generated on Fri Mar 1 16:56:56 2002 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001