From c95613f8b7256bc68f34b142d39ca190ba3ff121 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 7 Mar 2016 12:37:00 -0800 Subject: [PATCH] GUAC-1389: Reference client/user handler types directly. Do not redocument parameters. --- src/protocols/rdp/client.h | 5 +- src/protocols/rdp/input.h | 29 +------ src/protocols/rdp/rdp_stream.h | 133 +++------------------------------ src/protocols/rdp/user.h | 17 +---- 4 files changed, 18 insertions(+), 166 deletions(-) diff --git a/src/protocols/rdp/client.h b/src/protocols/rdp/client.h index 43161cae..0b9520d8 100644 --- a/src/protocols/rdp/client.h +++ b/src/protocols/rdp/client.h @@ -85,10 +85,7 @@ /** * Handler which frees all data associated with the guac_client. - * - * @param client The guac_client whose data should be freed. - * @return Zero if the client was successfully freed, non-zero otherwise. */ -int guac_rdp_client_free_handler(guac_client* client); +guac_client_free_handler guac_rdp_client_free_handler; #endif diff --git a/src/protocols/rdp/input.h b/src/protocols/rdp/input.h index 68b4eff4..55432ac6 100644 --- a/src/protocols/rdp/input.h +++ b/src/protocols/rdp/input.h @@ -62,41 +62,18 @@ void guac_rdp_update_keysyms(guac_client* client, const int* keysym_string, /** * Handler for Guacamole user mouse events. - * - * @param user The guac_user originating the mouse event. - * @param x The current X location of the mouse pointer. - * @param y The current Y location of the mouse pointer. - * - * @param mask - * Button mask denoting the pressed/released state of each mouse button. - * The lowest-order bit represents button 0 (the left mouse button), and - * so on through the higher-order bits. Most mice have no more than 5 - * mouse buttons. - * - * @return - * Zero if the mouse event was successfully handled, non-zero otherwise. */ -int guac_rdp_user_mouse_handler(guac_user* user, int x, int y, int mask); +guac_user_mouse_handler guac_rdp_user_mouse_handler; /** * Handler for Guacamole user key events. - * - * @param user The guac_user originating the key event. - * @param keysym The keysym being pressed or released. - * @param pressed Zero if the keysym is being released, non-zero otherwise. - * @return Zero if the key event was successfully handled, non-zero otherwise. */ -int guac_rdp_user_key_handler(guac_user* user, int keysym, int pressed); +guac_user_key_handler guac_rdp_user_key_handler; /** * Handler for Guacamole user size events. - * - * @param user The guac_user originating the size event. - * @param width The new display width, in pixels. - * @param height The new display height, in pixels. - * @return Zero if the size event was successfully handled, non-zero otherwise. */ -int guac_rdp_user_size_handler(guac_user* user, int width, int height); +guac_user_size_handler guac_rdp_user_size_handler; #endif diff --git a/src/protocols/rdp/rdp_stream.h b/src/protocols/rdp/rdp_stream.h index ced121c5..62fa25a6 100644 --- a/src/protocols/rdp/rdp_stream.h +++ b/src/protocols/rdp/rdp_stream.h @@ -162,177 +162,68 @@ typedef struct guac_rdp_stream { /** * Handler for inbound files related to file uploads. - * - * @param user The user creating the file stream. - * @param stream The newly-created file stream. - * @param mimetype The mimetype of the file being received. - * @param filename The name of the file being received. - * @return Zero if successful, non-zero if an error occurs. */ -int guac_rdp_upload_file_handler(guac_user* user, guac_stream* stream, - char* mimetype, char* filename); +guac_user_file_handler guac_rdp_upload_file_handler; /** * Handler for inbound pipes related to static virtual channels. - * - * @param user The user creating the pipe stream. - * @param stream The newly-created pipe stream. - * @param mimetype The mimetype of the pipe being received. - * @param name The name of the pipe being received. - * @return Zero if successful, non-zero if an error occurs. */ -int guac_rdp_svc_pipe_handler(guac_user* user, guac_stream* stream, - char* mimetype, char* name); +guac_user_pipe_handler guac_rdp_svc_pipe_handler; /** * Handler for inbound clipboard data. - * - * @param user The user creating the clipboard stream. - * @param stream The newly-created clipboard stream. - * @param mimetype The mimetype of the clipboard data being received. - * @return Zero if successful, non-zero if an error occurs. */ -int guac_rdp_clipboard_handler(guac_user* user, guac_stream* stream, - char* mimetype); +guac_user_clipboard_handler guac_rdp_clipboard_handler; /** * Handler for stream data related to file uploads. - * - * @param user The user sending data. - * @param stream The file stream receiving the given data. - * @param data The received data. - * @param length The number of bytes received. - * @return Zero if successful, non-zero if an error occurs. */ -int guac_rdp_upload_blob_handler(guac_user* user, guac_stream* stream, - void* data, int length); +guac_user_blob_handler guac_rdp_upload_blob_handler; /** * Handler for stream data related to static virtual channels. - * - * @param user The user sending data. - * @param stream The pipe stream receiving the given data. - * @param data The received data. - * @param length The number of bytes received. - * @return Zero if successful, non-zero if an error occurs. */ -int guac_rdp_svc_blob_handler(guac_user* user, guac_stream* stream, - void* data, int length); +guac_user_blob_handler guac_rdp_svc_blob_handler; /** * Handler for stream data related to clipboard. - * - * @param user The user sending data. - * @param stream The clipboard stream receiving the given data. - * @param data The received data. - * @param length The number of bytes received. - * @return Zero if successful, non-zero if an error occurs. */ -int guac_rdp_clipboard_blob_handler(guac_user* user, guac_stream* stream, - void* data, int length); +guac_user_blob_handler guac_rdp_clipboard_blob_handler; /** * Handler for end-of-stream related to file uploads. - * - * @param user The user closing the stream. - * @param stream The file stream being closed. - * @return Zero if successful, non-zero if an error occurs. */ -int guac_rdp_upload_end_handler(guac_user* user, guac_stream* stream); +guac_user_end_handler guac_rdp_upload_end_handler; /** * Handler for end-of-stream related to clipboard. - * - * @param user The user closing the stream. - * @param stream The clipboard stream being closed. - * @return Zero if successful, non-zero if an error occurs. */ -int guac_rdp_clipboard_end_handler(guac_user* user, guac_stream* stream); +guac_user_end_handler guac_rdp_clipboard_end_handler; /** * Handler for acknowledgements of receipt of data related to file downloads. - * - * @param user The user acknowledging data receipt. - * @param stream The file stream associated with the data being acknowledged. - * @param message An arbitrary human-readable message acknowledging receipt. - * @param status - * The status code representing whether the data was received successfully. - * - * @return Zero if successful, non-zero if an error occurs. */ -int guac_rdp_download_ack_handler(guac_user* user, guac_stream* stream, - char* message, guac_protocol_status status); +guac_user_ack_handler guac_rdp_download_ack_handler; /** * Handler for ack messages received due to receipt of a "body" or "blob" * instruction associated with a directory list operation. - * - * @param user - * The user receiving the ack message. - * - * @param stream - * The Guacamole protocol stream associated with the received ack message. - * - * @param message - * An arbitrary human-readable message describing the nature of the - * success or failure denoted by this ack message. - * - * @param status - * The status code associated with this ack message, which may indicate - * success or an error. - * - * @return - * Zero on success, non-zero on error. */ -int guac_rdp_ls_ack_handler(guac_user* user, guac_stream* stream, - char* message, guac_protocol_status status); +guac_user_ack_handler guac_rdp_ls_ack_handler; /** * Handler for get messages. In context of downloads and the filesystem exposed * via the Guacamole protocol, get messages request the body of a file within * the filesystem. - * - * @param user - * The user receiving the get message. - * - * @param object - * The Guacamole protocol object associated with the get request itself. - * - * @param name - * The name of the input stream (file) being requested. - * - * @return - * Zero on success, non-zero on error. */ -int guac_rdp_download_get_handler(guac_user* user, guac_object* object, - char* name); +guac_user_get_handler guac_rdp_download_get_handler; /** * Handler for put messages. In context of uploads and the filesystem exposed * via the Guacamole protocol, put messages request write access to a file * within the filesystem. - * - * @param user - * The user receiving the put message. - * - * @param object - * The Guacamole protocol object associated with the put request itself. - * - * @param stream - * The Guacamole protocol stream along which the user will be sending - * file data. - * - * @param mimetype - * The mimetype of the data being send along the stream. - * - * @param name - * The name of the input stream (file) being requested. - * - * @return - * Zero on success, non-zero on error. */ -int guac_rdp_upload_put_handler(guac_user* user, guac_object* object, - guac_stream* stream, char* mimetype, char* name); +guac_user_put_handler guac_rdp_upload_put_handler; #endif diff --git a/src/protocols/rdp/user.h b/src/protocols/rdp/user.h index eb00fd28..54dd1dcf 100644 --- a/src/protocols/rdp/user.h +++ b/src/protocols/rdp/user.h @@ -27,28 +27,15 @@ /** * Handler for joining users. - * - * @param user The user joining the connection. - * - * @param argc - * The number of arguments provided by the user during the connection - * handshake. - * - * @param argv - * Array of values of each argument provided by the user during the - * connection handshake. - * - * @return Zero if the join operation succeeded, non-zero otherwise. */ -int guac_rdp_user_join_handler(guac_user* user, int argc, char** argv); +guac_user_join_handler guac_rdp_user_join_handler; /** * Handler for received simple file uploads. This handler will automatically * select between RDPDR and SFTP depending on which is available and which has * priority given associated settings. */ -int guac_rdp_user_file_handler(guac_user* user, guac_stream* stream, - char* mimetype, char* filename); +guac_user_file_handler guac_rdp_user_file_handler; #endif