MCPcopy Create free account
hub / github.com/EIPStackGroup/OpENer / DoublyLinkedListInsertAtTail

Function DoublyLinkedListInsertAtTail

source/src/utils/doublylinkedlist.c:66–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void DoublyLinkedListInsertAtTail(DoublyLinkedList *const list,
67 const void *const data) {
68 OPENER_ASSERT(list->allocator != NULL)
69 DoublyLinkedListNode * new_node = DoublyLinkedListNodeCreate(data,
70 list->allocator);
71 if(NULL == list->last) {
72 list->first = new_node;
73 list->last = new_node;
74 } else {
75 new_node->previous = list->last;
76 list->last->next = new_node;
77 list->last = new_node;
78 }
79}
80
81void DoublyLinkedListInsertBeforeNode(DoublyLinkedList *const list,
82 DoublyLinkedListNode *node,

Callers 2

TESTFunction · 0.85

Calls 1

Tested by 1

TESTFunction · 0.68