add new macro PA_LLIST_INSERT_AFTER

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1209 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2006-08-12 02:16:12 +00:00
parent bb961569eb
commit e9d9356d11

View file

@ -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