pepper: Refactored pepper_list_t, pepper_container_of
authorTaekyun Kim <tkq.kim@samsung.com>
Tue, 25 Aug 2015 07:10:26 +0000 (16:10 +0900)
committerTaekyun Kim <tkq.kim@samsung.com>
Tue, 25 Aug 2015 07:11:54 +0000 (16:11 +0900)
Change-Id: I21807f807c8786adab896bcf4d72e5b202d3348b

16 files changed:
src/lib/desktop-shell/shell.c
src/lib/drm/drm-output.c
src/lib/fbdev/fbdev-output.c
src/lib/pepper/buffer.c
src/lib/pepper/compositor.c
src/lib/pepper/data-device.c
src/lib/pepper/input.c
src/lib/pepper/object.c
src/lib/pepper/output.c
src/lib/pepper/pepper-utils.h
src/lib/pepper/plane.c
src/lib/pepper/surface.c
src/lib/pepper/view.c
src/lib/render/pixman-renderer.c
src/lib/wayland/wayland-output.c
src/lib/x11/x11-output.c

index 04017e0..8a0e208 100644 (file)
@@ -28,7 +28,7 @@ static void
 handle_shell_client_destroy(struct wl_listener *listener, void *data)
 {
     shell_client_t *shell_client = pepper_container_of(listener,
-                                                       shell_client_t,
+                                                       shell_client,
                                                        client_destroy_listener);
 
     remove_ping_timer(shell_client);
@@ -352,10 +352,9 @@ input_device_add_callback(pepper_event_listener_t    *listener,
     if (!target_seat_name)
         target_seat_name = "seat0";
 
-    PEPPER_LIST_FOR_EACH(&shell->shseat_list, l)
+    pepper_list_for_each(l, &shell->shseat_list)
     {
         shseat = l->item;
-
         seat_name = pepper_seat_get_name(shseat->seat);
 
         /* Find seat to adding input device */
@@ -383,8 +382,8 @@ input_device_add_callback(pepper_event_listener_t    *listener,
     }
 
     shseat->shell = shell;
-
     shseat->link.item = shseat;
+
     pepper_list_insert(&shell->shseat_list, &shseat->link);
 
     /* Add this input_device to seat */
@@ -598,12 +597,12 @@ seat_add_callback(pepper_event_listener_t    *listener,
     desktop_shell_t         *shell = data;
     pepper_seat_t           *seat  = info;
     shell_seat_t            *shseat;
-    pepper_list_t           *l;
     pepper_pointer_t        *pointer;
     pepper_keyboard_t       *keyboard;
     pepper_touch_t          *touch;
+    pepper_list_t           *l;
 
-    PEPPER_LIST_FOR_EACH(&shell->shseat_list, l)
+    pepper_list_for_each(l, &shell->shseat_list)
     {
         shseat = l->item;
 
@@ -617,38 +616,43 @@ seat_add_callback(pepper_event_listener_t    *listener,
         PEPPER_ERROR("Memory allocation failed\n");
         return ;
     }
+
     shseat->seat  = seat;
     shseat->shell = shell;
+    shseat->link.item = shseat;
 
     pepper_list_insert(&shell->shseat_list, &shseat->link);
-
     shell_seat_set_default_grab(shseat);
-
-    pepper_object_set_user_data((pepper_object_t *)seat,
-                                shell, shseat, NULL);
+    pepper_object_set_user_data((pepper_object_t *)seat, shell, shseat, NULL);
 
     pointer = pepper_seat_get_pointer(seat);
+
     if (pointer)
     {
         shseat->pointer_motion_listener =
-            pepper_object_add_event_listener((pepper_object_t *)pointer, PEPPER_EVENT_POINTER_MOTION,
+            pepper_object_add_event_listener((pepper_object_t *)pointer,
+                                             PEPPER_EVENT_POINTER_MOTION,
                                              0, pointer_event_handler, shseat);
 
         shseat->pointer_button_listener =
-            pepper_object_add_event_listener((pepper_object_t *)pointer, PEPPER_EVENT_POINTER_BUTTON,
+            pepper_object_add_event_listener((pepper_object_t *)pointer,
+                                             PEPPER_EVENT_POINTER_BUTTON,
                                              0, pointer_event_handler, shseat);
 
         shseat->pointer_axis_listener =
-            pepper_object_add_event_listener((pepper_object_t *)pointer, PEPPER_EVENT_POINTER_AXIS,
+            pepper_object_add_event_listener((pepper_object_t *)pointer,
+                                             PEPPER_EVENT_POINTER_AXIS,
                                              0, pointer_event_handler, shseat);
     }
     else
     {
         shseat->pointer_add_listener =
-            pepper_object_add_event_listener((pepper_object_t *)seat, PEPPER_EVENT_SEAT_POINTER_ADD,
+            pepper_object_add_event_listener((pepper_object_t *)seat,
+                                             PEPPER_EVENT_SEAT_POINTER_ADD,
                                              0, seat_logical_device_add_callback, shseat);
         shseat->pointer_remove_listener =
-            pepper_object_add_event_listener((pepper_object_t *)seat, PEPPER_EVENT_SEAT_POINTER_REMOVE,
+            pepper_object_add_event_listener((pepper_object_t *)seat,
+                                             PEPPER_EVENT_SEAT_POINTER_REMOVE,
                                              0, seat_logical_device_remove_callback, shseat);
     }
 
@@ -711,12 +715,11 @@ seat_remove_callback(pepper_event_listener_t    *listener,
 {
     desktop_shell_t         *shell = data;
     pepper_seat_t           *seat  = info;
-    shell_seat_t            *shseat;
     pepper_list_t           *l;
 
-    PEPPER_LIST_FOR_EACH(&shell->shseat_list, l)
+    pepper_list_for_each(l, &shell->shseat_list)
     {
-        shseat = l->item;
+        shell_seat_t *shseat = l->item;
 
         if (shseat->seat == seat)
         {
index c22fe25..fba3c64 100644 (file)
@@ -347,7 +347,7 @@ drm_output_assign_planes(void *o, const pepper_list_t *view_list)
     pepper_list_t  *l, *p;
 
     p = drm->plane_list.next;
-    PEPPER_LIST_FOR_EACH(view_list, l)
+    pepper_list_for_each(l, view_list)
     {
         pepper_view_t  *view = (pepper_view_t *)l->item;
         drm_plane_t    *plane = (drm_plane_t *)p->item;
@@ -375,12 +375,11 @@ static void
 set_planes(drm_output_t *output)
 {
     pepper_list_t      *l;
-    drm_plane_t        *plane;
-    drmVBlank           vbl;
 
-    PEPPER_LIST_FOR_EACH(&output->drm->plane_list, l)
+    pepper_list_for_each(l, &output->drm->plane_list)
     {
-        plane = (drm_plane_t *)l->item;
+        drm_plane_t *plane = (drm_plane_t *)l->item;
+        drmVBlank    vbl;
 
         if (plane->output != output)
             continue;
@@ -431,7 +430,7 @@ drm_output_repaint(void *o, const pepper_list_t *plane_list)
     drm_output_t   *output = (drm_output_t *)o;
     pepper_list_t  *l;
 
-    PEPPER_LIST_FOR_EACH(plane_list, l)
+    pepper_list_for_each(l, plane_list)
     {
         pepper_plane_t *plane = l->item;
 
@@ -1152,7 +1151,7 @@ destroy_planes(pepper_drm_t *drm)
 {
     pepper_list_t *l, *next;
 
-    PEPPER_LIST_FOR_EACH_SAFE(&drm->plane_list, l, next)
+    pepper_list_for_each_safe(l, next, &drm->plane_list)
     {
         drm_plane_t *plane = (drm_plane_t *)l->item;
         pepper_list_remove(l, NULL);
index 07abe30..3fa34b4 100644 (file)
@@ -160,7 +160,7 @@ fbdev_output_assign_planes(void *o, const pepper_list_t *view_list)
     fbdev_output_t *output = (fbdev_output_t *)o;
     pepper_list_t  *l;
 
-    PEPPER_LIST_FOR_EACH(view_list, l)
+    pepper_list_for_each(l, view_list)
     {
         pepper_view_t *view = l->item;
         pepper_view_assign_plane(view, output->base, output->primary_plane);
@@ -173,7 +173,7 @@ fbdev_output_repaint(void *o, const pepper_list_t *plane_list)
     fbdev_output_t *output = (fbdev_output_t *)o;
     pepper_list_t  *l;
 
-    PEPPER_LIST_FOR_EACH(plane_list, l)
+    pepper_list_for_each(l, plane_list)
     {
         pepper_plane_t *plane = l->item;
 
index fa9c7d1..2d31ff8 100644 (file)
@@ -3,8 +3,7 @@
 static void
 buffer_resource_destroy_handler(struct wl_listener *listener, void *data)
 {
-    pepper_buffer_t *buffer =
-        pepper_container_of(listener, pepper_buffer_t, resource_destroy_listener);
+    pepper_buffer_t *buffer = pepper_container_of(listener, buffer, resource_destroy_listener);
 
     /* Ensure no reference to this buffer. */
     PEPPER_ASSERT(buffer->ref_count == 0);
@@ -22,7 +21,7 @@ pepper_buffer_from_resource(struct wl_resource *resource)
     listener = wl_resource_get_destroy_listener(resource, buffer_resource_destroy_handler);
 
     if (listener)
-        return pepper_container_of(listener, pepper_buffer_t, resource_destroy_listener);
+        return pepper_container_of(listener, buffer, resource_destroy_listener);
 
     buffer = (pepper_buffer_t *)pepper_object_alloc(PEPPER_OBJECT_BUFFER, sizeof(pepper_buffer_t));
     if (!buffer)
index 5cfe036..4e08448 100644 (file)
@@ -51,7 +51,7 @@ pepper_compositor_schedule_repaint(pepper_compositor_t *compositor)
 {
     pepper_list_t   *l;
 
-    PEPPER_LIST_FOR_EACH(&compositor->output_list, l)
+    pepper_list_for_each(l, &compositor->output_list)
         pepper_output_schedule_repaint((pepper_output_t *)l->item);
 }
 
index ecd8bbe..f548b9d 100644 (file)
@@ -59,8 +59,7 @@ static void destroy_data_offer(struct wl_resource *resource)
 static void
 destroy_offer_data_source(struct wl_listener *listener, void *data)
 {
-    pepper_data_offer_t *offer =
-        pepper_container_of(listener, pepper_data_offer_t, source_destroy_listener);
+    pepper_data_offer_t *offer = pepper_container_of(listener, offer, source_destroy_listener);
 
     offer->source = NULL;
 }
index 05f899a..e53ce73 100644 (file)
@@ -369,7 +369,7 @@ seat_update_caps(pepper_seat_t *seat)
     pepper_list_t  *l;
     uint32_t        caps = 0;
 
-    PEPPER_LIST_FOR_EACH(&seat->input_device_list, l)
+    pepper_list_for_each(l, &seat->input_device_list)
     {
         pepper_input_device_entry_t *entry = l->item;
         caps |= entry->device->caps;
@@ -447,7 +447,7 @@ pepper_seat_add_input_device(pepper_seat_t *seat, pepper_input_device_t *device)
     pepper_input_device_entry_t *entry;
     pepper_list_t               *l;
 
-    PEPPER_LIST_FOR_EACH(&seat->input_device_list, l)
+    pepper_list_for_each(l, &seat->input_device_list)
     {
         pepper_input_device_entry_t *entry = l->item;
         if (entry->device == device)
@@ -474,7 +474,7 @@ pepper_seat_remove_input_device(pepper_seat_t *seat, pepper_input_device_t *devi
 {
     pepper_list_t *l;
 
-    PEPPER_LIST_FOR_EACH(&seat->input_device_list, l)
+    pepper_list_for_each(l, &seat->input_device_list)
     {
         pepper_input_device_entry_t *entry = l->item;
 
index 162381c..3c26082 100644 (file)
@@ -76,7 +76,7 @@ insert_listener(pepper_object_t *object, pepper_event_listener_t *listener)
 {
     pepper_list_t   *l;
 
-    PEPPER_LIST_FOR_EACH(&object->event_listener_list, l)
+    pepper_list_for_each(l, &object->event_listener_list)
     {
         pepper_event_listener_t *pos = l->item;
 
@@ -139,7 +139,7 @@ pepper_object_emit_event(pepper_object_t *object, uint32_t id, void *info)
     pepper_event_listener_t *listener;
     pepper_list_t           *l, *tmp;
 
-    PEPPER_LIST_FOR_EACH_SAFE(&object->event_listener_list, l, tmp)
+    pepper_list_for_each_safe(l, tmp, &object->event_listener_list)
     {
         listener = l->item;
 
index db0c440..657f920 100644 (file)
@@ -102,7 +102,7 @@ output_accumulate_damage(pepper_output_t *output)
 
     pixman_region32_init(&clip);
 
-    PEPPER_LIST_FOR_EACH_REVERSE(&output->plane_list, l)
+    pepper_list_for_each_reverse(l, &output->plane_list)
     {
         pepper_plane_t *plane = l->item;
 
@@ -119,13 +119,13 @@ output_repaint(pepper_output_t *output)
 {
     pepper_list_t          *l;
 
-    PEPPER_LIST_FOR_EACH(&output->compositor->view_list, l)
+    pepper_list_for_each(l, &output->compositor->view_list)
         pepper_view_update((pepper_view_t *)l->item);
 
     pepper_list_init(&output->view_list);
 
     /* Build a list of views in sorted z-order that are visible on the given output. */
-    PEPPER_LIST_FOR_EACH(&output->compositor->view_list, l)
+    pepper_list_for_each(l, &output->compositor->view_list)
     {
         pepper_view_t *view = l->item;
 
@@ -142,7 +142,7 @@ output_repaint(pepper_output_t *output)
 
     output->backend->assign_planes(output->data, &output->view_list);
 
-    PEPPER_LIST_FOR_EACH(&output->plane_list, l)
+    pepper_list_for_each(l, &output->plane_list)
         pepper_plane_update((pepper_plane_t *)l->item, &output->view_list);
 
     output_accumulate_damage(output);
@@ -151,7 +151,7 @@ output_repaint(pepper_output_t *output)
     output->frame.pending = PEPPER_TRUE;
     output->frame.scheduled = PEPPER_FALSE;
 
-    PEPPER_LIST_FOR_EACH(&output->view_list, l)
+    pepper_list_for_each(l, &output->view_list)
     {
         /* TODO: Output time stamp and presentation feedback. */
         pepper_view_t *view = l->item;
@@ -189,7 +189,7 @@ PEPPER_API void
 pepper_output_add_damage_region(pepper_output_t *output, pixman_region32_t *region)
 {
     pepper_list_t   *l;
-    PEPPER_LIST_FOR_EACH(&output->plane_list, l)
+    pepper_list_for_each(l, &output->plane_list)
         pepper_plane_add_damage_region((pepper_plane_t *)l->item, region);
 }
 
@@ -230,7 +230,7 @@ pepper_compositor_add_output(pepper_compositor_t *compositor,
         return NULL;
     }
 
-    PEPPER_LIST_FOR_EACH(&compositor->output_list, l)
+    pepper_list_for_each(l, &compositor->output_list)
     {
         output = l->item;
 
@@ -392,7 +392,7 @@ pepper_compositor_find_output(pepper_compositor_t *compositor, const char *name)
     pepper_output_t *output;
     pepper_list_t   *l;
 
-    PEPPER_LIST_FOR_EACH(&compositor->output_list, l)
+    pepper_list_for_each(l, &compositor->output_list)
     {
         output = l->item;
 
index f0e6789..e8d03ae 100644 (file)
@@ -22,9 +22,8 @@ extern "C" {
 #define PEPPER_MAX(a, b)    ((a) > (b) ? (a) : (b))
 #define PEPPER_MIN(a, b)    ((a) < (b) ? (a) : (b))
 
-#define pepper_container_of(ptr, type, member) ({               \
-    const __typeof__( ((type *)0)->member ) *__mptr = (ptr);    \
-    (type *)( (char *)__mptr - offsetof(type,member) );})
+#define pepper_container_of(ptr, sample, member)                                    \
+       (__typeof__(sample))((char *)(ptr) - offsetof(__typeof__(*sample), member))
 
 #define PEPPER_ARRAY_LENGTH(arr)    (sizeof(arr) / sizeof(arr)[0])
 
@@ -106,25 +105,25 @@ get_pixman_format(pepper_format_t format)
 
 typedef struct pepper_list      pepper_list_t;
 
-#define PEPPER_LIST_FOR_EACH(head, pos)                     \
-    for (pos = (head)->next;                                \
-         pos != (head);                                     \
+#define pepper_list_for_each(pos, head)                                     \
+    for (pos = (head)->next;                                                \
+         pos != (head);                                                     \
          pos = pos->next)
 
-#define PEPPER_LIST_FOR_EACH_SAFE(head, pos, temp)          \
-    for (pos = (head)->next, temp = pos->next;              \
-         pos != (head);                                     \
-         pos = temp, temp = pos->next)
+#define pepper_list_for_each_safe(pos, tmp, head)                           \
+    for (pos = (head)->next, tmp = pos->next;                               \
+         pos != (head);                                                     \
+         pos = tmp, tmp = pos->next)
 
-#define PEPPER_LIST_FOR_EACH_REVERSE(head, pos)             \
-    for (pos = (head)->prev;                                \
-         pos != (head);                                     \
+#define pepper_list_for_each_reverse(pos, head)                             \
+    for (pos = (head)->prev;                                                \
+         pos != (head);                                                     \
          pos = pos->prev)
 
-#define PEPPER_LIST_FOR_EACH_REVERSE_SAFE(head, pos, temp)  \
-    for (pos = (head)->prev, temp = pos->prev;              \
-         pos != (head);                                     \
-         pos = temp, temp = pos->prev)
+#define pepper_list_for_each_reverse_safe(pos, tmp, head)                   \
+    for (pos = (head)->prev, tmp = pos->prev;                               \
+         pos != (head);                                                     \
+         pos = tmp, tmp = pos->prev)
 
 struct pepper_list
 {
@@ -171,7 +170,7 @@ pepper_list_find_item(pepper_list_t *list, void *item)
 {
     pepper_list_t *l;
 
-    PEPPER_LIST_FOR_EACH(list, l)
+    pepper_list_for_each(l, list)
     {
         if (l->item == item)
             return l;
@@ -200,7 +199,7 @@ pepper_list_remove_item(pepper_list_t *list, void *item, pepper_free_func_t free
 {
     pepper_list_t *l;
 
-    PEPPER_LIST_FOR_EACH(list, l)
+    pepper_list_for_each(l, list)
     {
         if (l->item == item)
         {
@@ -215,7 +214,7 @@ pepper_list_clear(pepper_list_t *list, pepper_free_func_t free_func)
 {
     pepper_list_t *l, *temp;
 
-    PEPPER_LIST_FOR_EACH_SAFE(list, l, temp)
+    pepper_list_for_each_safe(l, temp, list)
     {
         if (free_func)
             free_func(l->item);
index 76bc651..03c15e3 100644 (file)
@@ -9,7 +9,7 @@ pepper_plane_update(pepper_plane_t *plane, const pepper_list_t *view_list)
 
     pepper_list_init(&plane->entry_list);
 
-    PEPPER_LIST_FOR_EACH(view_list, l)
+    pepper_list_for_each(l, view_list)
     {
         pepper_view_t          *view  = l->item;
         pepper_plane_entry_t   *entry = &view->plane_entries[plane->output->id];
@@ -37,7 +37,7 @@ pepper_plane_accumulate_damage(pepper_plane_t *plane, pixman_region32_t *clip)
 
     pixman_region32_init(clip);
 
-    PEPPER_LIST_FOR_EACH_REVERSE(&plane->entry_list, l)
+    pepper_list_for_each_reverse(l, &plane->entry_list)
     {
         pepper_plane_entry_t   *entry = l->item;
         pepper_view_t          *view = (pepper_view_t *)entry->base.view;
@@ -92,7 +92,7 @@ pepper_plane_destroy(pepper_plane_t *plane)
 {
     pepper_list_t  *l;
 
-    PEPPER_LIST_FOR_EACH(&plane->entry_list, l)
+    pepper_list_for_each(l, &plane->entry_list)
     {
         pepper_plane_entry_t *entry = l->item;
         pepper_view_assign_plane(entry->base.view, plane->output, NULL);
index e2bf1ca..9b56d1b 100644 (file)
@@ -474,7 +474,7 @@ pepper_surface_flush_damage(pepper_surface_t *surface)
     if (!pixman_region32_not_empty(&surface->damage_region))
         return;
 
-    PEPPER_LIST_FOR_EACH(&surface->view_list, l)
+    pepper_list_for_each(l, &surface->view_list)
         pepper_view_surface_damage((pepper_view_t *)l->item);
 
     /* TODO: Call backend.urface_flush(). */
index c05300b..9f2eac4 100644 (file)
@@ -14,7 +14,7 @@ view_mark_dirty(pepper_view_t *view, uint32_t flag)
     if ((flag & PEPPER_VIEW_VISIBILITY_DIRTY) ||
         (flag & PEPPER_VIEW_GEOMETRY_DIRTY))
     {
-        PEPPER_LIST_FOR_EACH(&view->children_list, l)
+        pepper_list_for_each(l, &view->children_list)
             view_mark_dirty((pepper_view_t *)l->item, flag);
     }
 
@@ -98,7 +98,7 @@ view_insert(pepper_view_t *view, pepper_list_t *pos, pepper_bool_t subtree)
     {
         pepper_list_t *l;
 
-        PEPPER_LIST_FOR_EACH(&view->children_list, l)
+        pepper_list_for_each(l, &view->children_list)
             pos = view_insert((pepper_view_t *)l->item, pos, subtree);
     }
 
@@ -193,7 +193,7 @@ view_update_geometry(pepper_view_t *view)
 
     view->output_overlap = 0;
 
-    PEPPER_LIST_FOR_EACH(&view->compositor->output_list, l)
+    pepper_list_for_each(l, &view->compositor->output_list)
     {
         pepper_output_t *output = l->item;
         pixman_box32_t   box =
@@ -307,7 +307,7 @@ pepper_view_destroy(pepper_view_t *view)
     for (i = 0; i < PEPPER_MAX_OUTPUT_COUNT; i++)
         plane_entry_set_plane(&view->plane_entries[i], NULL);
 
-    PEPPER_LIST_FOR_EACH_SAFE(&view->children_list, l, next)
+    pepper_list_for_each_safe(l, next, &view->children_list)
         pepper_view_destroy((pepper_view_t *)(l->item));
 
     if (view->parent)
index f938f8e..38ed565 100644 (file)
@@ -276,7 +276,7 @@ pixman_renderer_repaint_output(pepper_renderer_t *renderer, pepper_output_t *out
     {
         pepper_list_t *l;
 
-        PEPPER_LIST_FOR_EACH_REVERSE(render_list, l)
+        pepper_list_for_each_reverse(l, render_list)
             repaint_view(renderer, (pepper_render_item_t *)l->item, damage);
     }
 }
index c613e57..be6a218 100644 (file)
@@ -153,7 +153,7 @@ wayland_output_assign_planes(void *o, const pepper_list_t *view_list)
     wayland_output_t   *output = (wayland_output_t *)o;
     pepper_list_t      *l;
 
-    PEPPER_LIST_FOR_EACH(view_list, l)
+    pepper_list_for_each(l, view_list)
     {
         pepper_view_t *view = l->item;
         pepper_view_assign_plane(view, output->base, output->primary_plane);
@@ -168,7 +168,7 @@ wayland_output_repaint(void *o, const pepper_list_t *plane_list)
 
     pepper_list_t  *l;
 
-    PEPPER_LIST_FOR_EACH(plane_list, l)
+    pepper_list_for_each(l, plane_list)
     {
         pepper_plane_t *plane = l->item;
 
@@ -233,7 +233,7 @@ pixman_render_pre(wayland_output_t *output)
     }
     else
     {
-        buffer = pepper_container_of(output->shm.free_buffers.next, wayland_shm_buffer_t, link);
+        buffer = pepper_container_of(output->shm.free_buffers.next, buffer, link);
         wl_list_remove(&buffer->link);
     }
 
index 96e9f18..37c627a 100644 (file)
@@ -432,7 +432,7 @@ x11_output_assign_planes(void *o, const pepper_list_t *view_list)
     x11_output_t   *output = (x11_output_t *)o;
     pepper_list_t  *l;
 
-    PEPPER_LIST_FOR_EACH(view_list, l)
+    pepper_list_for_each(l, view_list)
     {
         pepper_view_t *view = l->item;
         pepper_view_assign_plane(view, output->base, output->primary_plane);
@@ -445,7 +445,7 @@ x11_output_repaint(void *o, const pepper_list_t *plane_list)
     x11_output_t *output = o;
     pepper_list_t  *l;
 
-    PEPPER_LIST_FOR_EACH(plane_list, l)
+    pepper_list_for_each(l, plane_list)
     {
         pepper_plane_t *plane = l->item;