1 /* Copyright (c) 2007-2009, UNINETT AS */
2 /* See LICENSE for licensing information. */
5 #include <sys/inttypes.h>
10 #if defined (__cplusplus)
15 struct list_node *next;
20 struct list_node *first, *last;
24 /* allocates and initialises list structure; returns NULL if malloc fails */
25 struct list *list_create();
27 /* frees all memory associated with the list */
28 void list_destroy(struct list *list);
30 /* appends entry to list; returns 1 if ok, 0 if malloc fails */
31 int list_push(struct list *list, void *data);
33 /* removes first entry from list and returns data */
34 void *list_shift(struct list *list);
36 /* removes first entry with matching data pointer */
37 void list_removedata(struct list *list, void *data);
39 /* returns first node */
40 struct list_node *list_first(struct list *list);
42 /* returns the next node after the argument */
43 struct list_node *list_next(struct list_node *node);
45 /* returns number of nodes */
46 uint32_t list_count(struct list *list);
48 #if defined (__cplusplus)
52 /* Local Variables: */
53 /* c-file-style: "stroustrup" */