summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2014-05-23 19:34:02 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-23 19:34:02 +0000
commit795e59b32aa50364c1f5cb26adf97eda31551168 (patch)
tree53faf49d3f32202b1072195c63ca1555a42d4bd0 /include
parentfd2442ebf98535cb3abad26d62549bcfdb9cdb42 (diff)
parentfcc81e3c6f0724b3b360b19071005e559334bc58 (diff)
downloadsystem_core-795e59b32aa50364c1f5cb26adf97eda31551168.zip
system_core-795e59b32aa50364c1f5cb26adf97eda31551168.tar.gz
system_core-795e59b32aa50364c1f5cb26adf97eda31551168.tar.bz2
am fcc81e3c: am 184eecf0: am 4ecbda41: Merge "Add list_add_head to libcutils"
* commit 'fcc81e3c6f0724b3b360b19071005e559334bc58': Add list_add_head to libcutils
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;