summaryrefslogtreecommitdiff
path: root/lib/lists.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lists.h')
-rw-r--r--lib/lists.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/lists.h b/lib/lists.h
index 51856b05..066eafbb 100644
--- a/lib/lists.h
+++ b/lib/lists.h
@@ -52,7 +52,10 @@ typedef union list { /* In fact two overlayed nodes */
#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)
+ for(n=HEAD(list); nxt=NODE_NEXT(n); n=(void *) nxt)
+#define WALK_LIST2_DELSAFE(n,nn,nxt,list,pos) \
+ for(nn=HEAD(list); (nxt=nn->next) && (n=SKIP_BACK(typeof(*n),pos,nn)); nn=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)
@@ -77,6 +80,7 @@ void rem_node(node *);
void add_tail_list(list *, list *);
void init_list(list *);
void insert_node(node *, node *);
+uint list_length(list *);
#endif
#endif