Lines Matching refs:link

17 /** Initializes the list with a specified offset to the link
24 list->link.next = list->link.prev = &list->link;
36 /** Adds a link to the head of the list
42 list_link *link = (list_link *)_link;
44 link->next = list->link.next;
45 link->prev = &list->link;
47 list->link.next->prev = link;
48 list->link.next = link;
52 /** Adds a link to the tail of the list
58 list_link *link = (list_link *)_link;
60 link->next = &list->link;
61 link->prev = list->link.prev;
63 list->link.prev->next = link;
64 list->link.prev = link;
68 /** Removes a link from the list it's currently in.
69 * Note: the link has to be in a list when you call this function.
75 list_link *link = (list_link *)_link;
77 link->next->prev = link->prev;
78 link->prev->next = link->next;
83 get_next_link(struct list *list, list_link *link)
85 if (link->next == &list->link)
88 return link->next;
93 get_prev_link(struct list *list, list_link *link)
95 if (link->prev == &list->link)
98 return link->prev;
111 list_link *link;
114 return list_is_empty(list) ? NULL : GET_ITEM(list, list->link.next);
116 link = get_next_link(list, GET_LINK(list, item));
117 return link != NULL ? GET_ITEM(list, link) : NULL;
130 list_link *link;
133 return list_is_empty(list) ? NULL : GET_ITEM(list, list->link.prev);
135 link = get_prev_link(list, GET_LINK(list, item));
136 return link != NULL ? GET_ITEM(list, link) : NULL;
143 return list_is_empty(list) ? NULL : GET_ITEM(list, list->link.prev);
148 * Similar to list_add_link_to_tail() but works on the item, not the link.
159 * Similar to list_remove_link() but works on the item, not the link.
178 list_link *link;
186 link = GET_LINK(list, item);
188 link->prev = beforeLink->prev;
189 link->next = beforeLink;
191 beforeLink->prev->next = link;
192 beforeLink->prev = link;
203 list_link *link;
208 list_remove_link(link = list->link.next);
209 return GET_ITEM(list, link);
220 list_link *link;
225 list_remove_link(link = list->link.prev);
226 return GET_ITEM(list, link);
239 targetList->link.next = targetList->link.prev = &targetList->link;
245 // correct link pointers to this list
246 targetList->link.next->prev = &targetList->link;
247 targetList->link.prev->next = &targetList->link;
250 sourceList->link.next = sourceList->link.prev = &sourceList->link;