util: Add wl_list_insert_list()
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 15 Nov 2011 18:48:41 +0000 (13:48 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 15 Nov 2011 18:48:41 +0000 (13:48 -0500)
src/wayland-util.c
src/wayland-util.h

index 0dae01b..9eb3d59 100644 (file)
@@ -71,6 +71,15 @@ wl_list_empty(struct wl_list *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_array_init(struct wl_array *array)
 {
        memset(array, 0, sizeof *array);
index 76e0f1d..608ea03 100644 (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);
 int wl_list_length(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)                            \
        (void *)((char *)(ptr)  -                                       \