diff --git a/include/misc/dlist.h b/include/misc/dlist.h index 7926203d086..2826bf2a8dc 100644 --- a/include/misc/dlist.h +++ b/include/misc/dlist.h @@ -225,6 +225,19 @@ static inline int sys_dlist_is_empty(sys_dlist_t *list) return list->head == list; } +/** + * @brief check if more than one node present + * + * @param list the doubly-linked list to operate on + * + * @return 1 if multiple nodes, 0 otherwise + */ + +static inline int sys_dlist_has_multiple_nodes(sys_dlist_t *list) +{ + return list->head != list->tail; +} + /** * @brief get a reference to the head item in the list *