Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygendlist.h
Go to the documentation of this file.
00001 /* 00002 * dlist.h 00003 * - macros for handling doubly linked lists 00004 */ 00005 /* 00006 * This file is 00007 * Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk> 00008 * 00009 * It is part of adns, which is 00010 * Copyright (C) 1997-2000 Ian Jackson <ian@davenant.greenend.org.uk> 00011 * Copyright (C) 1999 Tony Finch <dot@dotat.at> 00012 * 00013 * This program is free software; you can redistribute it and/or modify 00014 * it under the terms of the GNU General Public License as published by 00015 * the Free Software Foundation; either version 2, or (at your option) 00016 * any later version. 00017 * 00018 * This program is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU General Public License 00024 * along with this program; if not, write to the Free Software Foundation, 00025 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00026 */ 00027 00028 #ifndef ADNS_DLIST_H_INCLUDED 00029 #define ADNS_DLIST_H_INCLUDED 00030 00031 #define LIST_INIT(list) ((list).head= (list).tail= 0) 00032 #define LINK_INIT(link) ((link).next= (link).back= 0) 00033 00034 #define LIST_UNLINK_PART(list,node,part) \ 00035 do { \ 00036 if ((node)->part back) (node)->part back->part next= (node)->part next; \ 00037 else (list).head= (node)->part next; \ 00038 if ((node)->part next) (node)->part next->part back= (node)->part back; \ 00039 else (list).tail= (node)->part back; \ 00040 } while(0) 00041 00042 #define LIST_LINK_TAIL_PART(list,node,part) \ 00043 do { \ 00044 (node)->part next= 0; \ 00045 (node)->part back= (list).tail; \ 00046 if ((list).tail) (list).tail->part next= (node); else (list).head= (node); \ 00047 (list).tail= (node); \ 00048 } while(0) 00049 00050 #define LIST_UNLINK(list,node) LIST_UNLINK_PART(list,node,) 00051 #define LIST_LINK_TAIL(list,node) LIST_LINK_TAIL_PART(list,node,) 00052 00053 #endif Generated on Sat May 26 2012 04:19:02 for ReactOS by
1.7.6.1
|