From 387adc6a794df6bee114396612d5a6accab318c3 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Tue, 2 Mar 2021 23:24:16 -0500 Subject: [PATCH] server: Document wl_display_add_socket_auto The exact sequence of names tried has de facto become part of the API. Signed-off-by: Manuel Stoeckl --- src/wayland-server.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index 96dd417b..15667644 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -1808,6 +1808,24 @@ _wl_display_add_socket(struct wl_display *display, struct wl_socket *s) return 0; } + +/** Automatically pick a Wayland display socket for the clients to connect to. + * + * \param display Wayland display to which the socket should be added. + * \return The socket name if success. NULL if failed. + * + * This adds a Unix socket to Wayland display which can be used by clients to + * connect to Wayland display. The name of the socket is chosen automatically + * as the first available name in the sequence "wayland-0", "wayland-1", + * "wayland-2", ..., "wayland-32". + * + * The string returned by this function is owned by the library and should + * not be freed. + * + * \sa wl_display_add_socket + * + * \memberof wl_display + */ WL_EXPORT const char * wl_display_add_socket_auto(struct wl_display *display) {