81 current_tail = list->
tail;
82 if (current_tail != NULL)
84 item = current_tail->
item;
93 new_tail->
next = NULL;
94 list->
tail = new_tail;
111 assert(list != NULL);
113 current_head = list->
head;
116 assert(new_element != NULL);
117 new_element->
next = current_head;
119 new_element->
item = item;
120 list->
head = new_element;
122 if (current_head != NULL)
124 current_head->
previous = new_element;
128 list->
tail = new_element;
141 assert(list != NULL);
143 current_tail = list->
tail;
146 assert(new_element != NULL);
147 new_element->
next = NULL;
148 new_element->
previous = current_tail;
149 new_element->
item = item;
150 list->
tail = new_element;
152 if (current_tail != NULL)
154 current_tail->
next = new_element;
158 list->
head = new_element;
179 return (list->
head == NULL);
DLIST_ITEM * dlist_get_first(DLIST *list)
void dlist_initialize(DLIST *list)
List initialization.
void dlist_push_first(DLIST *list, void *item)
A simple double-linked list.
int dlist_count(DLIST *list)
struct dlist_item * previous
DLIST_ITEM * dlist_get_last(DLIST *list)
void * dlist_pop_last(DLIST *list)
void dlist_push_last(DLIST *list, void *item)
DLIST_ITEM * dlist_get_next(DLIST_ITEM *item)
Double-linked list structure.
int dlist_is_empty(DLIST *list)