diff --git a/safe_list.h b/safe_list.h index 248f97a..3c8b61b 100644 --- a/safe_list.h +++ b/safe_list.h @@ -53,4 +53,9 @@ void safe_list_del(struct safe_list *list); #define SAFE_LIST_INIT(_name) { LIST_HEAD_INIT(_name.list), NULL } #define SAFE_LIST(_name) struct safe_list _name = SAFE_LIST_INIT(_name) +static inline bool safe_list_empty(struct safe_list *head) +{ + return list_empty(&head->list); +} + #endif