4 * Copyright (c) Tuomo Valkonen 2005-2008.
6 * See the included file LICENSE for details.
9 #ifndef ION_IONCORE_LLIST_H
10 #define ION_IONCORE_LLIST_H
15 #include "mplexpholder.h"
20 DECLSTRUCT(WLListNode){
21 WLListNode *next, *prev;
26 typedef WLListNode *WLListIterTmp;
29 #define FOR_ALL_NODES_ON_LLIST(NODE, LL, TMP) \
30 FOR_ALL_ITER(llist_iter_init, llist_iter, NODE, LL, &(TMP))
32 #define FOR_ALL_REGIONS_ON_LLIST(NODE, LL, TMP) \
33 FOR_ALL_ITER(llist_iter_init, llist_iter_regions, NODE, LL, &(TMP))
36 extern void llist_iter_init(WLListIterTmp *tmp, WLListNode *llist);
37 extern WLListNode *llist_iter(WLListIterTmp *tmp);
38 extern WRegion *llist_iter_regions(WLListIterTmp *tmp);
39 extern WLListNode *llist_nth_node(WLListNode *list, uint n);
40 extern ExtlTab llist_to_table(WLListNode *list);
41 extern void llist_link_after(WLListNode **list,
42 WLListNode *after, WLListNode *node);
43 extern void llist_link_last(WLListNode **list, WLListNode *node);
44 extern WLListNode *llist_index_to_after(WLListNode *list,
47 extern void llist_unlink(WLListNode **list, WLListNode *node);
49 #define LLIST_INDEX_LAST (-1)
50 #define LLIST_INDEX_AFTER_CURRENT (-2)
51 #define LLIST_INDEX_AFTER_CURRENT_ACT (-3)
53 #endif /* ION_IONCORE_LLIST_H */