moved to linked lists for replyqs, removed replyq size and count
[radsecproxy.git] / list.h
1 struct list_node {
2     struct list_node *next;
3     void *data;
4 };
5
6 struct list {
7     struct list_node *first, *last;
8 };
9
10 /* allocates and initialises list structure; returns NULL if malloc fails */
11 struct list *list_create();
12
13 /* frees all memory associated with the list */
14 void list_destroy(struct list *list);
15
16 /* appends entry to list; returns 1 if ok, 0 if malloc fails */
17 int list_push(struct list *list, void *data);
18
19 /* removes first entry from list and returns data */
20 void *list_shift(struct list *list);
21
22 /* returns first node */
23 struct list_node *list_first(struct list *list);
24
25 /* returns the next node after the argument */
26 struct list_node *list_next(struct list_node *node);