mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
libratbag: create list_append method (#474)
This commit is contained in:
committed by
Peter Hutterer
parent
fa57b417e9
commit
7fe4d6f097
@@ -57,6 +57,15 @@ list_insert(struct list *list, struct list *elm)
|
||||
elm->next->prev = elm;
|
||||
}
|
||||
|
||||
void
|
||||
list_append(struct list *list, struct list *elm)
|
||||
{
|
||||
elm->next = list;
|
||||
elm->prev = list->prev;
|
||||
list->prev = elm;
|
||||
elm->prev->next = elm;
|
||||
}
|
||||
|
||||
void
|
||||
list_remove(struct list *elm)
|
||||
{
|
||||
|
||||
@@ -45,6 +45,7 @@ struct list {
|
||||
|
||||
void list_init(struct list *list);
|
||||
void list_insert(struct list *list, struct list *elm);
|
||||
void list_append(struct list *list, struct list *elm);
|
||||
void list_remove(struct list *elm);
|
||||
int list_empty(const struct list *list);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user