Lines Matching refs:list
1 /* $NetBSD: list.h,v 1.5 2009/04/12 17:07:16 christos Exp $ */
25 #define INIT_LIST(list) \
26 do { (list).head = NULL; (list).tail = NULL; } while (/*CONSTCOND*/0)
39 #define HEAD(list) ((list).head)
40 #define TAIL(list) ((list).tail)
41 #define EMPTY(list) ((list).head == NULL)
43 #define PREPEND(list, elt, link) \
46 if ((list).head != NULL) \
47 (list).head->link.prev = (elt); \
49 (list).tail = (elt); \
51 (elt)->link.next = (list).head; \
52 (list).head = (elt); \
55 #define APPEND(list, elt, link) \
58 if ((list).tail != NULL) \
59 (list).tail->link.next = (elt); \
61 (list).head = (elt); \
62 (elt)->link.prev = (list).tail; \
64 (list).tail = (elt); \
67 #define UNLINK_TYPE(list, elt, link, type) \
73 INSIST((list).tail == (elt)); \
74 (list).tail = (elt)->link.prev; \
79 INSIST((list).head == (elt)); \
80 (list).head = (elt)->link.next; \
84 #define UNLINK(list, elt, link) \
85 UNLINK_TYPE(list, elt, link, void)
90 #define INSERT_BEFORE(list, before, elt, link) \
94 PREPEND(list, elt, link); \
103 #define INSERT_AFTER(list, after, elt, link) \
107 APPEND(list, elt, link); \
116 #define ENQUEUE(list, elt, link) APPEND(list, elt, link)
117 #define DEQUEUE(list, elt, link) UNLINK(list, elt, link)