aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2024-05-23 19:25:40 +0300
committerSimon Ser <contact@emersion.fr>2024-08-09 20:29:24 +0000
commit65454cf7db29933d4931dfbe14461a59cc64944d (patch)
tree8cefdf22a28a2aa9f4a5e9923047b3211e8118fb /src
parentserver: add wl_resource_post_error() docs (diff)
downloadwayland-65454cf7db29933d4931dfbe14461a59cc64944d.tar
wayland-65454cf7db29933d4931dfbe14461a59cc64944d.tar.gz
wayland-65454cf7db29933d4931dfbe14461a59cc64944d.tar.bz2
wayland-65454cf7db29933d4931dfbe14461a59cc64944d.tar.lz
wayland-65454cf7db29933d4931dfbe14461a59cc64944d.tar.xz
wayland-65454cf7db29933d4931dfbe14461a59cc64944d.tar.zst
wayland-65454cf7db29933d4931dfbe14461a59cc64944d.zip
server: expose wl_resource_post_error_vargs()
Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
Diffstat (limited to 'src')
-rw-r--r--src/wayland-server-core.h4
-rw-r--r--src/wayland-server.c12
2 files changed, 14 insertions, 2 deletions
diff --git a/src/wayland-server-core.h b/src/wayland-server-core.h
index 26c527e..b1baa25 100644
--- a/src/wayland-server-core.h
+++ b/src/wayland-server-core.h
@@ -551,6 +551,10 @@ wl_resource_queue_event_array(struct wl_resource *resource,
uint32_t opcode, union wl_argument *args);
void
+wl_resource_post_error_vargs(struct wl_resource *resource,
+ uint32_t code, const char *msg, va_list argp);
+
+void
wl_resource_post_error(struct wl_resource *resource,
uint32_t code, const char *msg, ...) WL_PRINTF(3, 4);
diff --git a/src/wayland-server.c b/src/wayland-server.c
index c54a6d6..5ea9101 100644
--- a/src/wayland-server.c
+++ b/src/wayland-server.c
@@ -288,7 +288,16 @@ wl_resource_queue_event(struct wl_resource *resource, uint32_t opcode, ...)
wl_resource_queue_event_array(resource, opcode, args);
}
-static void
+/** Post a protocol error
+ *
+ * \param resource The resource object
+ * \param code The error code
+ * \param msg The error message format string
+ * \param argp The format string argument list
+ *
+ * \memberof wl_resource
+ */
+WL_EXPORT void
wl_resource_post_error_vargs(struct wl_resource *resource,
uint32_t code, const char *msg, va_list argp)
{
@@ -310,7 +319,6 @@ wl_resource_post_error_vargs(struct wl_resource *resource,
wl_resource_post_event(client->display_resource,
WL_DISPLAY_ERROR, resource, code, buffer);
client->error = true;
-
}
/** Post a protocol error