| 64 | } |
| 65 | |
| 66 | void 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 | |
| 81 | void DoublyLinkedListInsertBeforeNode(DoublyLinkedList *const list, |
| 82 | DoublyLinkedListNode *node, |