Lines Matching defs:list
40 * Doubly linked per user context IB resource list definitions
41 * Protection must occur * outside of the list.
47 * Adds the entry to the tail of the list.
50 add_genlist(genlist_t *list, uintptr_t data, void *data_context)
62 new_entry->prev = list->tail;
64 if (!list->count) {
65 list->tail = new_entry;
66 list->head = new_entry;
68 list->tail->next = new_entry;
69 list->tail = new_entry;
71 list->count++;
77 * delete_genlist() - delete the specified entry from the list.
79 void delete_genlist(genlist_t *list, genlist_entry_t *entry) {
86 list->head = entry->next;
92 list->tail = entry->prev;
95 list->count--;
101 * remove_genlist_head() - remove the entry from the list head, but
104 genlist_entry_t *remove_genlist_head(genlist_t *list) {
106 genlist_entry_t *entry = list->head;
108 if (list->head) {
109 list->head = list->head->next;
110 list->count--;
112 if (!list->head)
113 list->tail = list->head;
122 void flush_genlist(genlist_t *list) {
126 entry = remove_genlist_head(list);
130 entry = remove_genlist_head(list);
132 init_genlist(list);
135 bool genlist_empty(genlist_t *list) {
137 if (list->head != NULL)
146 void insert_genlist_tail(genlist_t *list, genlist_entry_t *entry) {
149 entry->prev = list->tail;
151 if (!list->count) {
152 list->tail = entry;
153 list->head = entry;
155 list->tail->next = entry;
156 list->tail = entry;
158 list->count++;