Lines Matching refs:node
20 static list_node_t *list_free_node_(list_t *list, list_node_t *node);
55 for (const list_node_t *node = list_begin(list); node != list_end(list); node = list_next(node)) { in list_contains() local
56 if (list_node(node) == data) in list_contains()
87 list_node_t *node = (list_node_t *)list->allocator->alloc(sizeof(list_node_t)); in list_insert_after() local
88 if (!node) in list_insert_after()
91 node->next = prev_node->next; in list_insert_after()
92 node->data = data; in list_insert_after()
93 prev_node->next = node; in list_insert_after()
95 list->tail = node; in list_insert_after()
104 list_node_t *node = (list_node_t *)list->allocator->alloc(sizeof(list_node_t)); in list_prepend() local
105 if (!node) in list_prepend()
107 node->next = list->head; in list_prepend()
108 node->data = data; in list_prepend()
109 list->head = node; in list_prepend()
120 list_node_t *node = (list_node_t *)list->allocator->alloc(sizeof(list_node_t)); in list_append() local
121 if (!node) in list_append()
123 node->next = NULL; in list_append()
124 node->data = data; in list_append()
126 list->head = node; in list_append()
127 list->tail = node; in list_append()
129 list->tail->next = node; in list_append()
130 list->tail = node; in list_append()
151 …for (list_node_t *prev = list->head, *node = list->head->next; node; prev = node, node = node->nex… in list_remove() local
152 if (node->data == data) { in list_remove()
153 prev->next = list_free_node_(list, node); in list_remove()
154 if (list->tail == node) in list_remove()
164 for (list_node_t *node = list->head; node; ) in list_clear() local
165 node = list_free_node_(list, node); in list_clear()
175 for (list_node_t *node = list->head; node; ) { in list_foreach() local
176 list_node_t *next = node->next; in list_foreach()
177 callback(node->data); in list_foreach()
178 node = next; in list_foreach()
192 list_node_t *list_next(const list_node_t *node) { in list_next() argument
193 assert(node != NULL); in list_next()
194 return node->next; in list_next()
197 void *list_node(const list_node_t *node) { in list_node() argument
198 assert(node != NULL); in list_node()
199 return node->data; in list_node()
202 static list_node_t *list_free_node_(list_t *list, list_node_t *node) { in list_free_node_() argument
204 assert(node != NULL); in list_free_node_()
206 list_node_t *next = node->next; in list_free_node_()
209 list->free_cb(node->data); in list_free_node_()
210 list->allocator->free(node); in list_free_node_()