Lines Matching refs:list
30 #define INIT_LIST(list) \
31 do { (list).head = NULL; (list).tail = NULL; } while (0)
44 #define HEAD(list) ((list).head)
45 #define TAIL(list) ((list).tail)
46 #define EMPTY(list) ((list).head == NULL)
48 #define PREPEND(list, elt, link) \
51 if ((list).head != NULL) \
52 (list).head->link.prev = (elt); \
54 (list).tail = (elt); \
56 (elt)->link.next = (list).head; \
57 (list).head = (elt); \
60 #define APPEND(list, elt, link) \
63 if ((list).tail != NULL) \
64 (list).tail->link.next = (elt); \
66 (list).head = (elt); \
67 (elt)->link.prev = (list).tail; \
69 (list).tail = (elt); \
72 #define UNLINK_TYPE(list, elt, link, type) \
78 INSIST((list).tail == (elt)); \
79 (list).tail = (elt)->link.prev; \
84 INSIST((list).head == (elt)); \
85 (list).head = (elt)->link.next; \
89 #define UNLINK(list, elt, link) \
90 UNLINK_TYPE(list, elt, link, void)
95 #define INSERT_BEFORE(list, before, elt, link) \
99 PREPEND(list, elt, link); \
108 #define INSERT_AFTER(list, after, elt, link) \
112 APPEND(list, elt, link); \
121 #define ENQUEUE(list, elt, link) APPEND(list, elt, link)
122 #define DEQUEUE(list, elt, link) UNLINK(list, elt, link)