summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common.c')
-rw-r--r--common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common.c b/common.c
index fab0205..3d40816 100644
--- a/common.c
+++ b/common.c
@@ -49,6 +49,15 @@
// --- To be moved to liberty --------------------------------------------------
+#define LIST_INSERT_WITH_TAIL(head, tail, link, following) \
+ BLOCK_START \
+ if (following) \
+ LIST_APPEND_WITH_TAIL ((head), (following)->prev, (link)); \
+ else \
+ LIST_APPEND_WITH_TAIL ((head), (tail), (link)); \
+ (link)->next = (following); \
+ BLOCK_END
+
static void
split_str (const char *s, char delimiter, struct str_vector *out)
{