summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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