diff options
| author | Giulio Camuffo <giuliocamuffo@gmail.com> | 2016-08-09 12:46:53 +0200 |
|---|---|---|
| committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2016-08-11 15:52:15 +0300 |
| commit | 596024f728b0a1292ee69a80dd72a85167870936 (patch) | |
| tree | 4f2ea7daf3a7b3b6353f62158c2022e90b9de957 /src/wayland-server-core.h | |
| parent | Add API to retrieve the interface name of a wl_resource (diff) | |
| download | wayland-596024f728b0a1292ee69a80dd72a85167870936.tar wayland-596024f728b0a1292ee69a80dd72a85167870936.tar.gz wayland-596024f728b0a1292ee69a80dd72a85167870936.tar.bz2 wayland-596024f728b0a1292ee69a80dd72a85167870936.tar.lz wayland-596024f728b0a1292ee69a80dd72a85167870936.tar.xz wayland-596024f728b0a1292ee69a80dd72a85167870936.tar.zst wayland-596024f728b0a1292ee69a80dd72a85167870936.zip | |
Add API to get the list of connected clients
This patch chooses the wl_list_for_each-style of iterating over
the clients, instead of using an iterator function, because i think
it is easier to use.
Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'src/wayland-server-core.h')
| -rw-r--r-- | src/wayland-server-core.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/wayland-server-core.h b/src/wayland-server-core.h index c0d25e9..69c09dc 100644 --- a/src/wayland-server-core.h +++ b/src/wayland-server-core.h @@ -171,6 +171,20 @@ wl_global_destroy(struct wl_global *global); struct wl_client * wl_client_create(struct wl_display *display, int fd); +struct wl_list * +wl_display_get_client_list(struct wl_display *display); + +struct wl_list * +wl_client_get_link(struct wl_client *client); + +struct wl_client * +wl_client_from_link(struct wl_list *link); + +#define wl_client_for_each(client, list) \ + for (client = wl_client_from_link((list)->next); \ + wl_client_get_link(client) != (list); \ + client = wl_client_from_link(wl_client_get_link(client)->next)) + void wl_client_destroy(struct wl_client *client); |
