Lines Matching refs:list
202 static inline void sys_dlist_init(sys_dlist_t *list) in sys_dlist_init() argument
204 list->head = (sys_dnode_t *)list; in sys_dlist_init()
205 list->tail = (sys_dnode_t *)list; in sys_dlist_init()
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()
274 static inline bool sys_dlist_is_empty(sys_dlist_t *list) in sys_dlist_is_empty() argument
276 return list->head == list; in sys_dlist_is_empty()
289 static inline bool sys_dlist_has_multiple_nodes(sys_dlist_t *list) in sys_dlist_has_multiple_nodes() argument
291 return list->head != list->tail; in sys_dlist_has_multiple_nodes()
302 static inline sys_dnode_t *sys_dlist_peek_head(sys_dlist_t *list) in sys_dlist_peek_head() argument
304 return sys_dlist_is_empty(list) ? NULL : list->head; in sys_dlist_peek_head()
317 static inline sys_dnode_t *sys_dlist_peek_head_not_empty(sys_dlist_t *list) in sys_dlist_peek_head_not_empty() argument
319 return list->head; in sys_dlist_peek_head_not_empty()
333 static inline sys_dnode_t *sys_dlist_peek_next_no_check(sys_dlist_t *list, in sys_dlist_peek_next_no_check() argument
336 return (node == list->tail) ? NULL : node->next; in sys_dlist_peek_next_no_check()
349 static inline sys_dnode_t *sys_dlist_peek_next(sys_dlist_t *list, in sys_dlist_peek_next() argument
352 return (node != NULL) ? sys_dlist_peek_next_no_check(list, node) : NULL; in sys_dlist_peek_next()
367 static inline sys_dnode_t *sys_dlist_peek_prev_no_check(sys_dlist_t *list, in sys_dlist_peek_prev_no_check() argument
370 return (node == list->head) ? NULL : node->prev; in sys_dlist_peek_prev_no_check()
384 static inline sys_dnode_t *sys_dlist_peek_prev(sys_dlist_t *list, in sys_dlist_peek_prev() argument
387 return (node != NULL) ? sys_dlist_peek_prev_no_check(list, node) : NULL; in sys_dlist_peek_prev()
398 static inline sys_dnode_t *sys_dlist_peek_tail(sys_dlist_t *list) in sys_dlist_peek_tail() argument
400 return sys_dlist_is_empty(list) ? NULL : list->tail; in sys_dlist_peek_tail()
412 static inline void sys_dlist_append(sys_dlist_t *list, sys_dnode_t *node) in sys_dlist_append() argument
414 sys_dnode_t *const tail = list->tail; in sys_dlist_append()
416 node->next = list; 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
434 sys_dnode_t *const head = list->head; in sys_dlist_prepend()
437 node->prev = list; in sys_dlist_prepend()
440 list->head = node; in sys_dlist_prepend()
476 static inline void sys_dlist_insert_at(sys_dlist_t *list, sys_dnode_t *node, in sys_dlist_insert_at() argument
479 if (sys_dlist_is_empty(list)) { in sys_dlist_insert_at()
480 sys_dlist_append(list, node); in sys_dlist_insert_at()
482 sys_dnode_t *pos = sys_dlist_peek_head(list); in sys_dlist_insert_at()
485 pos = sys_dlist_peek_next(list, pos); in sys_dlist_insert_at()
490 sys_dlist_append(list, node); in sys_dlist_insert_at()
524 static inline sys_dnode_t *sys_dlist_get(sys_dlist_t *list) in sys_dlist_get() argument
528 if (!sys_dlist_is_empty(list)) { in sys_dlist_get()
529 node = list->head; in sys_dlist_get()
543 static inline size_t sys_dlist_len(sys_dlist_t *list) in sys_dlist_len() argument
548 SYS_DLIST_FOR_EACH_NODE(list, node) { in sys_dlist_len()