Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/list.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-12-29 01:59:06 +0300
committerFelix Fietkau <nbd@openwrt.org>2010-12-29 01:59:06 +0300
commit82ce342055ec8f7a0235d46f5332014eb3f69216 (patch)
treef1e06194a21de811d0b28fd93c8d50f37e47d139 /list.h
parentcd086c7c1558eb5816711f4fdc6e21524a01ddca (diff)
merge an avl list implementation (imported from PacketBB)
Diffstat (limited to 'list.h')
-rw-r--r--list.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/list.h b/list.h
index 2959a06..e8271d0 100644
--- 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