29 #define OBJLIST_FIRST(TYPE, LL) ((LL)==NULL ? NULL : (TYPE)(LL)->watch.obj) |
30 #define OBJLIST_FIRST(TYPE, LL) ((LL)==NULL ? NULL : (TYPE)(LL)->watch.obj) |
30 #define OBJLIST_LAST(TYPE, LL) ((LL)==NULL ? NULL : (TYPE)(LL)->prev->watch.obj) |
31 #define OBJLIST_LAST(TYPE, LL) ((LL)==NULL ? NULL : (TYPE)(LL)->prev->watch.obj) |
31 #define OBJLIST_EMPTY(LIST) objlist_empty(LIST) |
32 #define OBJLIST_EMPTY(LIST) objlist_empty(LIST) |
32 |
33 |
33 #define FOR_ALL_ON_OBJLIST(TYPE, VAR, LL, TMP) \ |
34 #define FOR_ALL_ON_OBJLIST(TYPE, VAR, LL, TMP) \ |
34 for(objlist_iter_init(&(TMP), LL), \ |
35 FOR_ALL_ITER(objlist_iter_init, (TYPE)objlist_iter, VAR, LL, &(TMP)) |
35 VAR=(TYPE)objlist_iter(&(TMP)); \ |
|
36 VAR!=NULL; \ |
|
37 VAR=(TYPE)objlist_iter(&(TMP))) |
|
38 |
36 |
39 #define FOR_ALL_ON_OBJLIST_REV(TYPE, VAR, LL, TMP) \ |
37 #define FOR_ALL_ON_OBJLIST_REV(TYPE, VAR, LL, TMP) \ |
40 for(objlist_iter_rev_init(&(TMP), LL), \ |
38 FOR_ALL_ITER(objlist_iter_rev_init, \ |
41 VAR=(TYPE)objlist_iter_rev(&(TMP)); \ |
39 (TYPE)objlist_iter_rev, VAR, LL, &(TMP)) |
42 VAR!=NULL; \ |
|
43 VAR=(TYPE)objlist_iter_rev(&(TMP))) |
|
44 |
40 |
45 #define FOR_ALL_ON_OBJLIST_UNSAFE(TYPE, VAR, LL) \ |
41 #define FOR_ALL_ON_OBJLIST_UNSAFE(TYPE, VAR, LL) \ |
46 FOR_ALL_ON_OBJLIST(TYPE, VAR, LL, objlist_iter_tmp) |
42 FOR_ALL_ON_OBJLIST(TYPE, VAR, LL, objlist_iter_tmp) |
47 |
43 |
48 extern ObjListIterTmp objlist_iter_tmp; |
44 extern ObjListIterTmp objlist_iter_tmp; |