summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/llist.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-26 20:05:48 +0200
committerLennart Poettering <lennart@poettering.net>2009-08-26 20:05:48 +0200
commit4e1298d7c7a5dc01c2ef6e76d1520f2b04cb167a (patch)
treec4005a910a33f8eb0c1f71913a24bffe1df41308 /src/pulsecore/llist.h
parent368c3e3f904c7dba5ba8ba4b17d76ba49b40c6ae (diff)
llist: add PA_LLIST_FOREACH_SAFE macro for iteration that allows deleting
Diffstat (limited to 'src/pulsecore/llist.h')
-rw-r--r--src/pulsecore/llist.h3
1 files changed, 3 insertions, 0 deletions
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