Lines Matching refs:node
219 static inline void sys_dnode_init(sys_dnode_t *node) in sys_dnode_init() argument
221 node->next = NULL; in sys_dnode_init()
222 node->prev = NULL; in sys_dnode_init()
233 static inline bool sys_dnode_is_linked(const sys_dnode_t *node) in sys_dnode_is_linked() argument
235 return node->next != NULL; in sys_dnode_is_linked()
247 static inline bool sys_dlist_is_head(sys_dlist_t *list, sys_dnode_t *node) in sys_dlist_is_head() argument
249 return list->head == node; in sys_dlist_is_head()
261 static inline bool sys_dlist_is_tail(sys_dlist_t *list, sys_dnode_t *node) in sys_dlist_is_tail() argument
263 return list->tail == node; in sys_dlist_is_tail()
334 sys_dnode_t *node) in sys_dlist_peek_next_no_check() argument
336 return (node == list->tail) ? NULL : node->next; in sys_dlist_peek_next_no_check()
350 sys_dnode_t *node) in sys_dlist_peek_next() argument
352 return (node != NULL) ? sys_dlist_peek_next_no_check(list, node) : NULL; in sys_dlist_peek_next()
368 sys_dnode_t *node) in sys_dlist_peek_prev_no_check() argument
370 return (node == list->head) ? NULL : node->prev; in sys_dlist_peek_prev_no_check()
385 sys_dnode_t *node) in sys_dlist_peek_prev() argument
387 return (node != NULL) ? sys_dlist_peek_prev_no_check(list, node) : NULL; in sys_dlist_peek_prev()
412 static inline void sys_dlist_append(sys_dlist_t *list, sys_dnode_t *node) in sys_dlist_append() argument
416 node->next = list; in sys_dlist_append()
417 node->prev = tail; in sys_dlist_append()
419 tail->next = node; in sys_dlist_append()
420 list->tail = node; in sys_dlist_append()
432 static inline void sys_dlist_prepend(sys_dlist_t *list, sys_dnode_t *node) in sys_dlist_prepend() argument
436 node->next = head; in sys_dlist_prepend()
437 node->prev = list; in sys_dlist_prepend()
439 head->prev = node; in sys_dlist_prepend()
440 list->head = node; in sys_dlist_prepend()
451 static inline void sys_dlist_insert(sys_dnode_t *successor, sys_dnode_t *node) in sys_dlist_insert() argument
455 node->prev = prev; in sys_dlist_insert()
456 node->next = successor; in sys_dlist_insert()
457 prev->next = node; in sys_dlist_insert()
458 successor->prev = node; in sys_dlist_insert()
476 static inline void sys_dlist_insert_at(sys_dlist_t *list, sys_dnode_t *node, in sys_dlist_insert_at() argument
477 int (*cond)(sys_dnode_t *node, void *data), void *data) in sys_dlist_insert_at() argument
480 sys_dlist_append(list, node); in sys_dlist_insert_at()
488 sys_dlist_insert(pos, node); in sys_dlist_insert_at()
490 sys_dlist_append(list, node); in sys_dlist_insert_at()
504 static inline void sys_dlist_remove(sys_dnode_t *node) in sys_dlist_remove() argument
506 sys_dnode_t *const prev = node->prev; in sys_dlist_remove()
507 sys_dnode_t *const next = node->next; in sys_dlist_remove()
511 sys_dnode_init(node); in sys_dlist_remove()
526 sys_dnode_t *node = NULL; in sys_dlist_get() local
529 node = list->head; in sys_dlist_get()
530 sys_dlist_remove(node); in sys_dlist_get()
533 return node; in sys_dlist_get()
546 sys_dnode_t *node = NULL; in sys_dlist_len() local
548 SYS_DLIST_FOR_EACH_NODE(list, node) { in sys_dlist_len()