5
*----------------------------------------------------------------
7
*----------------------------------------------------------------
10
static list_node_t *list_new_node()
12
list_node_t *node = (list_node_t *)malloc(sizeof(list_node_t));
21
*----------------------------------------------------------------
23
*----------------------------------------------------------------
26
void list_init(list_t** lst)
28
*lst = (list_t*)malloc(sizeof(list_t));
30
l->head = (list_node_t*)0;
31
l->last = (list_node_t*)0;
35
void list_append(list_t* lst, void* data)
37
list_node_t *node = list_new_node();
41
/* we have last item, just append the new one */
42
lst->last->next = node;
43
node->prev = lst->last;
47
/* no items in the list */
54
void list_destroy(list_t* lst)
56
list_node_t *node = lst->head;
58
list_node_t *next = node->next;