summaryrefslogtreecommitdiffstats
path: root/src/lib/llist.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:32:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:32:01 +0000
commit21103af131d3308ef39ad30c66e0fa0ea87b4525 (patch)
tree1f5669b5b37a04d2d2a6becc2056c5d341d4ab16 /src/lib/llist.h
parentAdding upstream version 1:2.3.21+dfsg1. (diff)
downloaddovecot-21103af131d3308ef39ad30c66e0fa0ea87b4525.tar.xz
dovecot-21103af131d3308ef39ad30c66e0fa0ea87b4525.zip
Adding upstream version 1:2.3.21.1+dfsg1.upstream/1%2.3.21.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib/llist.h')
-rw-r--r--src/lib/llist.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/llist.h b/src/lib/llist.h
index 8a52e87..5ad5d75 100644
--- a/src/lib/llist.h
+++ b/src/lib/llist.h
@@ -78,4 +78,18 @@
#define DLLIST2_REMOVE(head, tail, item) \
DLLIST2_REMOVE_FULL(head, tail, item, prev, next)
+#define DLLIST2_JOIN_FULL(head1, tail1, head2, tail2, prev, next) STMT_START { \
+ if (*(head1) == NULL) { \
+ *(head1) = *(head2); \
+ *(tail1) = *(tail2); \
+ } else if (*(head2) != NULL) { \
+ (*(tail1))->next = *(head2); \
+ (*(head2))->prev = *(tail1); \
+ (*tail1) = (*tail2); \
+ } \
+ } STMT_END
+
+#define DLLIST2_JOIN(head1, tail1, head2, tail2) \
+ DLLIST2_JOIN_FULL(head1, tail1, head2, tail2, prev, next)
+
#endif