chiark / gitweb /
src/: Separate context state into parts for the type itself and its parent.
[adns.git] / src / dlist.h
index 44bf55608e249d6cce0ee1e14b46de816a1ae2a3..d72fb39b05f6927b72ff5a81fa9b47ffd81b2c2f 100644 (file)
@@ -3,12 +3,11 @@
  * - macros for handling doubly linked lists
  */
 /*
- *  This file is
- *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
- *
- *  It is part of adns, which is
- *    Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk>
- *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *  This file is part of adns, which is
+ *    Copyright (C) 1997-2000,2003,2006  Ian Jackson
+ *    Copyright (C) 1999-2000,2003,2006  Tony Finch
+ *    Copyright (C) 1991 Massachusetts Institute of Technology
+ *  (See the file INSTALL for full details.)
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
 #define LIST_INIT(list) ((list).head= (list).tail= 0)
 #define LINK_INIT(link) ((link).next= (link).back= 0)
 
-#define LIST_UNLINK_PART(list,node,part) \
-  do { \
+#define LIST_UNLINK_PART(list,node,part)                                   \
+  do {                                                                     \
     if ((node)->part back) (node)->part back->part next= (node)->part next; \
       else                                  (list).head= (node)->part next; \
     if ((node)->part next) (node)->part next->part back= (node)->part back; \
       else                                  (list).tail= (node)->part back; \
   } while(0)
 
-#define LIST_LINK_TAIL_PART(list,node,part) \
-  do { \
-    (node)->part next= 0; \
-    (node)->part back= (list).tail; \
-    if ((list).tail) (list).tail->part next= (node); else (list).head= (node); \
-    (list).tail= (node); \
+#define LIST_LINK_TAIL_PART(list,node,part)            \
+  do {                                                 \
+    (node)->part next= 0;                              \
+    (node)->part back= (list).tail;                    \
+    if ((list).tail) (list).tail->part next= (node);   \
+    else (list).head= (node);                          \
+    (list).tail= (node);                               \
   } while(0)
 
 #define LIST_UNLINK(list,node) LIST_UNLINK_PART(list,node,)