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

Function DoublyLinkedListInsertAfterNode

source/src/utils/doublylinkedlist.c:97–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void DoublyLinkedListInsertAfterNode(DoublyLinkedList *const list,
98 DoublyLinkedListNode *node,
99 void *data) {
100 OPENER_ASSERT(list->allocator != NULL)
101 if(list->last == node) {
102 DoublyLinkedListInsertAtTail(list, data);
103 } else {
104 DoublyLinkedListNode *new_node = DoublyLinkedListNodeCreate(data,
105 list->allocator);
106 new_node->previous = node;
107 new_node->next = node->next;
108 node->next->previous = new_node;
109 node->next = new_node;
110 }
111}
112
113void DoublyLinkedListRemoveNode(DoublyLinkedList *const list,
114 DoublyLinkedListNode **pointer_to_node_pointer)

Callers 1

TESTFunction · 0.85

Calls 2

Tested by 1

TESTFunction · 0.68