wayland-server: Add a wl_resource_for_each macro

This macro allows you to correctly iterate through a list of resources
handling the opaque nature of this type.
This commit is contained in:
Rob Bradford 2013-07-22 17:30:51 +01:00 committed by Kristian Høgsberg
parent dbc41f0344
commit 748c20c46f

View file

@ -298,6 +298,11 @@ struct wl_listener *
wl_resource_get_destroy_listener(struct wl_resource *resource,
wl_notify_func_t notify);
#define wl_resource_for_each(resource, list) \
for (resource = 0, resource = wl_resource_from_link((list)->next); \
wl_resource_get_link(resource) != (list); \
resource = wl_resource_from_link(wl_resource_get_link(resource)->next))
struct wl_shm_buffer;
struct wl_shm_buffer *