Lines Matching full:list
1 /* $NetBSD: list.h,v 1.2 2004/05/20 19:51:55 christos Exp $ */
24 #define LIST(type) struct { type *head, *tail; }
25 #define INIT_LIST(list) \
26 do { (list).head = NULL; (list).tail = NULL; } while (/*CONSTCOND*/0)
38 #define HEAD(list) ((list).head)
39 #define TAIL(list) ((list).tail)
40 #define EMPTY(list) ((list).head == NULL)
42 #define PREPEND(list, elt, link) \
45 if ((list).head != NULL) \
46 (list).head->link.prev = (elt); \
48 (list).tail = (elt); \
50 (elt)->link.next = (list).head; \
51 (list).head = (elt); \
54 #define APPEND(list, elt, link) \
57 if ((list).tail != NULL) \
58 (list).tail->link.next = (elt); \
60 (list).head = (elt); \
61 (elt)->link.prev = (list).tail; \
63 (list).tail = (elt); \
66 #define UNLINK_TYPE(list, elt, link, type) \
72 (list).tail = (elt)->link.prev; \
76 (list).head = (elt)->link.next; \
79 #define UNLINK(list, elt, link) \
80 UNLINK_TYPE(list, elt, link, void)
85 #define INSERT_BEFORE(list, before, elt, link) \
89 PREPEND(list, elt, link); \
98 #define INSERT_AFTER(list, after, elt, link) \
102 APPEND(list, elt, link); \
111 #define ENQUEUE(list, elt, link) APPEND(list, elt, link)
112 #define DEQUEUE(list, elt, link) UNLINK(list, elt, link)