diff --git a/input/input_driver.c b/input/input_driver.c index e4ebc63bfd..ac6284c62a 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -99,7 +99,7 @@ static turbo_buttons_t input_driver_turbo_btns; static rarch_cmd_t *input_driver_command = NULL; #endif #ifdef HAVE_NETWORK_GAMEPAD -static rarch_remote_t *input_driver_remote = NULL; +static input_remote_t *input_driver_remote = NULL; #endif static const input_driver_t *current_input = NULL; static void *current_input_data = NULL; @@ -441,7 +441,7 @@ void input_poll(void) #ifdef HAVE_NETWORK_GAMEPAD if (input_driver_remote) - rarch_remote_poll(input_driver_remote); + input_remote_poll(input_driver_remote); #endif } @@ -490,7 +490,7 @@ int16_t input_state(unsigned port, unsigned device, #endif #ifdef HAVE_NETWORK_GAMEPAD - input_state_remote(&res, port, device, idx, id); + input_remote_state(&res, port, device, idx, id); #endif } @@ -878,7 +878,7 @@ void input_driver_deinit_remote(void) { #ifdef HAVE_NETWORK_GAMEPAD if (input_driver_remote) - rarch_remote_free(input_driver_remote); + input_remote_free(input_driver_remote); input_driver_remote = NULL; #endif } @@ -891,8 +891,7 @@ bool input_driver_init_remote(void) if (!settings->network_remote_enable) return false; - input_driver_remote - = rarch_remote_new(settings->network_remote_base_port); + input_driver_remote = input_remote_new(settings->network_remote_base_port); if (!input_driver_remote) { diff --git a/remote.c b/remote.c index 2aeb6bd576..6c5c021b6d 100644 --- a/remote.c +++ b/remote.c @@ -38,7 +38,7 @@ #define DEFAULT_NETWORK_GAMEPAD_PORT 55400 #define UDP_FRAME_PACKETS 16 -struct rarch_remote +struct input_remote { #if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) @@ -64,7 +64,7 @@ static input_remote_state_t *input_remote_get_state_ptr(void) } #if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) -static bool remote_init_network(rarch_remote_t *handle, +static bool input_remote_init_network(input_remote_t *handle, uint16_t port, unsigned user) { int fd; @@ -104,13 +104,13 @@ error: } #endif -rarch_remote_t *rarch_remote_new(uint16_t port) +input_remote_t *input_remote_new(uint16_t port) { unsigned user; #if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) settings_t *settings = config_get_ptr(); #endif - rarch_remote_t *handle = (rarch_remote_t*) + input_remote_t *handle = (input_remote_t*) calloc(1, sizeof(*handle)); if (!handle) @@ -123,7 +123,7 @@ rarch_remote_t *rarch_remote_new(uint16_t port) { handle->net_fd[user] = -1; if(settings->network_remote_enable_user[user]) - if (!remote_init_network(handle, port, user)) + if (!input_remote_init_network(handle, port, user)) goto error; } #endif @@ -132,12 +132,12 @@ rarch_remote_t *rarch_remote_new(uint16_t port) #if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) error: - rarch_remote_free(handle); + input_remote_free(handle); return NULL; #endif } -void rarch_remote_free(rarch_remote_t *handle) +void input_remote_free(input_remote_t *handle) { unsigned user; #if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) @@ -151,7 +151,7 @@ void rarch_remote_free(rarch_remote_t *handle) } #if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) -static void parse_packet(char *buffer, unsigned size, unsigned user) +static void input_remote_parse_packet(char *buffer, unsigned size, unsigned user) { input_remote_state_t *ol_state = input_remote_get_state_ptr(); /* todo implement parsing of input_state from the packet */ @@ -159,8 +159,11 @@ static void parse_packet(char *buffer, unsigned size, unsigned user) } #endif -void input_state_remote(int16_t *ret, - unsigned port, unsigned device, unsigned idx, +void input_remote_state( + int16_t *ret, + unsigned port, + unsigned device, + unsigned idx, unsigned id) { input_remote_state_t *ol_state = input_remote_get_state_ptr(); @@ -199,7 +202,7 @@ bool input_remote_key_pressed(int key, unsigned port) return (ol_state->buttons[port] & (UINT64_C(1) << key)); } -void rarch_remote_poll(rarch_remote_t *handle) +void input_remote_poll(input_remote_t *handle) { unsigned user; settings_t *settings = config_get_ptr(); @@ -225,7 +228,7 @@ void rarch_remote_poll(rarch_remote_t *handle) sizeof(buf) - 1, 0, NULL, NULL); if (ret > 0) - parse_packet(buf, sizeof(buf), user); + input_remote_parse_packet(buf, sizeof(buf), user); else #endif ol_state->buttons[user] = 0; diff --git a/remote.h b/remote.h index 83f1a9845c..da9ab4875b 100644 --- a/remote.h +++ b/remote.h @@ -14,8 +14,8 @@ * If not, see . */ -#ifndef REMOTE_H__ -#define REMOTE_H__ +#ifndef INPUT_REMOTE_H__ +#define INPUT_REMOTE_H__ #ifdef HAVE_CONFIG_H #include "config.h" @@ -28,18 +28,21 @@ extern "C" { #endif -typedef struct rarch_remote rarch_remote_t; +typedef struct input_remote input_remote_t; -rarch_remote_t *rarch_remote_new(uint16_t port); +input_remote_t *input_remote_new(uint16_t port); -void rarch_remote_free(rarch_remote_t *handle); +void input_remote_free(input_remote_t *handle); -void rarch_remote_poll(rarch_remote_t *handle); +void input_remote_poll(input_remote_t *handle); bool input_remote_key_pressed(int key, unsigned port); -void input_state_remote(int16_t *ret, - unsigned port, unsigned device, unsigned idx, +void input_remote_state( + int16_t *ret, + unsigned port, + unsigned device, + unsigned idx, unsigned id); #ifdef __cplusplus