Home | History | Annotate | Download | only in src

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);
56 node = list_next(node)) {
57 if (list_node(node) == data) return true;
94 list_node_t* node = (list_node_t*)list->allocator->alloc(sizeof(list_node_t));
95 if (!node) return false;
97 node->next = prev_node->next;
98 node->data = data;
99 prev_node->next = node;
100 if (list->tail == prev_node) list->tail = node;
109 list_node_t* node = (list_node_t*)list->allocator->alloc(sizeof(list_node_t));
110 if (!node) return false;
111 node->next = list->head;
112 node->data = data;
113 list->head = node;
123 list_node_t* node = (list_node_t*)list->allocator->alloc(sizeof(list_node_t));
124 if (!node) return false;
125 node->next = NULL;
126 node->data = data;
128 list->head = node;
129 list->tail = node;
131 list->tail->next = node;
132 list->tail = node;
151 for (list_node_t *prev = list->head, *node = list->head->next; node;
152 prev = node, node = node->next)
153 if (node->data == data) {
154 prev->next = list_free_node_(list, node);
155 if (list->tail == node) list->tail = prev;
164 for (list_node_t* node = list->head; node;)
165 node = list_free_node_(list, node);
176 for (list_node_t* node = list->head; node;) {
177 list_node_t* next = node->next;
178 if (!callback(node->data, context)) return node;
179 node = next;
194 list_node_t* list_next(const list_node_t* node) {
195 CHECK(node != NULL);
196 return node->next;
199 void* list_node(const list_node_t* node) {
200 CHECK(node != NULL);
201 return node->data;
204 static list_node_t* list_free_node_(list_t* list, list_node_t* node) {
206 CHECK(node != NULL);
208 list_node_t* next = node->next;
210 if (list->free_cb) list->free_cb(node->data);
211 list->allocator->free(node);