Only define LUA when lua is actually on the PATH
[notion/jeffpc.git] / ioncore / region-iter.h
blob1c28d6f2f41a129a38895d6820d2a80f67e956d9
1 /*
2 * ion/ioncore/region-iter.h
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
7 */
9 #ifndef ION_IONCORE_REGION_ITER_H
10 #define ION_IONCORE_REGION_ITER_H
12 #define REGION_FIRST_CHILD(PAR) (((WRegion*)(PAR))->children)
13 #define REGION_LAST_CHILD(PAR) \
14 (REGION_FIRST_CHILD(PAR)==NULL ? NULL \
15 : REGION_PREV_CHILD_WRAP(REGION_FIRST_CHILD(PAR), REGION_FIRST_CHILD(PAR)))
16 #define REGION_NEXT_CHILD(PAR, REG) (((WRegion*)(REG))->p_next)
17 #define REGION_PREV_CHILD(PAR, REG) ((((WRegion*)(REG))->p_prev->p_next) ? \
18 (((WRegion*)(REG))->p_prev) : NULL)
19 #define REGION_NEXT_CHILD_WRAP(PAR, REG) \
20 (((REG) && ((WRegion*)(REG))->p_next) \
21 ? ((WRegion*)(REG))->p_next : REGION_FIRST_CHILD(PAR))
22 #define REGION_PREV_CHILD_WRAP(PAR, REG) \
23 ((REG) ? ((WRegion*)(REG))->p_prev \
24 : REGION_FIRST_CHILD(PAR))
26 #define FOR_ALL_CHILDREN(PAR, REG) \
27 for((REG)=((WRegion*)(PAR))->children; (REG)!=NULL; (REG)=(REG)->p_next)
29 #define FOR_ALL_CHILDREN_W_NEXT(PAR, REG, NEXT) \
30 for((REG)=((WRegion*)(PAR))->children, (NEXT)=((REG)==NULL ? NULL : (REG)->p_next);\
31 (REG)!=NULL; \
32 (REG)=(NEXT), (NEXT)=((REG)==NULL ? NULL : (REG)->p_next))
34 #endif /* ION_IONCORE_REGION_ITER_H */