diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wayland-client.c | 3 | ||||
| -rw-r--r-- | src/wayland-server-core.h | 4 | ||||
| -rw-r--r-- | src/wayland-server.c | 24 |
3 files changed, 31 insertions, 0 deletions
diff --git a/src/wayland-client.c b/src/wayland-client.c index 0ccfc66..b0805f1 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -185,6 +185,9 @@ display_protocol_error(struct wl_display *display, uint32_t code, case WL_DISPLAY_ERROR_NO_MEMORY: err = ENOMEM; break; + case WL_DISPLAY_ERROR_IMPLEMENTATION: + err = EPROTO; + break; default: err = EFAULT; } diff --git a/src/wayland-server-core.h b/src/wayland-server-core.h index 2e725d9..3e0272b 100644 --- a/src/wayland-server-core.h +++ b/src/wayland-server-core.h @@ -325,6 +325,10 @@ void wl_client_post_no_memory(struct wl_client *client); void +wl_client_post_implementation_error(struct wl_client *client, + const char* msg, ...) WL_PRINTF(2,3); + +void wl_client_add_resource_created_listener(struct wl_client *client, struct wl_listener *listener); diff --git a/src/wayland-server.c b/src/wayland-server.c index c0ad229..19f6a76 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -650,6 +650,30 @@ wl_client_post_no_memory(struct wl_client *client) WL_DISPLAY_ERROR_NO_MEMORY, "no memory"); } +/** Report an internal server error + * + * \param client The client object + * \param msg A printf-style format string + * \param ... Format string arguments + * + * Report an unspecified internal implementation error and disconnect + * the client. + * + * \memberof wl_client + */ +WL_EXPORT void +wl_client_post_implementation_error(struct wl_client *client, + char const *msg, ...) +{ + va_list ap; + + va_start(ap, msg); + wl_resource_post_error_vargs(client->display_resource, + WL_DISPLAY_ERROR_IMPLEMENTATION, + msg, ap); + va_end(ap); +} + WL_EXPORT void wl_resource_post_no_memory(struct wl_resource *resource) { |
