new list stuff (still in work)
[my-code/api.git] / list / list.h
1 /* list.h -- list headers */
2
3 #include <stdio.h>
4
5 #define L_SUCCESS 1
6 #define L_ERROR -1
7 #define L_NO_NEXT_ELEMENT -2
8 #define L_NO_SUCH_ELEMENT -3
9 #define L_INVALID_ELEMENT -4
10 #define L_EMPTY_LIST -5
11
12 typedef struct s_list_element {
13   struct s_list_element *next;
14   void *data;
15   int data_len;
16   int number;
17 } t_list_element;
18
19 typedef struct s_list {
20   t_list_element *start;
21   t_list_element *current;
22 } t_list;
23
24 /* function prototypes */
25 int list_init(t_list *list);
26