Double linked list structs and functions

Double linked list structs and functions

Namespace: dmDoubleLinkedList
Include: #include <dmsdk/dlib/double_linked_list.h>
FUNCTIONS
void dmDoubleLinkedList::ListAdd(dmDoubleLinkedList::List* list, dmDoubleLinkedList::ListNode* item) Added new list element as a head of the list
dmDoubleLinkedList::ListNode* dmDoubleLinkedList::ListGetFirst(dmDoubleLinkedList::List* list) Get the first element of the list. If the list is ...
dmDoubleLinkedList::ListNode* dmDoubleLinkedList::ListGetLast(dmDoubleLinkedList::List* list) Get the last element of the list. If the list is e...
void dmDoubleLinkedList::ListInit(dmDoubleLinkedList::List* list) Initialize empty double linked list
void dmDoubleLinkedList::ListRemove(dmDoubleLinkedList::List* list, dmDoubleLinkedList::ListNode* item) Remove item from the list. Doesn't deallocate memo...

Functions

dmDoubleLinkedList::ListAdd

void dmDoubleLinkedList::ListAdd(dmDoubleLinkedList::List* list, dmDoubleLinkedList::ListNode* item)

Added new list element as a head of the list

PARAMETERS

dmDoubleLinkedList::List* list the list
dmDoubleLinkedList::ListNode* item new list element

dmDoubleLinkedList::ListGetFirst

dmDoubleLinkedList::ListNode* dmDoubleLinkedList::ListGetFirst(dmDoubleLinkedList::List* list)

Get the first element of the list. If the list is empty (tail == head) returns 0.

PARAMETERS

dmDoubleLinkedList::List* list the list

RETURNS

dmDoubleLinkedList::ListNode* the first element of the list. If the list is empty (tail == head) returns 0

dmDoubleLinkedList::ListGetLast

dmDoubleLinkedList::ListNode* dmDoubleLinkedList::ListGetLast(dmDoubleLinkedList::List* list)

Get the last element of the list. If the list is empty (tail == head) returns 0.

PARAMETERS

dmDoubleLinkedList::List* list the list

RETURNS

dmDoubleLinkedList::ListNode* the last element of the list. If the list is empty (tail == head) returns 0

dmDoubleLinkedList::ListInit

void dmDoubleLinkedList::ListInit(dmDoubleLinkedList::List* list)

Initialize empty double linked list

PARAMETERS

dmDoubleLinkedList::List* list the list

dmDoubleLinkedList::ListRemove

void dmDoubleLinkedList::ListRemove(dmDoubleLinkedList::List* list, dmDoubleLinkedList::ListNode* item)

Remove item from the list. Doesn't deallocate memory allocated for the item. If element is not in the list function doesn't affect linked list.

PARAMETERS

dmDoubleLinkedList::List* list the list
dmDoubleLinkedList::ListNode* item removed item