Lines Matching refs:head
38 int ptr_list_size(struct ptr_list *head) in ptr_list_size() argument
42 if (head) { in ptr_list_size()
43 struct ptr_list *list = head; in ptr_list_size()
46 } while ((list = list->next) != head); in ptr_list_size()
55 bool ptr_list_empty(const struct ptr_list *head) in ptr_list_empty() argument
57 const struct ptr_list *list = head; in ptr_list_empty()
59 if (!head) in ptr_list_empty()
65 } while ((list = list->next) != head); in ptr_list_empty()
74 bool ptr_list_multiple(const struct ptr_list *head) in ptr_list_multiple() argument
76 const struct ptr_list *list = head; in ptr_list_multiple()
79 if (!head) in ptr_list_multiple()
86 } while ((list = list->next) != head); in ptr_list_multiple()
95 void *first_ptr_list(struct ptr_list *head) in first_ptr_list() argument
97 struct ptr_list *list = head; in first_ptr_list()
99 if (!head) in first_ptr_list()
104 if (list == head) in first_ptr_list()
114 void *last_ptr_list(struct ptr_list *head) in last_ptr_list() argument
118 if (!head) in last_ptr_list()
120 list = head->prev; in last_ptr_list()
122 if (list == head) in last_ptr_list()
135 struct ptr_list *head = list; in ptr_list_nth_entry() local
137 if (!head) in ptr_list_nth_entry()
147 } while ((list = list->next) != head); in ptr_list_nth_entry()
165 int linearize_ptr_list(struct ptr_list *head, void **arr, int max) in linearize_ptr_list() argument
168 if (head && max > 0) { in linearize_ptr_list()
169 struct ptr_list *list = head; in linearize_ptr_list()
181 } while ((list = list->next) != head); in linearize_ptr_list()
197 struct ptr_list *head = *listp; in pack_ptr_list() local
199 if (head) { in pack_ptr_list()
200 struct ptr_list *entry = head; in pack_ptr_list()
216 if (entry == head) { in pack_ptr_list()
218 head = next; in pack_ptr_list()
224 } while (entry != head); in pack_ptr_list()
235 void split_ptr_list_head(struct ptr_list *head) in split_ptr_list_head() argument
237 int old = head->nr, nr = old / 2; in split_ptr_list_head()
239 struct ptr_list *next = head->next; in split_ptr_list_head()
242 head->nr = old; in split_ptr_list_head()
245 newlist->prev = head; in split_ptr_list_head()
246 head->next = newlist; in split_ptr_list_head()
248 memcpy(newlist->list, head->list + old, nr * sizeof(void *)); in split_ptr_list_head()
249 memset(head->list + old, 0xf0, nr * sizeof(void *)); in split_ptr_list_head()
314 bool lookup_ptr_list_entry(const struct ptr_list *head, const void *entry) in lookup_ptr_list_entry() argument
316 const struct ptr_list *list = head; in lookup_ptr_list_entry()
318 if (!head) in lookup_ptr_list_entry()
326 } while ((list = list->next) != head); in lookup_ptr_list_entry()
381 void * undo_ptr_list_last(struct ptr_list **head) in undo_ptr_list_last() argument
383 struct ptr_list *last, *first = *head; in undo_ptr_list_last()
405 void * delete_ptr_list_last(struct ptr_list **head) in delete_ptr_list_last() argument
408 struct ptr_list *last, *first = *head; in delete_ptr_list_last()
419 *head = NULL; in delete_ptr_list_last()
444 struct ptr_list *head, *tail; in copy_ptr_list() local
450 head = *listp; in copy_ptr_list()
451 if (!head) { in copy_ptr_list()
456 tail = head->prev; in copy_ptr_list()
483 head->prev = tail; in copy_ptr_list()
484 tail->next = head; in copy_ptr_list()