diff options
| author | Colin Cross <ccross@android.com> | 2014-05-22 22:26:43 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-22 22:26:43 +0000 |
| commit | 4ecbda41c921f3209e96a3d72928a4bcba9422e6 (patch) | |
| tree | 47d80a249e8ea332bf38b887a8fe489127f6185f /include | |
| parent | 08befc3a8066626bb7336dd9ad656e737712153e (diff) | |
| parent | f8a1089ab5d3976c631cfe7b40eca8a5ed34c306 (diff) | |
| download | system_core-4ecbda41c921f3209e96a3d72928a4bcba9422e6.tar.gz system_core-4ecbda41c921f3209e96a3d72928a4bcba9422e6.tar.bz2 system_core-4ecbda41c921f3209e96a3d72928a4bcba9422e6.zip | |
Merge "Add list_add_head to libcutils"
Diffstat (limited to 'include')
| -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 945729ab2..6e94ddf66 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; |
