• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/avahi-0.6.25/avahi-common/

Lines Matching defs:*

0 #ifndef foollistfoo
2 #define foollistfoo
4 /* $Id$ */
7 This file is part of avahi.
9 avahi is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as
11 published by the Free Software Foundation; either version 2.1 of the
12 License, or (at your option) any later version.
14 avahi is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
17 Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with avahi; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA.
25 /** \file llist.h A simple macro based linked list implementation */
27 #include <assert.h>
29 #include <avahi-common/cdecl.h>
31 AVAHI_C_DECL_BEGIN
33 /** The head of the linked list. Use this in the structure that shall
34 * contain the head of the linked list */
35 #define AVAHI_LLIST_HEAD(t,name) t *name
37 /** The pointers in the linked list's items. Use this in the item structure */
38 #define AVAHI_LLIST_FIELDS(t,name) t *name##_next, *name##_prev
40 /** Initialize the list's head */
41 #define AVAHI_LLIST_HEAD_INIT(t,head) do { (head) = NULL; } while(0)
43 /** Initialize a list item */
44 #define AVAHI_LLIST_INIT(t,name,item) do { \
45 t *_item = (item); \
46 assert(_item); \
47 _item->name##_prev = _item->name##_next = NULL; \
48 } while(0)
50 /** Prepend an item to the list */
51 #define AVAHI_LLIST_PREPEND(t,name,head,item) do { \
52 t **_head = &(head), *_item = (item); \
53 assert(_item); \
54 if ((_item->name##_next = *_head)) \
55 _item->name##_next->name##_prev = _item; \
56 _item->name##_prev = NULL; \
57 *_head = _item; \
58 } while (0)
60 /** Remove an item from the list */
61 #define AVAHI_LLIST_REMOVE(t,name,head,item) do { \
62 t **_head = &(head), *_item = (item); \
63 assert(_item); \
64 if (_item->name##_next) \
65 _item->name##_next->name##_prev = _item->name##_prev; \
66 if (_item->name##_prev) \
67 _item->name##_prev->name##_next = _item->name##_next; \
68 else {\
69 assert(*_head == _item); \
70 *_head = _item->name##_next; \
72 _item->name##_next = _item->name##_prev = NULL; \
73 } while(0)
75 AVAHI_C_DECL_END
77 #endif