Moving function
This commit is contained in:
parent
ca7558cda2
commit
8a4f65e227
24
driver.c
24
driver.c
|
@ -189,6 +189,30 @@ static const input_driver_t *input_drivers[] = {
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// JM: This is a very painful function to write, especially because
|
||||||
|
// we'll have to do it to all the drivers.
|
||||||
|
const char* config_get_input_driver_options(void) {
|
||||||
|
int input_option_k = 0;
|
||||||
|
int input_options_len = 0;
|
||||||
|
while (input_drivers[input_option_k]) {
|
||||||
|
const char *opt = input_drivers[input_option_k]->ident;
|
||||||
|
input_options_len += strlen(opt) + 1;
|
||||||
|
input_option_k++;
|
||||||
|
}
|
||||||
|
uint offset = 0;
|
||||||
|
char *input_options = (char*)calloc(input_options_len, sizeof(char));
|
||||||
|
for (int i = 0; i < input_option_k; i++) {
|
||||||
|
const char *opt = input_drivers[i]->ident;
|
||||||
|
strlcpy(input_options + offset, opt, input_options_len - offset);
|
||||||
|
offset += strlen(opt);
|
||||||
|
input_options[offset] = '|';
|
||||||
|
offset += 1;
|
||||||
|
}
|
||||||
|
input_options[input_options_len] = '\0';
|
||||||
|
|
||||||
|
return input_options;
|
||||||
|
}
|
||||||
|
|
||||||
static const input_osk_driver_t *osk_drivers[] = {
|
static const input_osk_driver_t *osk_drivers[] = {
|
||||||
#ifdef __CELLOS_LV2__
|
#ifdef __CELLOS_LV2__
|
||||||
&input_ps3_osk,
|
&input_ps3_osk,
|
||||||
|
|
2
driver.h
2
driver.h
|
@ -675,6 +675,8 @@ extern input_driver_t input_qnx;
|
||||||
extern input_driver_t input_rwebinput;
|
extern input_driver_t input_rwebinput;
|
||||||
extern input_driver_t input_null;
|
extern input_driver_t input_null;
|
||||||
|
|
||||||
|
const char* config_get_input_driver_options(void);
|
||||||
|
|
||||||
extern camera_driver_t camera_v4l2;
|
extern camera_driver_t camera_v4l2;
|
||||||
extern camera_driver_t camera_android;
|
extern camera_driver_t camera_android;
|
||||||
extern camera_driver_t camera_rwebcam;
|
extern camera_driver_t camera_rwebcam;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "driver.h"
|
||||||
#include "settings_data.h"
|
#include "settings_data.h"
|
||||||
#include "dynamic.h"
|
#include "dynamic.h"
|
||||||
#include <file/file_path.h>
|
#include <file/file_path.h>
|
||||||
|
@ -2883,30 +2884,6 @@ static bool setting_data_append_list_main_menu_options(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// JM: This is a very painful function to write, especially because
|
|
||||||
// we'll have to do it to all the drivers.
|
|
||||||
const char* config_get_input_driver_options(void) {
|
|
||||||
int input_option_k = 0;
|
|
||||||
int input_options_len = 0;
|
|
||||||
while (input_drivers[input_option_k]) {
|
|
||||||
const char *opt = input_drivers[input_option_k]->ident;
|
|
||||||
input_options_len += strlen(opt) + 1;
|
|
||||||
input_option_k++;
|
|
||||||
}
|
|
||||||
uint offset = 0;
|
|
||||||
char *input_options = (char*)calloc(input_options_len, sizeof(char));
|
|
||||||
for (int i = 0; i < input_option_k; i++) {
|
|
||||||
const char *opt = input_drivers[i]->ident;
|
|
||||||
strlcpy(input_options + offset, opt, input_options_len - offset);
|
|
||||||
offset += strlen(opt);
|
|
||||||
input_options[offset] = '|';
|
|
||||||
offset += 1;
|
|
||||||
}
|
|
||||||
input_options[input_options_len] = '\0';
|
|
||||||
|
|
||||||
return input_options;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool setting_data_append_list_driver_options(
|
static bool setting_data_append_list_driver_options(
|
||||||
rarch_setting_t **list,
|
rarch_setting_t **list,
|
||||||
rarch_setting_info_t *list_info)
|
rarch_setting_info_t *list_info)
|
||||||
|
|
Loading…
Reference in New Issue