30 #include "libComAPI.h"
53 #define ELLNODE_INIT {NULL, NULL}
64 #define ELLLIST_INIT {ELLNODE_INIT, 0}
77 #define ellInit(PLIST) {\
78 (PLIST)->node.next = (PLIST)->node.previous = NULL;\
85 #define ellCount(PLIST) ((PLIST)->count)
90 #define ellFirst(PLIST) ((PLIST)->node.next)
95 #define ellLast(PLIST) ((PLIST)->node.previous)
100 #define ellNext(PNODE) ((PNODE)->next)
105 #define ellPrevious(PNODE) ((PNODE)->previous)
109 #define ellFree(PLIST) ellFree2(PLIST, free)
struct ELLNODE * previous
Pointer to previous node in list.
LIBCOM_API ELLNODE * ellPop(ELLLIST *pList)
Deletes and returns the last node from a list.
LIBCOM_API ELLNODE * ellGet(ELLLIST *pList)
Deletes and returns the first node from a list.
ELLNODE node
Pointers to the first and last nodes on list.
int count
Number of nodes on the list.
LIBCOM_API int ellFind(ELLLIST *pList, ELLNODE *pNode)
Find the index of a specific node in a list.
LIBCOM_API void ellExtract(ELLLIST *pSrcList, ELLNODE *pStartNode, ELLNODE *pEndNode, ELLLIST *pDstList)
Extract a sublist from a list.
LIBCOM_API void ellAdd(ELLLIST *pList, ELLNODE *pNode)
Adds a node to the end of a list.
LIBCOM_API void ellVerify(ELLLIST *pList)
Verifies that the list is consistent.
LIBCOM_API void ellSortStable(ELLLIST *pList, pListCmp pListCmp)
Stable (MergeSort) of a given list.
LIBCOM_API ELLNODE * ellNth(ELLLIST *pList, int nodeNum)
Find the Nth node in a list.
void(* FREEFUNC)(void *)
Pointer to free() for use by ellFree() macro.
LIBCOM_API void ellInsert(ELLLIST *plist, ELLNODE *pPrev, ELLNODE *pNode)
Inserts a node into a list immediately after a specific node.
LIBCOM_API void ellConcat(ELLLIST *pDstList, ELLLIST *pAddList)
Concatenates a list to the end of another list. The list to be added is left empty. Either list (or both) can be empty at the beginning of the operation.
LIBCOM_API ELLNODE * ellNStep(ELLNODE *pNode, int nStep)
Find the list node nStep steps away from a specified node.
LIBCOM_API void ellFree2(ELLLIST *pList, FREEFUNC freeFunc)
Free all the nodes in a list.
struct ELLNODE * next
Pointer to next node in list.
LIBCOM_API void ellDelete(ELLLIST *pList, ELLNODE *pNode)
Deletes a node from a list.