util: Add wl_list_insert_list()

This commit is contained in:
Kristian Høgsberg 2011-11-15 13:48:41 -05:00
parent 3175e91efa
commit 51f50b8c64
2 changed files with 10 additions and 0 deletions

View file

@ -70,6 +70,15 @@ wl_list_empty(struct wl_list *list)
return list->next == list; return list->next == list;
} }
WL_EXPORT void
wl_list_insert_list(struct wl_list *list, struct wl_list *other)
{
other->next->prev = list;
other->prev->next = list->next;
list->next->prev = other->prev;
list->next = other->next;
}
WL_EXPORT void WL_EXPORT void
wl_array_init(struct wl_array *array) wl_array_init(struct wl_array *array)
{ {

View file

@ -115,6 +115,7 @@ void wl_list_insert(struct wl_list *list, struct wl_list *elm);
void wl_list_remove(struct wl_list *elm); void wl_list_remove(struct wl_list *elm);
int wl_list_length(struct wl_list *list); int wl_list_length(struct wl_list *list);
int wl_list_empty(struct wl_list *list); int wl_list_empty(struct wl_list *list);
void wl_list_insert_list(struct wl_list *list, struct wl_list *other);
#define __container_of(ptr, sample, member) \ #define __container_of(ptr, sample, member) \
(void *)((char *)(ptr) - \ (void *)((char *)(ptr) - \