diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lists.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/lists.h b/lib/lists.h index 9153029c..37c56efb 100644 --- a/lib/lists.h +++ b/lib/lists.h @@ -36,6 +36,8 @@ typedef struct list { /* In fact two overlayed nodes */ #define NODE_NEXT(n) ((void *)((NODE (n))->next)) #define NODE_VALID(n) ((NODE (n))->next) #define WALK_LIST(n,list) for(n=HEAD(list); NODE_VALID(n); n=NODE_NEXT(n)) +#define WALK_LIST2(n,nn,list,pos) \ + for(nn=(list).head; NODE_VALID(nn) && (n=SKIP_BACK(typeof(*n),pos,nn)); nn=nn->next) #define WALK_LIST_DELSAFE(n,nxt,list) \ for(n=HEAD(list); nxt=NODE_NEXT(n); n=(void *) nxt) /* WALK_LIST_FIRST supposes that called code removes each processed node */ |