2 * Copyright (C) 2006-2009 Stig Venaas <venaas@uninett.no>
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.
10 #include <sys/inttypes.h>
16 struct list_node *next;
21 struct list_node *first, *last;
25 /* allocates and initialises list structure; returns NULL if malloc fails */
26 struct list *list_create();
28 /* frees all memory associated with the list */
29 void list_destroy(struct list *list);
31 /* appends entry to list; returns 1 if ok, 0 if malloc fails */
32 int list_push(struct list *list, void *data);
34 /* removes first entry from list and returns data */
35 void *list_shift(struct list *list);
37 /* removes first entry with matching data pointer */
38 void list_removedata(struct list *list, void *data);
40 /* returns first node */
41 struct list_node *list_first(struct list *list);
43 /* returns the next node after the argument */
44 struct list_node *list_next(struct list_node *node);
46 /* returns number of nodes */
47 uint32_t list_count(struct list *list);
49 /* Local Variables: */
50 /* c-file-style: "stroustrup" */