4 * Copyright (c) Tuomo Valkonen 2005-2006.
6 * Ion is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
12 #ifndef ION_IONCORE_LLIST_H
13 #define ION_IONCORE_LLIST_H
18 #include "mplexpholder.h"
23 DECLSTRUCT(WLListNode){
24 WLListNode *next, *prev;
29 typedef WLListNode *WLListIterTmp;
32 #define FOR_ALL_NODES_ON_LLIST(NODE, LL, TMP) \
33 FOR_ALL_ITER(llist_iter_init, llist_iter, NODE, LL, &(TMP))
35 #define FOR_ALL_REGIONS_ON_LLIST(NODE, LL, TMP) \
36 FOR_ALL_ITER(llist_iter_init, llist_iter_regions, NODE, LL, &(TMP))
39 extern void llist_iter_init(WLListIterTmp *tmp, WLListNode *llist);
40 extern WLListNode *llist_iter(WLListIterTmp *tmp);
41 extern WRegion *llist_iter_regions(WLListIterTmp *tmp);
42 extern WLListNode *llist_nth_node(WLListNode *list, uint n);
43 extern ExtlTab llist_to_table(WLListNode *list);
44 extern void llist_link_after(WLListNode **list,
45 WLListNode *after, WLListNode *node);
46 extern void llist_link_last(WLListNode **list, WLListNode *node);
47 extern WLListNode *llist_index_to_after(WLListNode *list,
50 extern void llist_unlink(WLListNode **list, WLListNode *node);
52 #define LLIST_INDEX_LAST (-1)
53 #define LLIST_INDEX_AFTER_CURRENT (-2)
54 #define LLIST_INDEX_AFTER_CURRENT_ACT (-3)
56 #endif /* ION_IONCORE_LLIST_H */