2 * Copyright (C) 2006-2008 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 struct list_node *next;
15 struct list_node *first, *last;
18 /* allocates and initialises list structure; returns NULL if malloc fails */
19 struct list *list_create();
21 /* frees all memory associated with the list */
22 void list_destroy(struct list *list);
24 /* appends entry to list; returns 1 if ok, 0 if malloc fails */
25 int list_push(struct list *list, void *data);
27 /* removes first entry from list and returns data */
28 void *list_shift(struct list *list);
30 /* removes first entry with matching data pointer */
31 void list_removedata(struct list *list, void *data);
33 /* returns first node */
34 struct list_node *list_first(struct list *list);
36 /* returns the next node after the argument */
37 struct list_node *list_next(struct list_node *node);