diff --git a/src/libguacd/Makefile.am b/src/libguacd/Makefile.am index a8d2a9f5..6018b97a 100644 --- a/src/libguacd/Makefile.am +++ b/src/libguacd/Makefile.am @@ -23,10 +23,12 @@ lib_LTLIBRARIES = libguacd.la libguacdincdir = $(includedir)/libguacd -libguacdinc_HEADERS = \ - libguacd/log.h \ +libguacdinc_HEADERS = \ libguacd/user.h +noinst_HEADERS = \ + log.h + libguacd_la_SOURCES = \ log.c \ user.c diff --git a/src/libguacd/libguacd/user.h b/src/libguacd/libguacd/user.h index cb2a8b3e..8c1db687 100644 --- a/src/libguacd/libguacd/user.h +++ b/src/libguacd/libguacd/user.h @@ -46,40 +46,6 @@ */ #define GUACD_CLIENT_MAX_CONNECTIONS 65536 -/** - * Parameters required by the user input thread. - */ -typedef struct guacd_user_input_thread_params { - - /** - * The parser which will be used throughout the user's session. - */ - guac_parser* parser; - - /** - * A reference to the connected user. - */ - guac_user* user; - -} guacd_user_input_thread_params; - -/** - * Starts the input/output threads of a new user. This function will block - * until the user disconnects. If an error prevents the input/output threads - * from starting, guac_user_stop() will be invoked on the given user. - * - * @param parser - * The guac_parser to use to handle all input from the given user. - * - * @param user - * The user whose associated I/O transfer threads should be started. - * - * @return - * Zero if the I/O threads started successfully and user has disconnected, - * or non-zero if the I/O threads could not be started. - */ -int guacd_user_start(guac_parser* parser, guac_user* user); - /** * Handles the initial handshake of a user and all subsequent I/O. This * function blocks until the user disconnects. @@ -95,19 +61,5 @@ int guacd_user_start(guac_parser* parser, guac_user* user); */ int guacd_handle_user(guac_user* user); -/** - * The thread which handles all user input, calling event handlers for received - * instructions. - * - * @param data - * A pointer to a guacd_user_input_thread_params structure describing the - * user whose input is being handled and the guac_parser with which to - * handle it. - * - * @return - * Always NULL. - */ -void* guacd_user_input_thread(void* data); - #endif diff --git a/src/libguacd/log.c b/src/libguacd/log.c index 76d49749..180cc977 100644 --- a/src/libguacd/log.c +++ b/src/libguacd/log.c @@ -18,7 +18,7 @@ */ #include "config.h" -#include "libguacd/log.h" +#include "log.h" #include #include diff --git a/src/libguacd/libguacd/log.h b/src/libguacd/log.h similarity index 100% rename from src/libguacd/libguacd/log.h rename to src/libguacd/log.h diff --git a/src/libguacd/user.c b/src/libguacd/user.c index db39fce7..a0c17595 100644 --- a/src/libguacd/user.c +++ b/src/libguacd/user.c @@ -19,8 +19,8 @@ #include "config.h" -#include "libguacd/log.h" #include "libguacd/user.h" +#include "log.h" #include #include @@ -33,6 +33,23 @@ #include #include +/** + * Parameters required by the user input thread. + */ +typedef struct guacd_user_input_thread_params { + + /** + * The parser which will be used throughout the user's session. + */ + guac_parser* parser; + + /** + * A reference to the connected user. + */ + guac_user* user; + +} guacd_user_input_thread_params; + /** * Copies the given array of mimetypes (strings) into a newly-allocated NULL- * terminated array of strings. Both the array and the strings within the array @@ -91,7 +108,19 @@ static void guacd_free_mimetypes(char** mimetypes) { } -void* guacd_user_input_thread(void* data) { +/** + * The thread which handles all user input, calling event handlers for received + * instructions. + * + * @param data + * A pointer to a guacd_user_input_thread_params structure describing the + * user whose input is being handled and the guac_parser with which to + * handle it. + * + * @return + * Always NULL. + */ +static void* guacd_user_input_thread(void* data) { guacd_user_input_thread_params* params = (guacd_user_input_thread_params*) data; guac_user* user = params->user; @@ -143,7 +172,22 @@ void* guacd_user_input_thread(void* data) { } -int guacd_user_start(guac_parser* parser, guac_user* user) { +/** + * Starts the input/output threads of a new user. This function will block + * until the user disconnects. If an error prevents the input/output threads + * from starting, guac_user_stop() will be invoked on the given user. + * + * @param parser + * The guac_parser to use to handle all input from the given user. + * + * @param user + * The user whose associated I/O transfer threads should be started. + * + * @return + * Zero if the I/O threads started successfully and user has disconnected, + * or non-zero if the I/O threads could not be started. + */ +static int guacd_user_start(guac_parser* parser, guac_user* user) { guacd_user_input_thread_params params = { .parser = parser,