merge an avl list implementation (imported from PacketBB)
[project/libubox.git] / list.h
diff --git a/list.h b/list.h
index 2959a06..e8271d0 100644 (file)
--- a/list.h
+++ b/list.h
@@ -167,6 +167,17 @@ static inline void list_move_tail(struct list_head *list,
 }
 
 /**
+ * list_is_first - tests whether @list is the first entry in list @head
+ * @list: the entry to test
+ * @head: the head of the list
+ */
+static inline int list_is_first(const struct list_head *list,
+                               const struct list_head *head)
+{
+       return list->prev == head;
+}
+
+/**
  * list_is_last - tests whether @list is the last entry in list @head
  * @list: the entry to test
  * @head: the head of the list