Home | History | Annotate | Download | only in src

Lines Matching defs:node

18 static list_node_t *list_free_node_(list_t *list, list_node_t *node);
76 assert(node != NULL);
79 list_node_t *node = (list_node_t *)malloc(sizeof(list_node_t));
80 if (!node)
83 node->next = prev_node->next;
84 node->data = data;
85 prev_node->next = node;
87 list->tail = node;
100 list_node_t *node = (list_node_t *)malloc(sizeof(list_node_t));
101 if (!node)
103 node->next = list->head;
104 node->data = data;
105 list->head = node;
120 list_node_t *node = (list_node_t *)malloc(sizeof(list_node_t));
121 if (!node)
123 node->next = NULL;
124 node->data = data;
126 list->head = node;
127 list->tail = node;
129 list->tail->next = node;
130 list->tail = node;
156 for (list_node_t *prev = list->head, *node = list->head->next; node; prev = node, node = node->next)
157 if (node->data == data) {
158 prev->next = list_free_node_(list, node);
159 if (list->tail == node)
171 for (list_node_t *node = list->head; node; )
172 node = list_free_node_(list, node);
180 // list inside the callback. If an element is added before the node being visited,
181 // there will be no callback for the newly-inserted node. Neither |list| nor
187 for (list_node_t *node = list->head; node; ) {
188 list_node_t *next = node->next;
189 callback(node->data);
190 node = next;
211 // Given a valid iterator |node|, this function returns the next value for the
215 list_node_t *list_next(const list_node_t *node) {
216 assert(node != NULL);
217 return node->next;
220 // Returns the value stored at the location pointed to by the iterator |node|.
221 // |node| must not equal the value returned by |list_end|.
222 void *list_node(const list_node_t *node) {
223 assert(node != NULL);
224 return node->data;
227 static list_node_t *list_free_node_(list_t *list, list_node_t *node) {
229 assert(node != NULL);
231 list_node_t *next = node->next;
234 list->free_cb(node->data);
235 free(node);