Move some code from driver.c to input_context.c

This commit is contained in:
twinaphex 2015-01-12 20:25:07 +01:00
parent 6b3a67d5ea
commit 63281f8ca1
4 changed files with 49 additions and 33 deletions

View File

@ -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.

View File

@ -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

View File

@ -22,7 +22,7 @@
#include <string/string_list.h>
#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:
*

View File

@ -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:
*