# HG changeset patch # User Tuomo Valkonen # Date 1111769299 -3600 # Node ID 46ee75d9eba961d6abc3b7089c1f801d48d703ee # Parent 147a593d3cebbb86a3a76a7d72e3a39c839ced75 Added plain dlist reverse forall. diff -r 147a593d3ceb -r 46ee75d9eba9 dlist.h --- a/dlist.h Sat Mar 19 22:07:55 2005 +0100 +++ b/dlist.h Fri Mar 25 17:48:19 2005 +0100 @@ -100,11 +100,23 @@ #define LIST_FOR_ALL(LIST, NODE, NEXT, PREV) \ for(NODE=LIST; NODE!=NULL; NODE=(NODE)->NEXT) +#define LIST_FOR_ALL_REV(LIST, NODE, NEXT, PREV) \ + for(NODE=((LIST)==NULL ? NULL : (LIST)->PREV); \ + NODE!=NULL; \ + NODE=((NODE)==(LIST) ? NULL : (NODE)->PREV)) + #define LIST_FOR_ALL_W_NEXT(LIST, NODE, NXT, NEXT, PREV) \ for(NODE=LL, NXT=(NODE==NULL ? NULL : (NODE)->NEXT); \ NODE!=NULL; \ NODE=NXT, NXT=(NODE==NULL ? NULL : (NODE)->NEXT)) +#define LIST_FOR_ALL_W_NEXT_REV(LIST, NODE, NXT, NEXT, PREV) \ + for(NODE=((LIST)==NULL ? NULL : (LIST)->PREV), \ + NXT=((NODE)==(LIST) ? NULL : (NODE)->PREV); \ + NODE!=NULL; \ + NODE=NXT, \ + NXT=((NODE)==(LIST) ? NULL : (NODE)->PREV)) + /*}}}*/