summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/llist.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-08-12 02:16:12 +0000
committerLennart Poettering <lennart@poettering.net>2006-08-12 02:16:12 +0000
commite9d9356d110945bf9bc8c3ca0e1cb0b1d42a67a1 (patch)
tree690dac4455b0b9993f287e598bad709af385b7bd /src/pulsecore/llist.h
parentbb961569eb562b4c92617098627f8092098955d0 (diff)
add new macro PA_LLIST_INSERT_AFTER
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1209 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/llist.h')
-rw-r--r--src/pulsecore/llist.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/pulsecore/llist.h b/src/pulsecore/llist.h
index bf3c150a..9ce24e74 100644
--- a/src/pulsecore/llist.h
+++ b/src/pulsecore/llist.h
@@ -73,7 +73,24 @@ do { \
assert(_head); \
while ((*_head)->prev) \
*_head = (*_head)->prev; \
-} while (0) \
+} while (0)
+#define PA_LLIST_INSERT_AFTER(t,head,a,b) \
+do { \
+ t **_head = &(head), *_a = (a), *_b = (b); \
+ assert(_b); \
+ if (!_a) { \
+ if ((_b->next = *_head)) \
+ _b->next->prev = _b; \
+ _b->prev = NULL; \
+ *_head = _b; \
+ } else { \
+ if ((_b->next = _a->next)) \
+ _b->next->prev = _b; \
+ _b->prev = _a; \
+ _a->next = _b; \
+ } \
+} while (0)
+
#endif