diff options
Diffstat (limited to 'include/list.h')
-rw-r--r-- | include/list.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/list.h b/include/list.h index 0364f7c..69d0c33 100644 --- a/include/list.h +++ b/include/list.h @@ -7,6 +7,7 @@ #ifndef _LIST_H #define _LIST_H +#include <stdbool.h> #include <stddef.h> struct list_entry { @@ -20,6 +21,12 @@ struct list { size_t length; }; +static inline bool +list_is_empty(struct list *list) +{ + return list->head == (struct list_entry*)list; +} + static inline void list_remove(struct list_entry *entry) { |