Doubly-Linked List Utility Functions
The doubly-linked list utility functions provide common routines for managing linked lists. More...Classes | |
| struct | OSRTDListNode |
| This structure is used to hold a single data item within the list. More... | |
| struct | OSRTDList |
| This is the main list structure. More... | |
| struct | OSRTDListBuf |
| struct | OSRTDListUTF8StrNode |
| struct | OSRTDListNode |
| This structure is used to hold a single data item within the list. More... | |
| struct | OSRTDList |
| This is the main list structure. More... | |
Defines | |
| #define | DLISTBUF_SEG 16 |
Typedefs | |
| typedef int(* | PEqualsFunc )(const void *a, const void *b, const void *sortCtxt) |
Functions | |
| EXTERNRT void | rtxDListInit (OSRTDList *pList) |
| This function initializes a doubly linked list structure. | |
| EXTERNRT OSRTDListNode * | rtxDListAppend (struct OSCTXT *pctxt, OSRTDList *pList, void *pData) |
| This function appends an item to the linked list structure. | |
| EXTERNRT OSRTDListNode * | rtxDListInsert (struct OSCTXT *pctxt, OSRTDList *pList, OSUINT32 index, void *pData) |
| This function inserts an item into the linked list structure. | |
| EXTERNRT OSRTDListNode * | rtxDListInsertBefore (struct OSCTXT *pctxt, OSRTDList *pList, OSRTDListNode *node, void *pData) |
| This function inserts an item into the linked list structure before the specified element. | |
| EXTERNRT OSRTDListNode * | rtxDListInsertAfter (struct OSCTXT *pctxt, OSRTDList *pList, OSRTDListNode *node, void *pData) |
| This function inserts an item into the linked list structure after the specified element. | |
| EXTERNRT OSRTDListNode * | rtxDListFindByIndex (const OSRTDList *pList, OSUINT32 index) |
| This function will return the node pointer of the indexed entry in the list. | |
| EXTERNRT OSRTDListNode * | rtxDListFindByData (const OSRTDList *pList, void *data) |
| This function will return the node pointer of the given data item within the list or NULL if the item is not found. | |
| EXTERNRT int | rtxDListFindIndexByData (const OSRTDList *pList, void *data) |
| This function will return the index of the given data item within the list or -1 if the item is not found. | |
| EXTERNRT void | rtxDListFreeNode (struct OSCTXT *pctxt, OSRTDList *pList, OSRTDListNode *node) |
| This function will remove the given node from the list and free memory. | |
| EXTERNRT void | rtxDListRemove (OSRTDList *pList, OSRTDListNode *node) |
| This function will remove the given node from the list. | |
| EXTERNRT void | rtxDListFreeNodes (struct OSCTXT *pctxt, OSRTDList *pList) |
| This function will free all of the dynamic memory used to hold the list node pointers. | |
| EXTERNRT void | rtxDListFreeAll (struct OSCTXT *pctxt, OSRTDList *pList) |
| This function will free all of the dynamic memory used to hold the list node pointers and the data items. | |
| EXTERNRT int | rtxDListToArray (struct OSCTXT *pctxt, OSRTDList *pList, void **ppArray, OSUINT32 *pElemCount, size_t elemSize) |
| This function converts a doubly linked list to an array. | |
| EXTERNRT int | rtxDListAppendArray (struct OSCTXT *pctxt, OSRTDList *pList, void *pArray, OSUINT32 numElements, size_t elemSize) |
| This function appends pointers to items in the given array to a doubly linked list structure. | |
| EXTERNRT int | rtxDListAppendArrayCopy (struct OSCTXT *pctxt, OSRTDList *pList, const void *pArray, OSUINT32 numElements, size_t elemSize) |
| This function appends a copy of each item in the given array to a doubly linked list structure. | |
| EXTERNRT int | rtxDListToUTF8Str (struct OSCTXT *pctxt, OSRTDList *pList, OSUTF8CHAR **ppstr, char sep) |
| This function concatanates all of the components in the given list to form a UTF-8 string. | |
Detailed Description
The doubly-linked list utility functions provide common routines for managing linked lists.These lists are used to model XSD list and repeating element types within the generated code. This list type contains forward and backward pointers allowing the list to be traversed in either direction.
Function Documentation
|
||||||||||||||||
|
This function appends an item to the linked list structure.
The data item is passed into the function as a void pointer that can point to an object of any type. The
|
|
||||||||||||||||||||||||
|
This function appends pointers to items in the given array to a doubly linked list structure. The array is assumed to hold an array of values as opposed to pointers. The actual address of each item in the array is stored - a copy of each item is not made.
|
|
||||||||||||||||||||||||
|
This function appends a copy of each item in the given array to a doubly linked list structure.
In this case, the
|
|
||||||||||||
|
This function will return the node pointer of the given data item within the list or NULL if the item is not found.
|
|
||||||||||||
|
This function will return the node pointer of the indexed entry in the list.
|
|
||||||||||||
|
This function will return the index of the given data item within the list or -1 if the item is not found.
|
|
||||||||||||
|
This function will free all of the dynamic memory used to hold the list node pointers and the data items.
In this case, it is assumed that the
|
|
||||||||||||||||
|
This function will remove the given node from the list and free memory.
The data memory is not freed. It might be released when the
|
|
||||||||||||
|
This function will free all of the dynamic memory used to hold the list node pointers. It does not free the data items because it is unknown how the memory was allocated for these items.
|
|
|
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-list structure is described by the
Memory for the structures is allocated using the
|
|
||||||||||||||||||||
|
This function inserts an item into the linked list structure.
The data item is passed into the function as a void pointer that can point to an object of any type. The
|
|
||||||||||||||||||||
|
This function inserts an item into the linked list structure after the specified element.
The
|
|
||||||||||||||||||||
|
This function inserts an item into the linked list structure before the specified element.
The
|
|
||||||||||||
|
This function will remove the given node from the list.
The node memory is not freed. It will be released when the
|
|
||||||||||||||||||||||||
|
This function converts a doubly linked list to an array.
|
|
||||||||||||||||||||
|
This function concatanates all of the components in the given list to form a UTF-8 string.
The list is assumed to contain null-terminated character string components. The given separator chraacter is inserted after each list component. The
|
