void(* ctb_DListIterator_ForEachOperation_t)(ctb_DNode_t *const node)
Typedef for operation function to be applied to each node in the doubly linked list.
Definition ctb_DListIterator.h:28
bool(* ctb_DListIterator_FindPredicate_t)(ctb_DNode_t *const node)
Typedef for predicate function used to find a node in the doubly linked list.
Definition ctb_DListIterator.h:21
ctb_DNode_t * ctb_DList_remove(ctb_DList_t *const self, ctb_DNode_t *const node)
Removes a node.
Definition ctb_DList.c:126
ctb_DNode_t * ctb_DList_removeLast(ctb_DList_t *const self)
Removes the last node.
Definition ctb_DList.c:121
size_t ctb_DList_getSize(ctb_DList_t *const self)
Returns the size of the doubly linked list.
Definition ctb_DList.c:163
void ctb_DList_addFirst(ctb_DList_t *const self, ctb_DNode_t *const node)
Adds a node at the beginning.
Definition ctb_DList.c:43
void ctb_DList_addLast(ctb_DList_t *const self, ctb_DNode_t *const node)
Adds a node at the end.
Definition ctb_DList.c:50
ctb_DNode_t * ctb_DList_find(ctb_DList_t *const self, ctb_DListIterator_FindPredicate_t const predicate)
Finds a node in the doubly linked list that matches a predicate.
Definition ctb_DList.c:186
ctb_DNode_t * ctb_DList_removeByIndex(ctb_DList_t *const self, size_t const index)
Removes the node at the specified index.
Definition ctb_DList.c:87
void ctb_DList_clear(ctb_DList_t *const self)
Clears the doubly linked list.
Definition ctb_DList.c:169
ctb_DNode_t * ctb_DList_getFirst(ctb_DList_t *const self)
Returns the first node.
Definition ctb_DList.c:75
ctb_DList_t * ctb_DList_init(ctb_DList_t *const self)
Initializes a doubly linked list.
Definition ctb_DList.c:7
ctb_DNode_t * ctb_DList_getByIndex(ctb_DList_t *const self, size_t index)
Returns the node at the specified index.
Definition ctb_DList.c:57
ctb_DNode_t * ctb_DList_getLast(ctb_DList_t *const self)
Returns the last node.
Definition ctb_DList.c:81
ctb_DNode_t * ctb_DList_removeFirst(ctb_DList_t *const self)
Removes the first node.
Definition ctb_DList.c:116
void ctb_DList_forEach(ctb_DList_t *const self, ctb_DListIterator_ForEachOperation_t const operation)
Applies an operation to each node of the doubly linked list.
Definition ctb_DList.c:176
bool ctb_DList_isEmpty(ctb_DList_t *const self)
Checks if the doubly linked list is empty.
Definition ctb_DList.c:157
size_t ctb_DList_getIndexOf(ctb_DList_t *const self, ctb_DNode_t const *const node)
Returns the index of a node.
Definition ctb_DList.c:136
void ctb_DList_addByIndex(ctb_DList_t *const self, ctb_DNode_t *const node, size_t const index)
Adds a node at the specified index.
Definition ctb_DList.c:15
Doubly linked list data structure.
Definition ctb_DList.h:20
size_t size
Definition ctb_DList.h:23
ctb_DNode_t * last
Definition ctb_DList.h:22
ctb_DNode_t * first
Definition ctb_DList.h:21
Doubly linked node data structure.
Definition ctb_DNode.h:15