From 64fa986cd089b60ef5da72cfa149813041011537 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C5=99emysl=20Janouch?=
Date: Thu, 18 Sep 2014 20:59:29 +0200
Subject: Implement the indicator etc.
---
utils.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
(limited to 'utils.c')
diff --git a/utils.c b/utils.c
index 11c3d68..b727ef0 100644
--- a/utils.c
+++ b/utils.c
@@ -286,6 +286,24 @@ xstrndup (const char *s, size_t n)
(link)->next->prev = (link)->prev; \
BLOCK_END
+#define LIST_APPEND_WITH_TAIL(head, tail, link) \
+ BLOCK_START \
+ (link)->prev = (tail); \
+ (link)->next = NULL; \
+ if ((link)->prev) \
+ (link)->prev->next = (link); \
+ else \
+ (head) = (link); \
+ (tail) = (link); \
+ BLOCK_END
+
+#define LIST_UNLINK_WITH_TAIL(head, tail, link) \
+ BLOCK_START \
+ if ((tail) == (link)) \
+ (tail) = (link)->prev; \
+ LIST_UNLINK ((head), (link)); \
+ BLOCK_END
+
// --- Dynamically allocated string array --------------------------------------
struct str_vector
--
cgit v1.2.3