29 #include "libComAPI.h" 52 #define ELLNODE_INIT {NULL, NULL} 63 #define ELLLIST_INIT {ELLNODE_INIT, 0} 76 #define ellInit(PLIST) {\ 77 (PLIST)->node.next = (PLIST)->node.previous = NULL;\ 84 #define ellCount(PLIST) ((PLIST)->count) 89 #define ellFirst(PLIST) ((PLIST)->node.next) 94 #define ellLast(PLIST) ((PLIST)->node.previous) 99 #define ellNext(PNODE) ((PNODE)->next) 104 #define ellPrevious(PNODE) ((PNODE)->previous) 108 #define ellFree(PLIST) ellFree2(PLIST, free) LIBCOM_API ELLNODE * ellPop(ELLLIST *pList)
Deletes and returns the last node from 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 void ellAdd(ELLLIST *pList, ELLNODE *pNode)
Adds a node to the end of a list.
LIBCOM_API void ellInsert(ELLLIST *plist, ELLNODE *pPrev, ELLNODE *pNode)
Inserts a node into a list immediately after a specific node.
struct ELLLIST ELLLIST
List header type.
LIBCOM_API void ellDelete(ELLLIST *pList, ELLNODE *pNode)
Deletes a node from a list.
void(* FREEFUNC)(void *)
Pointer to free() for use by ellFree() macro.
LIBCOM_API ELLNODE * ellGet(ELLLIST *pList)
Deletes and returns the first node from a list.
struct ELLNODE * previous
Pointer to previous node in list.
struct ELLNODE * next
Pointer to next node in list.
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.
int count
Number of nodes on the list.
LIBCOM_API ELLNODE * ellNth(ELLLIST *pList, int nodeNum)
Find the Nth node in a list.
LIBCOM_API int ellFind(ELLLIST *pList, ELLNODE *pNode)
Find the index of a specific node in a list.
ELLNODE node
Pointers to the first and last nodes on list.
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.
struct ELLNODE ELLNODE
List node type.
LIBCOM_API void ellExtract(ELLLIST *pSrcList, ELLNODE *pStartNode, ELLNODE *pEndNode, ELLLIST *pDstList)
Extract a sublist from a list.
int(* pListCmp)(const ELLNODE *A, const ELLNODE *B)