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