mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-03-23 14:57:02 +00:00
Added macros for walking lists backwards.
This commit is contained in:
parent
9a706f32af
commit
b6628a8c98
@ -24,6 +24,10 @@ typedef struct list { /* In fact two overlayed nodes */
|
||||
n=(void *)((NODE (n))->next))
|
||||
#define WALK_LIST_DELSAFE(n,nxt,list) \
|
||||
for(n=HEAD(list); nxt=(void *)((NODE (n))->next); n=(void *) nxt)
|
||||
#define WALK_LIST_BACKWARDS(n,list) for(n=TAIL(list);(NODE (n))->prev; \
|
||||
n=(void *)((NODE (n))->prev))
|
||||
#define WALK_LIST_BACKWARDS_DELSAFE(n,prv,list) \
|
||||
for(n=TAIL(list); prv=(void *)((NODE (n))->prev); n=(void *) prv)
|
||||
|
||||
#define EMPTY_LIST(list) (!(list).head->next)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user