From e9d9356d110945bf9bc8c3ca0e1cb0b1d42a67a1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 12 Aug 2006 02:16:12 +0000 Subject: add new macro PA_LLIST_INSERT_AFTER git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1209 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/pulsecore/llist.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/pulsecore/llist.h') 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 -- cgit