1 //#include "menu.h"
2 #include "list.h"
list_init(mylist_t * l)3 void list_init(mylist_t *l)
4 {
5     l->first = NULL;
6     l->last  = NULL;
7 }
8 
list_empty(mylist_t * l)9 bool list_empty(mylist_t *l)
10 {
11     if (l->first == NULL) 	return true;
12     else 					return false;
13 }
14 
list_add(mylist_t * l,node_t * n)15 void list_add(mylist_t *l, node_t *n)
16 {
17     if (l->first == NULL)
18     {
19 		l->first = n;
20 		l->last = n;
21 		n->prev = NULL;
22 		n->next = NULL;
23     }
24     else
25     {
26 		node_t *b = l->last;
27 		l->last = n;
28 
29 		n->prev = b;
30 		n->next = 0;
31 
32 		b->next = n;
33     }
34 }
35 
36 
37 
38