summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/cutils/list.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/cutils/list.h b/include/cutils/list.h
index 945729a..6e94ddf 100644
--- a/include/cutils/list.h
+++ b/include/cutils/list.h
@@ -63,6 +63,14 @@ static inline void list_add_tail(struct listnode *head, struct listnode *item)
head->prev = item;
}
+static inline void list_add_head(struct listnode *head, struct listnode *item)
+{
+ item->next = head->next;
+ item->prev = head;
+ head->next->prev = item;
+ head->next = item;
+}
+
static inline void list_remove(struct listnode *item)
{
item->next->prev = item->prev;