llist.h revision 9ab7221dac60f0bda81925f5bfc694d5bb2e8bf2
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen/* Doubly linked list */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#define DLLIST_PREPEND_FULL(list, item, prev, next) STMT_START { \
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen if (*(list) != NULL) (*(list))->prev = (item); \
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#define DLLIST_REMOVE_FULL(list, item, prev, next) STMT_START { \
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen/* Doubly linked list with head and tail */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#define DLLIST2_PREPEND_FULL(head, tail, item, prev, next) STMT_START { \
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen if (*(head) != NULL) (*(head))->prev = (item); else (*tail) = (item); \
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen DLLIST2_PREPEND_FULL(head, tail, item, prev, next)
08a8b3de61139ba02371afc8240ac85be0e8b17cTimo Sirainen#define DLLIST2_APPEND_FULL(head, tail, item, prev, next) STMT_START { \
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Sirainen if (*(tail) != NULL) (*(tail))->next = (item); else (*head) = (item); \
b67974c4b89ab6950c2694cce8dfb1b6561cc084Josef 'Jeff' Sipek#define DLLIST2_APPEND(head, tail, item) \
e237ebeb97f42950eef3efd0d3db85590160d5fbTimo Sirainen DLLIST2_APPEND_FULL(head, tail, item, prev, next)
e237ebeb97f42950eef3efd0d3db85590160d5fbTimo Sirainen#define DLLIST2_INSERT_AFTER_FULL(head, tail, after, item, prev, next) \
714c6a150480112eb1a5f309d0cc39b60613a719Timo Sirainen#define DLLIST2_INSERT_AFTER(head, tail, after, item) \
e237ebeb97f42950eef3efd0d3db85590160d5fbTimo Sirainen DLLIST2_INSERT_AFTER_FULL(head, tail, after, item, prev, next)
e237ebeb97f42950eef3efd0d3db85590160d5fbTimo Sirainen#define DLLIST2_REMOVE_FULL(head, tail, item, prev, next) STMT_START { \