adding hash type, changed tls configs to hash
[radsecproxy.git] / list.h
1 /*
2  * Copyright (C) 2006-2008 Stig Venaas <venaas@uninett.no>
3  *
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  */
8
9 struct list_node {
10     struct list_node *next;
11     void *data;
12 };
13
14 struct list {
15     struct list_node *first, *last;
16 };
17
18 /* allocates and initialises list structure; returns NULL if malloc fails */
19 struct list *list_create();
20
21 /* frees all memory associated with the list */
22 void list_destroy(struct list *list);
23
24 /* appends entry to list; returns 1 if ok, 0 if malloc fails */
25 int list_push(struct list *list, void *data);
26
27 /* removes first entry from list and returns data */
28 void *list_shift(struct list *list);
29
30 /* removes first entry with matching data pointer */
31 void list_removedata(struct list *list, void *data);
32     
33 /* returns first node */
34 struct list_node *list_first(struct list *list);
35
36 /* returns the next node after the argument */
37 struct list_node *list_next(struct list_node *node);