Lines Matching refs:link

30 #define LWRES_LINK_INIT(elt, link) \
32 (elt)->link.prev = (void *)(-1); \
33 (elt)->link.next = (void *)(-1); \
35 #define LWRES_LINK_LINKED(elt, link) \
36 ((void *)((elt)->link.prev) != (void *)(-1))
42 #define LWRES_LIST_PREPEND(list, elt, link) \
45 (list).head->link.prev = (elt); \
48 (elt)->link.prev = NULL; \
49 (elt)->link.next = (list).head; \
53 #define LWRES_LIST_APPEND(list, elt, link) \
56 (list).tail->link.next = (elt); \
59 (elt)->link.prev = (list).tail; \
60 (elt)->link.next = NULL; \
64 #define LWRES_LIST_UNLINK(list, elt, link) \
66 if ((elt)->link.next != NULL) \
67 (elt)->link.next->link.prev = (elt)->link.prev; \
69 (list).tail = (elt)->link.prev; \
70 if ((elt)->link.prev != NULL) \
71 (elt)->link.prev->link.next = (elt)->link.next; \
73 (list).head = (elt)->link.next; \
74 (elt)->link.prev = (void *)(-1); \
75 (elt)->link.next = (void *)(-1); \
78 #define LWRES_LIST_PREV(elt, link) ((elt)->link.prev)
79 #define LWRES_LIST_NEXT(elt, link) ((elt)->link.next)
81 #define LWRES_LIST_INSERTBEFORE(list, before, elt, link) \
83 if ((before)->link.prev == NULL) \
84 LWRES_LIST_PREPEND(list, elt, link); \
86 (elt)->link.prev = (before)->link.prev; \
87 (before)->link.prev = (elt); \
88 (elt)->link.prev->link.next = (elt); \
89 (elt)->link.next = (before); \
93 #define LWRES_LIST_INSERTAFTER(list, after, elt, link) \
95 if ((after)->link.next == NULL) \
96 LWRES_LIST_APPEND(list, elt, link); \
98 (elt)->link.next = (after)->link.next; \
99 (after)->link.next = (elt); \
100 (elt)->link.next->link.prev = (elt); \
101 (elt)->link.prev = (after); \
105 #define LWRES_LIST_APPENDLIST(list1, list2, link) \
110 (list1).tail->link.next = (list2).head; \
111 (list2).head->link.prev = (list1).tail; \
118 #define LWRES_LIST_ENQUEUE(list, elt, link) LWRES_LIST_APPEND(list, elt, link)
119 #define LWRES_LIST_DEQUEUE(list, elt, link) LWRES_LIST_UNLINK(list, elt, link)