summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2014-05-22 22:50:52 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-22 22:50:52 +0000
commitfcc81e3c6f0724b3b360b19071005e559334bc58 (patch)
treecc2e7ada40c6a6d7436c6080c10d14cc743e330e
parentc34598aa657121ed2feafdae35032e72aa1c9a80 (diff)
parent184eecf017b847bcb6999919f5aa4628521aca2d (diff)
downloadsystem_core-fcc81e3c6f0724b3b360b19071005e559334bc58.zip
system_core-fcc81e3c6f0724b3b360b19071005e559334bc58.tar.gz
system_core-fcc81e3c6f0724b3b360b19071005e559334bc58.tar.bz2
am 184eecf0: am 4ecbda41: Merge "Add list_add_head to libcutils"
* commit '184eecf017b847bcb6999919f5aa4628521aca2d': Add list_add_head to libcutils
-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;