summaryrefslogtreecommitdiff
path: root/lib/lists.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lists.h')
-rw-r--r--lib/lists.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/lists.h b/lib/lists.h
index 5b36ec83..342dfd62 100644
--- a/lib/lists.h
+++ b/lib/lists.h
@@ -37,6 +37,9 @@ 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)
+/* WALK_LIST_FIRST supposes that called code removes each processed node */
+#define WALK_LIST_FIRST(n,list) \
+ while(n=HEAD(list), (NODE (n))->next)
#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) \