am 4ecbda41: Merge "Add list_add_head to libcutils"
* commit '4ecbda41c921f3209e96a3d72928a4bcba9422e6': Add list_add_head to libcutils
This commit is contained in:
commit
184eecf017
1 changed files with 8 additions and 0 deletions
|
|
@ -63,6 +63,14 @@ static inline void list_add_tail(struct listnode *head, struct listnode *item)
|
||||||
head->prev = 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)
|
static inline void list_remove(struct listnode *item)
|
||||||
{
|
{
|
||||||
item->next->prev = item->prev;
|
item->next->prev = item->prev;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue