Go to the documentation of this file.
45 #define EOUTOFMEM (-7 & 1<<29)
47 #define FREELISTSIZE 100
48 #define LIST_SUCCESS 1
cmp_routine cmp_func
Definition: LinkedList.h:96
long size
Definition: LinkedList.h:90
void * ListDelNode(LinkedList *list, ListNode *dnode, int freeItem)
Removes a node from the list. The memory for the node is freed.
Definition: LinkedList.c:177
ListNode * ListTail(LinkedList *list)
Returns the tail of the list.
Definition: LinkedList.c:232
int FreeListDestroy(FreeList *free_list)
Releases the resources stored with the free list.
Definition: FreeList.c:92
ListNode * ListFind(LinkedList *list, ListNode *start, void *item)
Finds the specified item in the list.
Definition: LinkedList.c:272
ListNode * ListAddAfter(LinkedList *list, void *item, ListNode *bnode)
Adds a node after the specified node. Node gets added immediately after bnode.
Definition: LinkedList.c:129
ListNode * ListNext(LinkedList *list, ListNode *node)
Returns the next item in the list.
Definition: LinkedList.c:245
void * FreeListAlloc(FreeList *free_list)
Allocates chunk of set size.
Definition: FreeList.c:51
Definition: LinkedList.h:61
ListNode * ListHead(LinkedList *list)
Returns the head of the list.
Definition: LinkedList.c:219
ListNode * ListAddHead(LinkedList *list, void *item)
Adds a node to the head of the list. Node gets immediately after list head.
Definition: LinkedList.c:109
ListNode * ListAddTail(LinkedList *list, void *item)
Adds a node to the tail of the list. Node gets added immediately before list.tail.
Definition: LinkedList.c:119
int ListInit(LinkedList *list, cmp_routine cmp_func, free_function free_func)
Initializes LinkedList. Must be called first and only once for List.
Definition: LinkedList.c:84
struct LINKEDLIST LinkedList
FreeList freeNodeList
Definition: LinkedList.h:92
int ListDestroy(LinkedList *list, int freeItem)
Removes all memory associated with list nodes. Does not free LinkedList *list.
Definition: LinkedList.c:200
ListNode tail
Definition: LinkedList.h:88
ListNode head
Definition: LinkedList.h:86
Definition: FreeList.h:62
Definition: LinkedList.h:84
int FreeListInit(FreeList *free_list, size_t elementSize, int maxFreeListLength)
Initializes Free List.
Definition: FreeList.c:37
int FreeListFree(FreeList *free_list, void *element)
Returns an item to the Free List.
Definition: FreeList.c:71
free_function free_func
Definition: LinkedList.h:94
ListNode * ListAddBefore(LinkedList *list, void *item, ListNode *anode)
Adds a node before the specified node. Node gets added immediately before anode.
Definition: LinkedList.c:153
long ListSize(LinkedList *list)
Returns the size of the list.
Definition: LinkedList.c:301
ListNode * ListPrev(LinkedList *list, ListNode *node)
Returns the previous item in the list.
Definition: LinkedList.c:258
void(* free_function)(void *arg)
Definition: LinkedList.h:52
int(* cmp_routine)(void *itemA, void *itemB)
Definition: LinkedList.h:55