]> wimlib.net Git - wimlib/blobdiff - include/wimlib/list.h
Read concat runs
[wimlib] / include / wimlib / list.h
index 763178ba71f16fb596e3ecfcde22a03ca3f34ead..d6bd55c11013b54dadb2d0e615882058ace32e64 100644 (file)
@@ -129,6 +129,15 @@ static inline int list_empty(const struct list_head *head)
        return head->next == head;
 }
 
        return head->next == head;
 }
 
+/**
+ * list_is_singular - tests whether a list has just one entry.
+ * @head: the list to test.
+ */
+static inline int list_is_singular(const struct list_head *head)
+{
+       return !list_empty(head) && (head->next == head->prev);
+}
+
 static inline void __list_splice(const struct list_head *list,
                                 struct list_head *prev,
                                 struct list_head *next)
 static inline void __list_splice(const struct list_head *list,
                                 struct list_head *prev,
                                 struct list_head *next)