X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fdlist.h;h=d72fb39b05f6927b72ff5a81fa9b47ffd81b2c2f;hb=be4d66dc60264126ba6b3fbd67609ef0b6c0d266;hp=44bf55608e249d6cce0ee1e14b46de816a1ae2a3;hpb=239d2e4dfb6fcfc26fe3f740efae8f6944b99799;p=adns.git diff --git a/src/dlist.h b/src/dlist.h index 44bf556..d72fb39 100644 --- a/src/dlist.h +++ b/src/dlist.h @@ -3,12 +3,11 @@ * - macros for handling doubly linked lists */ /* - * This file is - * Copyright (C) 1997-1999 Ian Jackson - * - * It is part of adns, which is - * Copyright (C) 1997-2000 Ian Jackson - * Copyright (C) 1999 Tony Finch + * 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 @@ -31,20 +30,21 @@ #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,)