commit | 4ecbda41c921f3209e96a3d72928a4bcba9422e6 | [log] [tgz] |
---|---|---|
author | Colin Cross <ccross@android.com> | Thu May 22 22:26:43 2014 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Thu May 22 22:26:43 2014 +0000 |
tree | 47d80a249e8ea332bf38b887a8fe489127f6185f | |
parent | 08befc3a8066626bb7336dd9ad656e737712153e [diff] | |
parent | f8a1089ab5d3976c631cfe7b40eca8a5ed34c306 [diff] |
Merge "Add list_add_head to libcutils"
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 @@ 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;