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

Function DoublyLinkedListInsertAtHead

source/src/utils/doublylinkedlist.c:51–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void DoublyLinkedListInsertAtHead(DoublyLinkedList *const list,
52 void *data) {
53 OPENER_ASSERT(list->allocator != NULL)
54 DoublyLinkedListNode * new_node = DoublyLinkedListNodeCreate(data,
55 list->allocator);
56 if(NULL == list->first) {
57 list->first = new_node;
58 list->last = new_node;
59 } else {
60 new_node->next = list->first;
61 list->first->previous = new_node;
62 list->first = new_node;
63 }
64}
65
66void DoublyLinkedListInsertAtTail(DoublyLinkedList *const list,
67 const void *const data) {

Callers 3

AddNewActiveConnectionFunction · 0.85
TESTFunction · 0.85

Calls 1

Tested by 1

TESTFunction · 0.68