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 /* frees memory allocated for the list itself */
27 void list_free(struct list *list);
29 /* appends entry to list; returns 1 if ok, 0 if malloc fails */
30 int list_push(struct list *list, void *data);
32 /* removes first entry from list and returns data */
33 void *list_shift(struct list *list);
35 /* removes first entry with matching data pointer */
36 void list_removedata(struct list *list, void *data);
38 /* returns first node */
39 struct list_node *list_first(struct list *list);
41 /* returns the next node after the argument */
42 struct list_node *list_next(struct list_node *node);
44 /* returns number of nodes */
45 uint32_t list_count(struct list *list);
47 /* Local Variables: */
48 /* c-file-style: "stroustrup" */