diff options
Diffstat (limited to 'android/protocol/user-events-proxy.c')
-rw-r--r-- | android/protocol/user-events-proxy.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/android/protocol/user-events-proxy.c b/android/protocol/user-events-proxy.c index d35012f..2049b68 100644 --- a/android/protocol/user-events-proxy.c +++ b/android/protocol/user-events-proxy.c @@ -34,22 +34,6 @@ typedef struct UserEventsProxy { /* One and only one user events client instance. */ static UserEventsProxy _userEventsProxy = { 0 }; -/* Destroys CoreCmdProxy instance. */ -static void -_userEventsProxy_destroy(void) -{ - if (_userEventsProxy.sync_writer != NULL) { - syncsocket_close(_userEventsProxy.sync_writer); - syncsocket_free(_userEventsProxy.sync_writer); - _userEventsProxy.sync_writer = NULL; - } - if (_userEventsProxy.core_connection != NULL) { - core_connection_close(_userEventsProxy.core_connection); - core_connection_free(_userEventsProxy.core_connection); - _userEventsProxy.core_connection = NULL; - } -} - /* Sends an event to the core. * Parameters: * event - Event type. Must be one of the AUSER_EVENT_XXX. @@ -107,7 +91,7 @@ userEventsProxy_create(SockAddress* console_socket) _userEventsProxy.sync_writer = syncsocket_init(_userEventsProxy.sock); if (_userEventsProxy.sync_writer == NULL) { derror("Unable to initialize UserEventsProxy writer: %s\n", errno_str); - _userEventsProxy_destroy(); + userEventsProxy_destroy(); return -1; } @@ -125,6 +109,20 @@ userEventsProxy_create(SockAddress* console_socket) } void +userEventsProxy_destroy(void) +{ + if (_userEventsProxy.sync_writer != NULL) { + syncsocket_close(_userEventsProxy.sync_writer); + syncsocket_free(_userEventsProxy.sync_writer); + _userEventsProxy.sync_writer = NULL; + } + if (_userEventsProxy.core_connection != NULL) { + core_connection_close(_userEventsProxy.core_connection); + core_connection_free(_userEventsProxy.core_connection); + _userEventsProxy.core_connection = NULL; + } +} +void user_event_keycodes(int *kcodes, int count) { int nn; |