diff options
author | Colin Cross <ccross@android.com> | 2014-05-22 22:42:47 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-05-22 22:42:47 +0000 |
commit | 184eecf017b847bcb6999919f5aa4628521aca2d (patch) | |
tree | 02cbf4cd3757ccf959db0d1aa8cf0d0cd5206ac7 | |
parent | 55c3401b103bfe075aded28e0b5112f53f8a1fa1 (diff) | |
parent | 4ecbda41c921f3209e96a3d72928a4bcba9422e6 (diff) | |
download | system_core-184eecf017b847bcb6999919f5aa4628521aca2d.zip system_core-184eecf017b847bcb6999919f5aa4628521aca2d.tar.gz system_core-184eecf017b847bcb6999919f5aa4628521aca2d.tar.bz2 |
am 4ecbda41: Merge "Add list_add_head to libcutils"
* commit '4ecbda41c921f3209e96a3d72928a4bcba9422e6':
Add list_add_head to libcutils
-rw-r--r-- | include/cutils/list.h | 8 |
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; |