llist.h
Go to the documentation of this file.
00001 #ifndef foollistfoo
00002 #define foollistfoo
00003 
00004 /* $Id: llist.h 872 2005-10-26 01:21:30Z lennart $ */
00005 
00006 /***
00007   This file is part of avahi.
00008  
00009   avahi is free software; you can redistribute it and/or modify it
00010   under the terms of the GNU Lesser General Public License as
00011   published by the Free Software Foundation; either version 2.1 of the
00012   License, or (at your option) any later version.
00013  
00014   avahi is distributed in the hope that it will be useful, but WITHOUT
00015   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00016   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
00017   Public License for more details.
00018  
00019   You should have received a copy of the GNU Lesser General Public
00020   License along with avahi; if not, write to the Free Software
00021   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00022   USA.
00023 ***/
00024 
00027 #include <assert.h>
00028 
00029 #include <avahi-common/cdecl.h>
00030 
00031 AVAHI_C_DECL_BEGIN
00032 
00035 #define AVAHI_LLIST_HEAD(t,name) t *name
00036 
00038 #define AVAHI_LLIST_FIELDS(t,name) t *name##_next, *name##_prev
00039 
00041 #define AVAHI_LLIST_HEAD_INIT(t,head) do { (head) = NULL; } while(0)
00042 
00044 #define AVAHI_LLIST_INIT(t,name,item) do { \
00045                                t *_item = (item); \
00046                                assert(_item); \
00047                                _item->name##_prev = _item->name##_next = NULL; \
00048                                } while(0)
00049 
00051 #define AVAHI_LLIST_PREPEND(t,name,head,item) do { \
00052                                         t **_head = &(head), *_item = (item); \
00053                                         assert(_item); \
00054                                         if ((_item->name##_next = *_head)) \
00055                                            _item->name##_next->name##_prev = _item; \
00056                                         _item->name##_prev = NULL; \
00057                                         *_head = _item; \
00058                                         } while (0)
00059 
00061 #define AVAHI_LLIST_REMOVE(t,name,head,item) do { \
00062                                     t **_head = &(head), *_item = (item); \
00063                                     assert(_item); \
00064                                     if (_item->name##_next) \
00065                                        _item->name##_next->name##_prev = _item->name##_prev; \
00066                                     if (_item->name##_prev) \
00067                                        _item->name##_prev->name##_next = _item->name##_next; \
00068                                     else {\
00069                                        assert(*_head == _item); \
00070                                        *_head = _item->name##_next; \
00071                                     } \
00072                                     _item->name##_next = _item->name##_prev = NULL; \
00073                                     } while(0)
00074 
00075 AVAHI_C_DECL_END
00076 
00077 #endif


pedal_monitor
Author(s): Pedro Mendes
autogenerated on Fri Jun 6 2014 18:37:21