XBinder  Version 2.6.x
Classes | Functions
Scalar Doubly-Linked List Utility Functions

The doubly-linked list utility functions provide common routines for managing linked lists. More...

Classes

struct  OSRTScalarDListNode
 This structure is used to hold a single data item within the list. More...
 
struct  OSRTScalarDList
 This is the main list structure. More...
 

Functions

EXTERNRT void rtxScalarDListInit (OSRTScalarDList *pList)
 This function initializes a doubly linked list structure. More...
 
EXTERNRT OSRTScalarDListNodertxScalarDListAppendDouble (struct OSCTXT *pctxt, OSRTScalarDList *pList, OSDOUBLE value)
 This set of functions appends an item of the given scalar type to the linked list structure. More...
 
EXTERNRT OSRTScalarDListNodertxScalarDListAppendNode (OSRTScalarDList *pList, OSRTScalarDListNode *pListNode)
 This function is used to append a node to the linked list. More...
 
EXTERNRT OSRTScalarDListNodertxScalarDListInsertNode (OSRTScalarDList *pList, OSUINT32 idx, OSRTScalarDListNode *pListNode)
 This function is used to insert a node into the linked list. More...
 
EXTERNRT OSRTScalarDListNodertxScalarDListFindByIndex (const OSRTScalarDList *pList, OSUINT32 idx)
 This function will return the node pointer of the indexed entry in the list. More...
 
EXTERNRT void rtxScalarDListFreeNode (struct OSCTXT *pctxt, OSRTScalarDList *pList, OSRTScalarDListNode *node)
 This function will remove the given node from the list and free memory. More...
 
EXTERNRT void rtxScalarDListRemove (OSRTScalarDList *pList, OSRTScalarDListNode *node)
 This function will remove the given node from the list. More...
 
EXTERNRT void rtxScalarDListFreeNodes (struct OSCTXT *pctxt, OSRTScalarDList *pList)
 This function will free all of the dynamic memory used to hold the list node pointers. More...
 

Detailed Description

The doubly-linked list utility functions provide common routines for managing linked lists.

This module is identical to the rtxDList module except that the data varaibles that can be added to the lists are scalars (integer, double, float, etc.) whereas the standard rtxDList type hold pointers to more complex data items.

Function Documentation

◆ rtxScalarDListAppendDouble()

EXTERNRT OSRTScalarDListNode* rtxScalarDListAppendDouble ( struct OSCTXT pctxt,
OSRTScalarDList pList,
OSDOUBLE  value 
)

This set of functions appends an item of the given scalar type to the linked list structure.

Separate functions exist for all of the different supported scalar types.

Parameters
pctxtA pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls.
pListA pointer to a linked list structure onto which the data item will be appended.
valueData item to be appended to the list.
Returns
A pointer to an allocated node structure used to link the given data value into the list.

◆ rtxScalarDListAppendNode()

EXTERNRT OSRTScalarDListNode* rtxScalarDListAppendNode ( OSRTScalarDList pList,
OSRTScalarDListNode pListNode 
)

This function is used to append a node to the linked list.

This can be used instead of a scalar value append function. It requires the user to allocate and populate the list node structure.

Parameters
pListA pointer to a linked list structure onto which the list node will be appended.
pListNodeList node structure to be appended to the list. If this memory is to be released with the standard list memory free function, then it must be allocated using the rtxMemAlloc function.
Returns
A pointer to an allocated node structure used to link the given data value into the list. This is the node structure that was passed in.

◆ rtxScalarDListFindByIndex()

EXTERNRT OSRTScalarDListNode* rtxScalarDListFindByIndex ( const OSRTScalarDList pList,
OSUINT32  idx 
)

This function will return the node pointer of the indexed entry in the list.

Parameters
pListA pointer to a linked list structure.
idxZero-based index into list where the specified item is located. If the list contains fewer items then the index, NULL is returned.
Returns
A pointer to an allocated linked list node structure. To get the actual data item, the ident field must be examined to determine what type of value is stored in the union structure.

◆ rtxScalarDListFreeNode()

EXTERNRT void rtxScalarDListFreeNode ( struct OSCTXT pctxt,
OSRTScalarDList pList,
OSRTScalarDListNode node 
)

This function will remove the given node from the list and free memory.

It is assumed that memory for the list node structure was allocated using the rtxMemAlloc function.

Parameters
pctxtA pointer to a context structure.
pListA pointer to a linked list structure.
nodePointer to the list node to be removed.

◆ rtxScalarDListFreeNodes()

EXTERNRT void rtxScalarDListFreeNodes ( struct OSCTXT pctxt,
OSRTScalarDList pList 
)

This function will free all of the dynamic memory used to hold the list node pointers.

Parameters
pctxtA pointer to a context structure.
pListA pointer to a linked list structure.

◆ rtxScalarDListInit()

EXTERNRT void rtxScalarDListInit ( OSRTScalarDList pList)

This function initializes a doubly linked list structure.

It sets the number of elements to zero and sets all internal pointer values to NULL. A doubly-linked scalar list structure is described by the OSRTScalarDList type. Nodes of the list are of type OSRTScalarDListNode.

Parameters
pListA pointer to a linked list structure to be initialized.

◆ rtxScalarDListInsertNode()

EXTERNRT OSRTScalarDListNode* rtxScalarDListInsertNode ( OSRTScalarDList pList,
OSUINT32  idx,
OSRTScalarDListNode pListNode 
)

This function is used to insert a node into the linked list.

Parameters
pListA pointer to a linked list structure onto which the list node will be appended.
idxZero-based index into list where the specified node is to be inserted.
pListNodeList node structure to be appended to the list. If this memory is to be released with the standard list memory free function, then it must be allocated using the rtxMemAlloc function.
Returns
A pointer to an allocated node structure used to link the given data value into the list. This is the node structure that was passed in.

◆ rtxScalarDListRemove()

EXTERNRT void rtxScalarDListRemove ( OSRTScalarDList pList,
OSRTScalarDListNode node 
)

This function will remove the given node from the list.

Parameters
pListA pointer to a linked list structure.
nodePointer to the list node to be removed.