]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] add LIST_HEAD_INIT to the list management macros
authorWilly Tarreau <w@1wt.eu>
Sun, 6 May 2007 22:18:32 +0000 (00:18 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 May 2007 12:07:44 +0000 (14:07 +0200)
It is useful to have the ability to initialize a list while declaring it.

include/common/mini-clist.h

index a2a86bde1158a3590ed63295718069f05ec8c259..caed2dc00c8783157c1493de5e5254f03870d604 100644 (file)
@@ -23,6 +23,8 @@ struct list {
 
 #define LIST_INIT(l) ((l)->n = (l)->p = (l))
 
+#define LIST_HEAD_INIT(l) { &l, &l }
+
 /* dual linked lists :
  * Start = (struct list *) pointer to the next elem's prev list entry
  * For each element :