From 4e1298d7c7a5dc01c2ef6e76d1520f2b04cb167a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 26 Aug 2009 20:05:48 +0200 Subject: llist: add PA_LLIST_FOREACH_SAFE macro for iteration that allows deleting --- src/pulsecore/llist.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pulsecore/llist.h') diff --git a/src/pulsecore/llist.h b/src/pulsecore/llist.h index 58b51c68..27f174a9 100644 --- a/src/pulsecore/llist.h +++ b/src/pulsecore/llist.h @@ -107,4 +107,7 @@ #define PA_LLIST_FOREACH(i,head) \ for (i = (head); i; i = i->next) +#define PA_LLIST_FOREACH_SAFE(i,n,head) \ + for (i = (head); i && ((n = i->next), 1); i = n) + #endif -- cgit