From 63281f8ca11ae54d2eedc4b015fd9b68da40b149 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 12 Jan 2015 20:25:07 +0100 Subject: [PATCH] Move some code from driver.c to input_context.c --- driver.c | 30 ------------------------------ driver.h | 2 -- input/input_context.c | 32 +++++++++++++++++++++++++++++++- input/input_context.h | 18 ++++++++++++++++++ 4 files changed, 49 insertions(+), 33 deletions(-) diff --git a/driver.c b/driver.c index f146e04869..b24f63dc24 100644 --- a/driver.c +++ b/driver.c @@ -40,36 +40,6 @@ driver_t driver; -/** - * joypad_driver_find_handle: - * @index : index of driver to get handle to. - * - * Returns: handle to joypad driver at index. Can be NULL - * if nothing found. - **/ -static const void *joypad_driver_find_handle(int index) -{ - const void *drv = joypad_drivers[index]; - if (!drv) - return NULL; - return drv; -} - -/** - * joypad_driver_find_ident: - * @index : index of driver to get handle to. - * - * Returns: Human-readable identifier of joypad driver at index. Can be NULL - * if nothing found. - **/ -static const char *joypad_driver_find_ident(int index) -{ - const rarch_joypad_driver_t *drv = joypad_drivers[index]; - if (!drv) - return NULL; - return drv->ident; -} - /** * find_driver_nonempty: * @label : string of driver type to be found. diff --git a/driver.h b/driver.h index 52450f60c3..c1f34ba5b3 100644 --- a/driver.h +++ b/driver.h @@ -471,8 +471,6 @@ extern driver_t driver; **/ int find_driver_index(const char * label, const char *drv); -extern rarch_joypad_driver_t *joypad_drivers[]; - #ifdef __cplusplus } #endif diff --git a/input/input_context.c b/input/input_context.c index 0729e3051f..08318a359a 100644 --- a/input/input_context.c +++ b/input/input_context.c @@ -22,7 +22,7 @@ #include #include "../general.h" -rarch_joypad_driver_t *joypad_drivers[] = { +static rarch_joypad_driver_t *joypad_drivers[] = { #ifdef __CELLOS_LV2__ &ps3_joypad, #endif @@ -71,6 +71,36 @@ rarch_joypad_driver_t *joypad_drivers[] = { NULL, }; +/** + * joypad_driver_find_handle: + * @index : index of driver to get handle to. + * + * Returns: handle to joypad driver at index. Can be NULL + * if nothing found. + **/ +const void *joypad_driver_find_handle(int index) +{ + const void *drv = joypad_drivers[index]; + if (!drv) + return NULL; + return drv; +} + +/** + * joypad_driver_find_ident: + * @index : index of driver to get handle to. + * + * Returns: Human-readable identifier of joypad driver at index. Can be NULL + * if nothing found. + **/ +const char *joypad_driver_find_ident(int index) +{ + const rarch_joypad_driver_t *drv = joypad_drivers[index]; + if (!drv) + return NULL; + return drv->ident; +} + /** * config_get_joypad_driver_options: * diff --git a/input/input_context.h b/input/input_context.h index d5ceb01216..7d44201eec 100644 --- a/input/input_context.h +++ b/input/input_context.h @@ -59,6 +59,24 @@ extern rarch_joypad_driver_t android_joypad; extern rarch_joypad_driver_t qnx_joypad; extern rarch_joypad_driver_t null_joypad; +/** + * joypad_driver_find_handle: + * @index : index of driver to get handle to. + * + * Returns: handle to joypad driver at index. Can be NULL + * if nothing found. + **/ +const void *joypad_driver_find_handle(int index); + +/** + * joypad_driver_find_ident: + * @index : index of driver to get handle to. + * + * Returns: Human-readable identifier of joypad driver at index. Can be NULL + * if nothing found. + **/ +const char *joypad_driver_find_ident(int index); + /** * config_get_joypad_driver_options: *