1 /* Copyright (c) 2007,2009, UNINETT AS */
2 /* See LICENSE for licensing information. */
5 #include <sys/inttypes.h>
11 struct list_node *next;
16 struct list_node *first, *last;
20 /* allocates and initialises list structure; returns NULL if malloc fails */
21 struct list *list_create();
23 /* frees all memory associated with the list */
24 void list_destroy(struct list *list);
26 /* appends entry to list; returns 1 if ok, 0 if malloc fails */
27 int list_push(struct list *list, void *data);
29 /* removes first entry from list and returns data */
30 void *list_shift(struct list *list);
32 /* removes first entry with matching data pointer */
33 void list_removedata(struct list *list, void *data);
35 /* returns first node */
36 struct list_node *list_first(struct list *list);
38 /* returns the next node after the argument */
39 struct list_node *list_next(struct list_node *node);
41 /* returns number of nodes */
42 uint32_t list_count(struct list *list);
44 /* Local Variables: */
45 /* c-file-style: "stroustrup" */