libratbag: create list_append method (#474)

This commit is contained in:
Filipe Laíns
2018-04-09 00:47:53 +01:00
committed by Peter Hutterer
parent fa57b417e9
commit 7fe4d6f097
2 changed files with 10 additions and 0 deletions

View File

@@ -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)
{

View File

@@ -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);