Turn the find_handle/find_ident functions static

This commit is contained in:
twinaphex 2019-11-17 22:31:57 +01:00
parent f9bc57bcf8
commit cbe68cbf88
4 changed files with 38 additions and 180 deletions

View File

@ -180,24 +180,6 @@ struct rarch_joypad_driver
const char *ident;
};
/**
* input_driver_find_handle:
* @index : index of driver to get handle to.
*
* Returns: handle to input driver at index. Can be NULL
* if nothing found.
**/
const void *input_driver_find_handle(int index);
/**
* input_driver_find_ident:
* @index : index of driver to get handle to.
*
* Returns: Human-readable identifier of input driver at index. Can be NULL
* if nothing found.
**/
const char *input_driver_find_ident(int index);
/**
* config_get_input_driver_options:
*
@ -269,24 +251,6 @@ float *input_driver_get_float(enum input_action action);
unsigned *input_driver_get_uint(enum input_action action);
/**
* 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:
*
@ -462,24 +426,6 @@ bool input_mouse_button_raw(unsigned port, unsigned button);
#include "include/hid_driver.h"
/**
* hid_driver_find_handle:
* @index : index of driver to get handle to.
*
* Returns: handle to HID driver at index. Can be NULL
* if nothing found.
**/
const void *hid_driver_find_handle(int index);
/**
* hid_driver_find_ident:
* @index : index of driver to get handle to.
*
* Returns: Human-readable identifier of HID driver at index. Can be NULL
* if nothing found.
**/
const char *hid_driver_find_ident(int index);
/**
* config_get_hid_driver_options:
*

View File

@ -1007,6 +1007,26 @@ static char current_savefile_dir[PATH_MAX_LENGTH] = {0};
static char current_savestate_dir[PATH_MAX_LENGTH] = {0};
static char dir_savestate[PATH_MAX_LENGTH] = {0};
/* Forward declarations */
static const void *location_driver_find_handle(int idx);
static const char *location_driver_find_ident(int idx);
static const char *audio_driver_find_ident(int idx);
static const void *audio_driver_find_handle(int idx);
static const void *video_driver_find_handle(int idx);
static const char *video_driver_find_ident(int idx);
static const char *record_driver_find_ident(int idx);
static const void *record_driver_find_handle(int idx);
static const void *wifi_driver_find_handle(int idx);
static const char *wifi_driver_find_ident(int idx);
static const char *input_driver_find_ident(int idx);
static const char *camera_driver_find_ident(int idx);
static const char *joypad_driver_find_ident(int idx);
static const void *camera_driver_find_handle(int idx);
static const void *input_driver_find_handle(int idx);
static const void *joypad_driver_find_handle(int idx);
static const char *hid_driver_find_ident(int idx);
static const void *hid_driver_find_handle(int idx);
struct string_list *dir_list_new_special(const char *input_dir,
enum dir_list_type type, const char *filter)
{
@ -10880,7 +10900,7 @@ static void clear_controller_port_map(void)
* Returns: handle to wifi driver at index. Can be NULL
* if nothing found.
**/
const void *wifi_driver_find_handle(int idx)
static const void *wifi_driver_find_handle(int idx)
{
const void *drv = wifi_drivers[idx];
if (!drv)
@ -10895,7 +10915,7 @@ const void *wifi_driver_find_handle(int idx)
* Returns: Human-readable identifier of wifi driver at index. Can be NULL
* if nothing found.
**/
const char *wifi_driver_find_ident(int idx)
static const char *wifi_driver_find_ident(int idx)
{
const wifi_driver_t *drv = wifi_drivers[idx];
if (!drv)
@ -11258,7 +11278,7 @@ void ui_companion_driver_log_msg(const char *msg)
* Returns: Human-readable identifier of record driver at index. Can be NULL
* if nothing found.
**/
const char *record_driver_find_ident(int idx)
static const char *record_driver_find_ident(int idx)
{
const record_driver_t *drv = record_drivers[idx];
if (!drv)
@ -11273,7 +11293,7 @@ const char *record_driver_find_ident(int idx)
* Returns: handle to record driver at index. Can be NULL
* if nothing found.
**/
const void *record_driver_find_handle(int idx)
static const void *record_driver_find_handle(int idx)
{
const void *drv = record_drivers[idx];
if (!drv)
@ -13206,7 +13226,7 @@ void fire_connection_listener(unsigned port, input_device_driver_t *driver)
* Returns: handle to input driver at index. Can be NULL
* if nothing found.
**/
const void *input_driver_find_handle(int idx)
static const void *input_driver_find_handle(int idx)
{
const void *drv = input_drivers[idx];
if (!drv)
@ -13221,7 +13241,7 @@ const void *input_driver_find_handle(int idx)
* Returns: Human-readable identifier of input driver at index. Can be NULL
* if nothing found.
**/
const char *input_driver_find_ident(int idx)
static const char *input_driver_find_ident(int idx)
{
input_driver_t *drv = input_drivers[idx];
if (!drv)
@ -15760,7 +15780,7 @@ bool input_driver_ungrab_mouse(void)
* Returns: handle to joypad driver at index. Can be NULL
* if nothing found.
**/
const void *joypad_driver_find_handle(int idx)
static const void *joypad_driver_find_handle(int idx)
{
const void *drv = joypad_drivers[idx];
if (!drv)
@ -15775,7 +15795,7 @@ const void *joypad_driver_find_handle(int idx)
* Returns: Human-readable identifier of joypad driver at index. Can be NULL
* if nothing found.
**/
const char *joypad_driver_find_ident(int idx)
static const char *joypad_driver_find_ident(int idx)
{
const input_device_driver_t *drv = joypad_drivers[idx];
if (!drv)
@ -16041,7 +16061,7 @@ void input_pad_connect(unsigned port, input_device_driver_t *driver)
* Returns: handle to HID driver at index. Can be NULL
* if nothing found.
**/
const void *hid_driver_find_handle(int idx)
static const void *hid_driver_find_handle(int idx)
{
const void *drv = hid_drivers[idx];
if (!drv)
@ -16070,7 +16090,7 @@ void hid_driver_reset_data(void)
* Returns: Human-readable identifier of HID driver at index. Can be NULL
* if nothing found.
**/
const char *hid_driver_find_ident(int idx)
static const char *hid_driver_find_ident(int idx)
{
const hid_driver_t *drv = hid_drivers[idx];
if (!drv)
@ -18036,7 +18056,7 @@ static void report_audio_buffer_statistics(void)
* Returns: handle to audio driver at index. Can be NULL
* if nothing found.
**/
const void *audio_driver_find_handle(int idx)
static const void *audio_driver_find_handle(int idx)
{
const void *drv = audio_drivers[idx];
if (!drv)
@ -18051,7 +18071,7 @@ const void *audio_driver_find_handle(int idx)
* Returns: Human-readable identifier of audio driver at index. Can be NULL
* if nothing found.
**/
const char *audio_driver_find_ident(int idx)
static const char *audio_driver_find_ident(int idx)
{
const audio_driver_t *drv = audio_drivers[idx];
if (!drv)
@ -19488,7 +19508,7 @@ static bool set_resize_null(void *a, unsigned b, unsigned c)
* Returns: handle to video driver at index. Can be NULL
* if nothing found.
**/
const void *video_driver_find_handle(int idx)
static const void *video_driver_find_handle(int idx)
{
const void *drv = video_drivers[idx];
if (!drv)
@ -19503,7 +19523,7 @@ const void *video_driver_find_handle(int idx)
* Returns: Human-readable identifier of video driver at index. Can be NULL
* if nothing found.
**/
const char *video_driver_find_ident(int idx)
static const char *video_driver_find_ident(int idx)
{
const video_driver_t *drv = video_drivers[idx];
if (!drv)
@ -22218,7 +22238,7 @@ struct string_list* video_driver_get_gpu_api_devices(enum gfx_ctx_api api)
* Returns: handle to location driver at index. Can be NULL
* if nothing found.
**/
const void *location_driver_find_handle(int idx)
static const void *location_driver_find_handle(int idx)
{
const void *drv = location_drivers[idx];
if (!drv)
@ -22233,7 +22253,7 @@ const void *location_driver_find_handle(int idx)
* Returns: Human-readable identifier of location driver at index. Can be NULL
* if nothing found.
**/
const char *location_driver_find_ident(int idx)
static const char *location_driver_find_ident(int idx)
{
const location_driver_t *drv = location_drivers[idx];
if (!drv)
@ -22420,7 +22440,7 @@ static void uninit_location(void)
* Returns: handle to camera driver at index. Can be NULL
* if nothing found.
**/
const void *camera_driver_find_handle(int idx)
static const void *camera_driver_find_handle(int idx)
{
const void *drv = camera_drivers[idx];
if (!drv)
@ -22435,7 +22455,7 @@ const void *camera_driver_find_handle(int idx)
* Returns: Human-readable identifier of camera driver at index. Can be NULL
* if nothing found.
**/
const char *camera_driver_find_ident(int idx)
static const char *camera_driver_find_ident(int idx)
{
const camera_driver_t *drv = camera_drivers[idx];
if (!drv)

View File

@ -517,24 +517,6 @@ bool audio_driver_enable_callback(void);
bool audio_driver_disable_callback(void);
/**
* audio_driver_find_handle:
* @index : index of driver to get handle to.
*
* Returns: handle to audio driver at index. Can be NULL
* if nothing found.
**/
const void *audio_driver_find_handle(int index);
/**
* audio_driver_find_ident:
* @index : index of driver to get handle to.
*
* Returns: Human-readable identifier of audio driver at index. Can be NULL
* if nothing found.
**/
const char *audio_driver_find_ident(int index);
/**
* config_get_audio_driver_options:
*
@ -740,24 +722,6 @@ extern const record_driver_t record_null;
**/
const char* config_get_record_driver_options(void);
/**
* record_driver_find_handle:
* @idx : index of driver to get handle to.
*
* Returns: handle to record driver at index. Can be NULL
* if nothing found.
**/
const void *record_driver_find_handle(int idx);
/**
* record_driver_find_ident:
* @idx : index of driver to get handle to.
*
* Returns: Human-readable identifier of record driver at index. Can be NULL
* if nothing found.
**/
const char *record_driver_find_ident(int idx);
bool recording_is_enabled(void);
void streaming_set_state(bool state);
@ -1625,24 +1589,6 @@ void video_driver_set_video_cache_context_ack(void);
bool video_driver_get_viewport_info(struct video_viewport *viewport);
/**
* video_driver_find_handle:
* @index : index of driver to get handle to.
*
* Returns: handle to video driver at index. Can be NULL
* if nothing found.
**/
const void *video_driver_find_handle(int index);
/**
* video_driver_find_ident:
* @index : index of driver to get handle to.
*
* Returns: Human-readable identifier of video driver at index.
* Can be NULL if nothing found.
**/
const char *video_driver_find_ident(int index);
/**
* config_get_video_driver_options:
*
@ -2023,24 +1969,6 @@ extern location_driver_t location_null;
**/
const char* config_get_location_driver_options(void);
/**
* location_driver_find_handle:
* @index : index of driver to get handle to.
*
* Returns: handle to location driver at index. Can be NULL
* if nothing found.
**/
const void *location_driver_find_handle(int index);
/**
* location_driver_find_ident:
* @index : index of driver to get handle to.
*
* Returns: Human-readable identifier of location driver at index. Can be NULL
* if nothing found.
**/
const char *location_driver_find_ident(int index);
/* Camera */
typedef struct camera_driver
@ -2082,24 +2010,6 @@ extern camera_driver_t camera_null;
**/
const char* config_get_camera_driver_options(void);
/**
* camera_driver_find_handle:
* @index : index of driver to get handle to.
*
* Returns: handle to camera driver at index. Can be NULL
* if nothing found.
**/
const void *camera_driver_find_handle(int index);
/**
* camera_driver_find_ident:
* @index : index of driver to get handle to.
*
* Returns: Human-readable identifier of camera driver at index. Can be NULL
* if nothing found.
**/
const char *camera_driver_find_ident(int index);
bool menu_driver_is_alive(void);
void menu_driver_set_binding_state(bool on);

View File

@ -73,24 +73,6 @@ extern wifi_driver_t wifi_null;
**/
const char* config_get_wifi_driver_options(void);
/**
* wifi_driver_find_handle:
* @index : index of driver to get handle to.
*
* Returns: handle to wifi driver at index. Can be NULL
* if nothing found.
**/
const void *wifi_driver_find_handle(int index);
/**
* wifi_driver_find_ident:
* @index : index of driver to get handle to.
*
* Returns: Human-readable identifier of wifi driver at index. Can be NULL
* if nothing found.
**/
const char *wifi_driver_find_ident(int index);
void driver_wifi_stop(void);
bool driver_wifi_start(void);