Lines Matching refs:list
31 #define INIT_LIST(list) \ argument
32 do { (list).head = NULL; (list).tail = NULL; } while (0)
45 #define HEAD(list) ((list).head) argument
46 #define TAIL(list) ((list).tail) argument
47 #define EMPTY(list) ((list).head == NULL) argument
49 #define PREPEND(list, elt, link) \ argument
52 if ((list).head != NULL) \
53 (list).head->link.prev = (elt); \
55 (list).tail = (elt); \
57 (elt)->link.next = (list).head; \
58 (list).head = (elt); \
61 #define APPEND(list, elt, link) \ argument
64 if ((list).tail != NULL) \
65 (list).tail->link.next = (elt); \
67 (list).head = (elt); \
68 (elt)->link.prev = (list).tail; \
70 (list).tail = (elt); \
73 #define UNLINK_TYPE(list, elt, link, type) \ argument
79 INSIST((list).tail == (elt)); \
80 (list).tail = (elt)->link.prev; \
85 INSIST((list).head == (elt)); \
86 (list).head = (elt)->link.next; \
90 #define UNLINK(list, elt, link) \ argument
91 UNLINK_TYPE(list, elt, link, void)
96 #define INSERT_BEFORE(list, before, elt, link) \ argument
100 PREPEND(list, elt, link); \
109 #define INSERT_AFTER(list, after, elt, link) \ argument
113 APPEND(list, elt, link); \
122 #define ENQUEUE(list, elt, link) APPEND(list, elt, link) argument
123 #define DEQUEUE(list, elt, link) UNLINK(list, elt, link) argument