Lines Matching refs:head

27 int ptr_list_size(struct ptr_list *head)  in ptr_list_size()  argument
31 if (head) { in ptr_list_size()
32 struct ptr_list *list = head; in ptr_list_size()
35 } while ((list = list->next) != head); in ptr_list_size()
44 bool ptr_list_empty(const struct ptr_list *head) in ptr_list_empty() argument
46 const struct ptr_list *list = head; in ptr_list_empty()
48 if (!head) in ptr_list_empty()
54 } while ((list = list->next) != head); in ptr_list_empty()
63 bool ptr_list_multiple(const struct ptr_list *head) in ptr_list_multiple() argument
65 const struct ptr_list *list = head; in ptr_list_multiple()
68 if (!head) in ptr_list_multiple()
75 } while ((list = list->next) != head); in ptr_list_multiple()
84 void *first_ptr_list(struct ptr_list *head) in first_ptr_list() argument
86 struct ptr_list *list = head; in first_ptr_list()
88 if (!head) in first_ptr_list()
93 if (list == head) in first_ptr_list()
103 void *last_ptr_list(struct ptr_list *head) in last_ptr_list() argument
107 if (!head) in last_ptr_list()
109 list = head->prev; in last_ptr_list()
111 if (list == head) in last_ptr_list()
124 struct ptr_list *head = list; in ptr_list_nth_entry() local
126 if (!head) in ptr_list_nth_entry()
136 } while ((list = list->next) != head); in ptr_list_nth_entry()
154 int linearize_ptr_list(struct ptr_list *head, void **arr, int max) in linearize_ptr_list() argument
157 if (head && max > 0) { in linearize_ptr_list()
158 struct ptr_list *list = head; in linearize_ptr_list()
170 } while ((list = list->next) != head); in linearize_ptr_list()
186 struct ptr_list *head = *listp; in pack_ptr_list() local
188 if (head) { in pack_ptr_list()
189 struct ptr_list *entry = head; in pack_ptr_list()
205 if (entry == head) { in pack_ptr_list()
207 head = next; in pack_ptr_list()
213 } while (entry != head); in pack_ptr_list()
224 void split_ptr_list_head(struct ptr_list *head) in split_ptr_list_head() argument
226 int old = head->nr, nr = old / 2; in split_ptr_list_head()
228 struct ptr_list *next = head->next; in split_ptr_list_head()
231 head->nr = old; in split_ptr_list_head()
234 newlist->prev = head; in split_ptr_list_head()
235 head->next = newlist; in split_ptr_list_head()
237 memcpy(newlist->list, head->list + old, nr * sizeof(void *)); in split_ptr_list_head()
238 memset(head->list + old, 0xf0, nr * sizeof(void *)); in split_ptr_list_head()
309 bool lookup_ptr_list_entry(const struct ptr_list *head, const void *entry) in lookup_ptr_list_entry() argument
311 const struct ptr_list *list = head; in lookup_ptr_list_entry()
313 if (!head) in lookup_ptr_list_entry()
321 } while ((list = list->next) != head); in lookup_ptr_list_entry()
376 void * undo_ptr_list_last(struct ptr_list **head) in undo_ptr_list_last() argument
378 struct ptr_list *last, *first = *head; in undo_ptr_list_last()
400 void * delete_ptr_list_last(struct ptr_list **head) in delete_ptr_list_last() argument
403 struct ptr_list *last, *first = *head; in delete_ptr_list_last()
414 *head = NULL; in delete_ptr_list_last()
439 struct ptr_list *head, *tail; in copy_ptr_list() local
445 head = *listp; in copy_ptr_list()
446 if (!head) { in copy_ptr_list()
451 tail = head->prev; in copy_ptr_list()
478 head->prev = tail; in copy_ptr_list()
479 tail->next = head; in copy_ptr_list()