Cleanups
This commit is contained in:
parent
0825aa8ae3
commit
0cfeff8e1e
|
@ -840,58 +840,51 @@ static bool event_save_core_config(void)
|
||||||
/**
|
/**
|
||||||
* event_save_state
|
* event_save_state
|
||||||
* @path : Path to state.
|
* @path : Path to state.
|
||||||
* @msg : Message.
|
* @s : Message.
|
||||||
* @sizeof_msg : Size of @msg.
|
* @len : Size of @s.
|
||||||
*
|
*
|
||||||
* Saves a state with path being @path.
|
* Saves a state with path being @path.
|
||||||
**/
|
**/
|
||||||
static void event_save_state(const char *path,
|
static void event_save_state(const char *path,
|
||||||
char *msg, size_t sizeof_msg)
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
if (!save_state(path))
|
if (!save_state(path))
|
||||||
{
|
{
|
||||||
snprintf(msg, sizeof_msg,
|
snprintf(s, len, "Failed to save state to \"%s\".", path);
|
||||||
"Failed to save state to \"%s\".", path);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings->state_slot < 0)
|
if (settings->state_slot < 0)
|
||||||
snprintf(msg, sizeof_msg,
|
snprintf(s, len, "Saved state to slot #-1 (auto).");
|
||||||
"Saved state to slot #-1 (auto).");
|
|
||||||
else
|
else
|
||||||
snprintf(msg, sizeof_msg,
|
snprintf(s, len, "Saved state to slot #%d.", settings->state_slot);
|
||||||
"Saved state to slot #%d.", settings->state_slot);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* event_load_state
|
* event_load_state
|
||||||
* @path : Path to state.
|
* @path : Path to state.
|
||||||
* @msg : Message.
|
* @s : Message.
|
||||||
* @sizeof_msg : Size of @msg.
|
* @len : Size of @s.
|
||||||
*
|
*
|
||||||
* Loads a state with path being @path.
|
* Loads a state with path being @path.
|
||||||
**/
|
**/
|
||||||
static void event_load_state(const char *path,
|
static void event_load_state(const char *path, char *s, size_t len)
|
||||||
char *msg, size_t sizeof_msg)
|
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
if (!load_state(path))
|
if (!load_state(path))
|
||||||
{
|
{
|
||||||
snprintf(msg, sizeof_msg,
|
snprintf(s, len, "Failed to load state from \"%s\".", path);
|
||||||
"Failed to load state from \"%s\".", path);
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings->state_slot < 0)
|
if (settings->state_slot < 0)
|
||||||
snprintf(msg, sizeof_msg,
|
snprintf(s, len, "Loaded state from slot #-1 (auto).");
|
||||||
"Loaded state from slot #-1 (auto).");
|
|
||||||
else
|
else
|
||||||
snprintf(msg, sizeof_msg,
|
snprintf(s, len, "Loaded state from slot #%d.", settings->state_slot);
|
||||||
"Loaded state from slot #%d.", settings->state_slot);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void event_main_state(unsigned cmd)
|
static void event_main_state(unsigned cmd)
|
||||||
|
|
52
driver.c
52
driver.c
|
@ -66,7 +66,7 @@ driver_t *driver_get_ptr(void)
|
||||||
* @i : index of driver.
|
* @i : index of driver.
|
||||||
* @str : identifier name of the found driver
|
* @str : identifier name of the found driver
|
||||||
* gets written to this string.
|
* gets written to this string.
|
||||||
* @sizeof_str : size of @str.
|
* @len : size of @str.
|
||||||
*
|
*
|
||||||
* Find driver based on @label.
|
* Find driver based on @label.
|
||||||
*
|
*
|
||||||
|
@ -74,7 +74,7 @@ driver_t *driver_get_ptr(void)
|
||||||
* pointer to driver.
|
* pointer to driver.
|
||||||
**/
|
**/
|
||||||
static const void *find_driver_nonempty(const char *label, int i,
|
static const void *find_driver_nonempty(const char *label, int i,
|
||||||
char *str, size_t sizeof_str)
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
const void *drv = NULL;
|
const void *drv = NULL;
|
||||||
|
|
||||||
|
@ -82,57 +82,57 @@ static const void *find_driver_nonempty(const char *label, int i,
|
||||||
{
|
{
|
||||||
drv = camera_driver_find_handle(i);
|
drv = camera_driver_find_handle(i);
|
||||||
if (drv)
|
if (drv)
|
||||||
strlcpy(str, camera_driver_find_ident(i), sizeof_str);
|
strlcpy(s, camera_driver_find_ident(i), len);
|
||||||
}
|
}
|
||||||
else if (!strcmp(label, "location_driver"))
|
else if (!strcmp(label, "location_driver"))
|
||||||
{
|
{
|
||||||
drv = location_driver_find_handle(i);
|
drv = location_driver_find_handle(i);
|
||||||
if (drv)
|
if (drv)
|
||||||
strlcpy(str, location_driver_find_ident(i), sizeof_str);
|
strlcpy(s, location_driver_find_ident(i), len);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
else if (!strcmp(label, "menu_driver"))
|
else if (!strcmp(label, "menu_driver"))
|
||||||
{
|
{
|
||||||
drv = menu_driver_find_handle(i);
|
drv = menu_driver_find_handle(i);
|
||||||
if (drv)
|
if (drv)
|
||||||
strlcpy(str, menu_driver_find_ident(i), sizeof_str);
|
strlcpy(s, menu_driver_find_ident(i), len);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (!strcmp(label, "input_driver"))
|
else if (!strcmp(label, "input_driver"))
|
||||||
{
|
{
|
||||||
drv = input_driver_find_handle(i);
|
drv = input_driver_find_handle(i);
|
||||||
if (drv)
|
if (drv)
|
||||||
strlcpy(str, input_driver_find_ident(i), sizeof_str);
|
strlcpy(s, input_driver_find_ident(i), len);
|
||||||
}
|
}
|
||||||
else if (!strcmp(label, "input_joypad_driver"))
|
else if (!strcmp(label, "input_joypad_driver"))
|
||||||
{
|
{
|
||||||
drv = joypad_driver_find_handle(i);
|
drv = joypad_driver_find_handle(i);
|
||||||
if (drv)
|
if (drv)
|
||||||
strlcpy(str, joypad_driver_find_ident(i), sizeof_str);
|
strlcpy(s, joypad_driver_find_ident(i), len);
|
||||||
}
|
}
|
||||||
else if (!strcmp(label, "video_driver"))
|
else if (!strcmp(label, "video_driver"))
|
||||||
{
|
{
|
||||||
drv = video_driver_find_handle(i);
|
drv = video_driver_find_handle(i);
|
||||||
if (drv)
|
if (drv)
|
||||||
strlcpy(str, video_driver_find_ident(i), sizeof_str);
|
strlcpy(s, video_driver_find_ident(i), len);
|
||||||
}
|
}
|
||||||
else if (!strcmp(label, "audio_driver"))
|
else if (!strcmp(label, "audio_driver"))
|
||||||
{
|
{
|
||||||
drv = audio_driver_find_handle(i);
|
drv = audio_driver_find_handle(i);
|
||||||
if (drv)
|
if (drv)
|
||||||
strlcpy(str, audio_driver_find_ident(i), sizeof_str);
|
strlcpy(s, audio_driver_find_ident(i), len);
|
||||||
}
|
}
|
||||||
else if (!strcmp(label, "record_driver"))
|
else if (!strcmp(label, "record_driver"))
|
||||||
{
|
{
|
||||||
drv = record_driver_find_handle(i);
|
drv = record_driver_find_handle(i);
|
||||||
if (drv)
|
if (drv)
|
||||||
strlcpy(str, record_driver_find_ident(i), sizeof_str);
|
strlcpy(s, record_driver_find_ident(i), len);
|
||||||
}
|
}
|
||||||
else if (!strcmp(label, "audio_resampler_driver"))
|
else if (!strcmp(label, "audio_resampler_driver"))
|
||||||
{
|
{
|
||||||
drv = audio_resampler_driver_find_handle(i);
|
drv = audio_resampler_driver_find_handle(i);
|
||||||
if (drv)
|
if (drv)
|
||||||
strlcpy(str, audio_resampler_driver_find_ident(i), sizeof_str);
|
strlcpy(s, audio_resampler_driver_find_ident(i), len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return drv;
|
return drv;
|
||||||
|
@ -168,29 +168,29 @@ int find_driver_index(const char * label, const char *drv)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool find_first_driver(const char *label, char *str, size_t sizeof_str)
|
bool find_first_driver(const char *label, char *s, size_t len)
|
||||||
{
|
{
|
||||||
find_driver_nonempty(label, 0, str, sizeof_str);
|
find_driver_nonempty(label, 0, s, len);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* find_prev_driver:
|
* find_prev_driver:
|
||||||
* @label : string of driver type to be found.
|
* @label : string of driver type to be found.
|
||||||
* @str : identifier of driver to be found.
|
* @s : identifier of driver to be found.
|
||||||
* @sizeof_str : size of @str.
|
* @len : size of @s.
|
||||||
*
|
*
|
||||||
* Find previous driver in driver array.
|
* Find previous driver in driver array.
|
||||||
**/
|
**/
|
||||||
bool find_prev_driver(const char *label, char *str, size_t sizeof_str)
|
bool find_prev_driver(const char *label, char *s, size_t len)
|
||||||
{
|
{
|
||||||
int i = find_driver_index(label, str);
|
int i = find_driver_index(label, s);
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
find_driver_nonempty(label, i - 1, str, sizeof_str);
|
find_driver_nonempty(label, i - 1, s, len);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RARCH_WARN(
|
RARCH_WARN(
|
||||||
"Couldn't find any previous driver (current one: \"%s\").\n", str);
|
"Couldn't find any previous driver (current one: \"%s\").\n", s);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -199,19 +199,19 @@ bool find_prev_driver(const char *label, char *str, size_t sizeof_str)
|
||||||
/**
|
/**
|
||||||
* find_next_driver:
|
* find_next_driver:
|
||||||
* @label : string of driver type to be found.
|
* @label : string of driver type to be found.
|
||||||
* @str : identifier of driver to be found.
|
* @s : identifier of driver to be found.
|
||||||
* @sizeof_str : size of @str.
|
* @len : size of @s.
|
||||||
*
|
*
|
||||||
* Find next driver in driver array.
|
* Find next driver in driver array.
|
||||||
**/
|
**/
|
||||||
bool find_next_driver(const char *label, char *str, size_t sizeof_str)
|
bool find_next_driver(const char *label, char *s, size_t len)
|
||||||
{
|
{
|
||||||
int i = find_driver_index(label, str);
|
int i = find_driver_index(label, s);
|
||||||
if (i >= 0 && (strcmp(str, "null") != 0))
|
if (i >= 0 && (strcmp(s, "null") != 0))
|
||||||
find_driver_nonempty(label, i + 1, str, sizeof_str);
|
find_driver_nonempty(label, i + 1, s, len);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RARCH_WARN("Couldn't find any next driver (current one: \"%s\").\n", str);
|
RARCH_WARN("Couldn't find any next driver (current one: \"%s\").\n", s);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
14
driver.h
14
driver.h
|
@ -330,31 +330,31 @@ void init_drivers_pre(void);
|
||||||
**/
|
**/
|
||||||
void uninit_drivers(int flags);
|
void uninit_drivers(int flags);
|
||||||
|
|
||||||
bool find_first_driver(const char *label, char *str, size_t sizeof_str);
|
bool find_first_driver(const char *label, char *s, size_t len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* find_prev_driver:
|
* find_prev_driver:
|
||||||
* @label : string of driver type to be found.
|
* @label : string of driver type to be found.
|
||||||
* @str : identifier of driver to be found.
|
* @s : identifier of driver to be found.
|
||||||
* @sizeof_str : size of @str.
|
* @len : size of @s.
|
||||||
*
|
*
|
||||||
* Find previous driver in driver array.
|
* Find previous driver in driver array.
|
||||||
*
|
*
|
||||||
* Returns: true (1) if successful, otherwise false (0).
|
* Returns: true (1) if successful, otherwise false (0).
|
||||||
**/
|
**/
|
||||||
bool find_prev_driver(const char *label, char *str, size_t sizeof_str);
|
bool find_prev_driver(const char *label, char *s, size_t len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* find_next_driver:
|
* find_next_driver:
|
||||||
* @label : string of driver type to be found.
|
* @label : string of driver type to be found.
|
||||||
* @str : identifier of driver to be found.
|
* @s : identifier of driver to be found.
|
||||||
* @sizeof_str : size of @str.
|
* @len : size of @.
|
||||||
*
|
*
|
||||||
* Find next driver in driver array.
|
* Find next driver in driver array.
|
||||||
*
|
*
|
||||||
* Returns: true (1) if successful, otherwise false (0).
|
* Returns: true (1) if successful, otherwise false (0).
|
||||||
**/
|
**/
|
||||||
bool find_next_driver(const char *label, char *str, size_t sizeof_str);
|
bool find_next_driver(const char *label, char *s, size_t len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* driver_set_nonblock_state:
|
* driver_set_nonblock_state:
|
||||||
|
|
|
@ -354,9 +354,9 @@ int system_property_get(const char *name, char *value)
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frontend_android_get_name(char *name, size_t sizeof_name)
|
static void frontend_android_get_name(char *s, size_t len)
|
||||||
{
|
{
|
||||||
int len = system_property_get("ro.product.model", name);
|
int len = system_property_get("ro.product.model", s);
|
||||||
(void)len;
|
(void)len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,13 +386,13 @@ static void frontend_android_get_version(int32_t *major, int32_t *minor, int32_t
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frontend_android_get_os(char *name, size_t sizeof_name, int *major, int *minor)
|
static void frontend_android_get_os(char *s, size_t len, int *major, int *minor)
|
||||||
{
|
{
|
||||||
int rel;
|
int rel;
|
||||||
|
|
||||||
frontend_android_get_version(major, minor, &rel);
|
frontend_android_get_version(major, minor, &rel);
|
||||||
|
|
||||||
strlcpy(name, "Android", sizeof_name);
|
strlcpy(s, "Android", len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frontend_android_get_version_sdk(int32_t *sdk)
|
static void frontend_android_get_version_sdk(int32_t *sdk)
|
||||||
|
|
|
@ -131,7 +131,7 @@ static NSSearchPathDomainMask NSConvertDomainFlagsCF(unsigned flags)
|
||||||
|
|
||||||
static void CFSearchPathForDirectoriesInDomains(unsigned flags,
|
static void CFSearchPathForDirectoriesInDomains(unsigned flags,
|
||||||
unsigned domain_mask, unsigned expand_tilde,
|
unsigned domain_mask, unsigned expand_tilde,
|
||||||
char *buf, size_t sizeof_buf)
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
CFTypeRef array_val = (CFTypeRef)CFBridgingRetainCompat(
|
CFTypeRef array_val = (CFTypeRef)CFBridgingRetainCompat(
|
||||||
NSSearchPathForDirectoriesInDomains(NSConvertFlagsCF(flags),
|
NSSearchPathForDirectoriesInDomains(NSConvertFlagsCF(flags),
|
||||||
|
@ -142,19 +142,19 @@ static void CFSearchPathForDirectoriesInDomains(unsigned flags,
|
||||||
if (!path || !array)
|
if (!path || !array)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CFStringGetCString(path, buf, sizeof_buf, kCFStringEncodingUTF8);
|
CFStringGetCString(path, s, len, kCFStringEncodingUTF8);
|
||||||
CFRelease(path);
|
CFRelease(path);
|
||||||
CFRelease(array);
|
CFRelease(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void CFTemporaryDirectory(char *buf, size_t sizeof_buf)
|
static void CFTemporaryDirectory(char *s, size_t len)
|
||||||
{
|
{
|
||||||
#if __has_feature(objc_arc)
|
#if __has_feature(objc_arc)
|
||||||
CFStringRef path = (__bridge_retained CFStringRef)NSTemporaryDirectory();
|
CFStringRef path = (__bridge_retained CFStringRef)NSTemporaryDirectory();
|
||||||
#else
|
#else
|
||||||
CFStringRef path = (CFStringRef)NSTemporaryDirectory();
|
CFStringRef path = (CFStringRef)NSTemporaryDirectory();
|
||||||
#endif
|
#endif
|
||||||
CFStringGetCString(path, buf, sizeof_buf, kCFStringEncodingUTF8);
|
CFStringGetCString(path, s, len, kCFStringEncodingUTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(IOS)
|
#if defined(IOS)
|
||||||
|
@ -266,7 +266,7 @@ static void checkps(CFDictionaryRef dict, bool * have_ac, bool * have_battery,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void frontend_darwin_get_name(char *name, size_t sizeof_name)
|
static void frontend_darwin_get_name(char *s, size_t len)
|
||||||
{
|
{
|
||||||
#if defined(IOS)
|
#if defined(IOS)
|
||||||
struct utsname buffer;
|
struct utsname buffer;
|
||||||
|
@ -274,25 +274,25 @@ static void frontend_darwin_get_name(char *name, size_t sizeof_name)
|
||||||
if (uname(&buffer) != 0)
|
if (uname(&buffer) != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
strlcpy(name, buffer.machine, sizeof_name);
|
strlcpy(s, buffer.machine, len);
|
||||||
#elif defined(OSX)
|
#elif defined(OSX)
|
||||||
size_t length = 0;
|
size_t length = 0;
|
||||||
sysctlbyname("hw.model", name, &length, NULL, 0);
|
sysctlbyname("hw.model", s, &length, NULL, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frontend_darwin_get_os(char *name, size_t sizeof_name, int *major, int *minor)
|
static void frontend_darwin_get_os(char *s, size_t len, int *major, int *minor)
|
||||||
{
|
{
|
||||||
(void)name;
|
(void)s;
|
||||||
(void)sizeof_name;
|
(void)len;
|
||||||
(void)major;
|
(void)major;
|
||||||
(void)minor;
|
(void)minor;
|
||||||
|
|
||||||
#if defined(IOS)
|
#if defined(IOS)
|
||||||
get_ios_version(major, minor);
|
get_ios_version(major, minor);
|
||||||
strlcpy(name, "iOS", sizeof_name);
|
strlcpy(s, "iOS", len);
|
||||||
#elif defined(OSX)
|
#elif defined(OSX)
|
||||||
strlcpy(name, "OSX", sizeof_name);
|
strlcpy(s, "OSX", len);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -314,7 +314,7 @@ static void frontend_gx_init(void *data)
|
||||||
|
|
||||||
static void frontend_gx_exec(const char *path, bool should_load_game);
|
static void frontend_gx_exec(const char *path, bool should_load_game);
|
||||||
|
|
||||||
static void frontend_gx_exitspawn(char *core_path, size_t sizeof_core_path)
|
static void frontend_gx_exitspawn(char *s, size_t len)
|
||||||
{
|
{
|
||||||
bool should_load_game = false;
|
bool should_load_game = false;
|
||||||
#if defined(IS_SALAMANDER)
|
#if defined(IS_SALAMANDER)
|
||||||
|
@ -326,15 +326,15 @@ static void frontend_gx_exitspawn(char *core_path, size_t sizeof_core_path)
|
||||||
if (!exit_spawn)
|
if (!exit_spawn)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
frontend_gx_exec(core_path, should_load_game);
|
frontend_gx_exec(s, should_load_game);
|
||||||
|
|
||||||
/* FIXME/TODO - hack
|
/* FIXME/TODO - hack
|
||||||
* direct loading failed (out of memory), try to jump to Salamander,
|
* direct loading failed (out of memory), try to jump to Salamander,
|
||||||
* then load the correct core */
|
* then load the correct core */
|
||||||
fill_pathname_join(core_path, g_defaults.core_dir,
|
fill_pathname_join(s, g_defaults.core_dir,
|
||||||
"boot.dol", sizeof_core_path);
|
"boot.dol", len);
|
||||||
#endif
|
#endif
|
||||||
frontend_gx_exec(core_path, should_load_game);
|
frontend_gx_exec(s, should_load_game);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frontend_gx_process_args(int *argc, char *argv[])
|
static void frontend_gx_process_args(int *argc, char *argv[])
|
||||||
|
|
|
@ -410,7 +410,7 @@ enum frontend_architecture frontend_linux_get_architecture(void)
|
||||||
return FRONTEND_ARCH_NONE;
|
return FRONTEND_ARCH_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frontend_linux_get_os(char *name, size_t sizeof_name, int *major, int *minor)
|
static void frontend_linux_get_os(char *s, size_t len, int *major, int *minor)
|
||||||
{
|
{
|
||||||
unsigned krel;
|
unsigned krel;
|
||||||
struct utsname buffer;
|
struct utsname buffer;
|
||||||
|
@ -419,7 +419,7 @@ static void frontend_linux_get_os(char *name, size_t sizeof_name, int *major, in
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sscanf(buffer.release, "%u.%u.%u", major, minor, &krel);
|
sscanf(buffer.release, "%u.%u.%u", major, minor, &krel);
|
||||||
strlcpy(name, "Linux", sizeof_name);
|
strlcpy(s, "Linux", len);
|
||||||
}
|
}
|
||||||
|
|
||||||
const frontend_ctx_driver_t frontend_ctx_linux = {
|
const frontend_ctx_driver_t frontend_ctx_linux = {
|
||||||
|
|
|
@ -219,7 +219,7 @@ static void frontend_psp_set_fork(bool exit, bool start_game)
|
||||||
exitspawn_start_game = start_game;
|
exitspawn_start_game = start_game;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frontend_psp_exitspawn(char *core_path, size_t sizeof_core_path)
|
static void frontend_psp_exitspawn(char *s, size_t len)
|
||||||
{
|
{
|
||||||
bool should_load_game = false;
|
bool should_load_game = false;
|
||||||
#ifndef IS_SALAMANDER
|
#ifndef IS_SALAMANDER
|
||||||
|
@ -228,7 +228,7 @@ static void frontend_psp_exitspawn(char *core_path, size_t sizeof_core_path)
|
||||||
if (!exit_spawn)
|
if (!exit_spawn)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
frontend_psp_exec(core_path, should_load_game);
|
frontend_psp_exec(s, should_load_game);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int frontend_psp_get_rating(void)
|
static int frontend_psp_get_rating(void)
|
||||||
|
|
|
@ -97,7 +97,7 @@ static void gfx_set_dwm(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void frontend_win32_get_os(char *name, size_t sizeof_name, int *major, int *minor)
|
static void frontend_win32_get_os(char *s, size_t len, int *major, int *minor)
|
||||||
{
|
{
|
||||||
uint32_t version = GetVersion();
|
uint32_t version = GetVersion();
|
||||||
|
|
||||||
|
@ -110,16 +110,16 @@ static void frontend_win32_get_os(char *name, size_t sizeof_name, int *major, in
|
||||||
switch (*minor)
|
switch (*minor)
|
||||||
{
|
{
|
||||||
case 3:
|
case 3:
|
||||||
strlcpy(name, "Windows 8.1", sizeof_name);
|
strlcpy(s, "Windows 8.1", len);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
strlcpy(name, "Windows 8", sizeof_name);
|
strlcpy(s, "Windows 8", len);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
strlcpy(name, "Windows 7/2008 R2", sizeof_name);
|
strlcpy(s, "Windows 7/2008 R2", len);
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
strlcpy(name, "Windows Vista/2008", sizeof_name);
|
strlcpy(s, "Windows Vista/2008", len);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -129,13 +129,13 @@ static void frontend_win32_get_os(char *name, size_t sizeof_name, int *major, in
|
||||||
switch (*minor)
|
switch (*minor)
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
strlcpy(name, "Windows 2003", sizeof_name);
|
strlcpy(s, "Windows 2003", len);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
strlcpy(name, "Windows XP", sizeof_name);
|
strlcpy(s, "Windows XP", len);
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
strlcpy(name, "Windows 2000", sizeof_name);
|
strlcpy(s, "Windows 2000", len);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -143,13 +143,13 @@ static void frontend_win32_get_os(char *name, size_t sizeof_name, int *major, in
|
||||||
switch (*minor)
|
switch (*minor)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
strlcpy(name, "Windows NT 4.0", sizeof_name);
|
strlcpy(s, "Windows NT 4.0", len);
|
||||||
break;
|
break;
|
||||||
case 90:
|
case 90:
|
||||||
strlcpy(name, "Windows ME", sizeof_name);
|
strlcpy(s, "Windows ME", len);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
strlcpy(name, "Windows 98", sizeof_name);
|
strlcpy(s, "Windows 98", len);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -305,8 +305,7 @@ static void frontend_xdk_set_fork(bool exit, bool start_game)
|
||||||
exitspawn_start_game = start_game;
|
exitspawn_start_game = start_game;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frontend_xdk_exitspawn(char *core_path,
|
static void frontend_xdk_exitspawn(char *s, size_t len)
|
||||||
size_t sizeof_core_path)
|
|
||||||
{
|
{
|
||||||
bool should_load_game = false;
|
bool should_load_game = false;
|
||||||
#ifndef IS_SALAMANDER
|
#ifndef IS_SALAMANDER
|
||||||
|
@ -315,7 +314,7 @@ static void frontend_xdk_exitspawn(char *core_path,
|
||||||
if (!exit_spawn)
|
if (!exit_spawn)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
frontend_xdk_exec(core_path, should_load_game);
|
frontend_xdk_exec(s, should_load_game);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frontend_xdk_exec(const char *path, bool should_load_game)
|
static void frontend_xdk_exec(const char *path, bool should_load_game)
|
||||||
|
|
|
@ -57,7 +57,7 @@ typedef struct frontend_ctx_driver
|
||||||
environment_get_t environment_get;
|
environment_get_t environment_get;
|
||||||
void (*init)(void *data);
|
void (*init)(void *data);
|
||||||
void (*deinit)(void *data);
|
void (*deinit)(void *data);
|
||||||
void (*exitspawn)(char *core_path, size_t sizeof_core_path);
|
void (*exitspawn)(char *s, size_t len);
|
||||||
|
|
||||||
process_args_t process_args;
|
process_args_t process_args;
|
||||||
void (*exec)(const char *, bool);
|
void (*exec)(const char *, bool);
|
||||||
|
|
|
@ -80,7 +80,7 @@ static void find_first_libretro_core(char *first_file,
|
||||||
dir_list_free(list);
|
dir_list_free(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void find_and_set_first_file(char *path, size_t sizeof_path,
|
static void find_and_set_first_file(char *s, size_t len,
|
||||||
const char *ext)
|
const char *ext)
|
||||||
{
|
{
|
||||||
/* Last fallback - we'll need to start the first executable file
|
/* Last fallback - we'll need to start the first executable file
|
||||||
|
@ -93,14 +93,14 @@ static void find_and_set_first_file(char *path, size_t sizeof_path,
|
||||||
|
|
||||||
if (first_file[0] != '\0')
|
if (first_file[0] != '\0')
|
||||||
{
|
{
|
||||||
fill_pathname_join(path, g_defaults.core_dir, first_file, sizeof_path);
|
fill_pathname_join(s, g_defaults.core_dir, first_file, len);
|
||||||
RARCH_LOG("libretro_path now set to: %s.\n", path);
|
RARCH_LOG("libretro_path now set to: %s.\n", s);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
RARCH_ERR("Failed last fallback - RetroArch Salamander will exit.\n");
|
RARCH_ERR("Failed last fallback - RetroArch Salamander will exit.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void salamander_init(char *libretro_path, size_t sizeof_libretro_path)
|
static void salamander_init(char *s, size_t len)
|
||||||
{
|
{
|
||||||
/* normal executable loading path */
|
/* normal executable loading path */
|
||||||
bool config_file_exists = false;
|
bool config_file_exists = false;
|
||||||
|
@ -117,7 +117,7 @@ static void salamander_init(char *libretro_path, size_t sizeof_libretro_path)
|
||||||
{
|
{
|
||||||
config_get_array(conf, "libretro_path", tmp_str, sizeof(tmp_str));
|
config_get_array(conf, "libretro_path", tmp_str, sizeof(tmp_str));
|
||||||
config_file_free(conf);
|
config_file_free(conf);
|
||||||
strlcpy(libretro_path, tmp_str, sizeof_libretro_path);
|
strlcpy(s, tmp_str, len);
|
||||||
}
|
}
|
||||||
#ifdef GEKKO
|
#ifdef GEKKO
|
||||||
else /* stupid libfat bug or something; sometimes it says the file is there when it doesn't */
|
else /* stupid libfat bug or something; sometimes it says the file is there when it doesn't */
|
||||||
|
@ -125,10 +125,10 @@ static void salamander_init(char *libretro_path, size_t sizeof_libretro_path)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config_file_exists || !strcmp(libretro_path, ""))
|
if (!config_file_exists || !strcmp(s, ""))
|
||||||
find_and_set_first_file(libretro_path, sizeof_libretro_path, EXT_EXECUTABLES);
|
find_and_set_first_file(s, len, EXT_EXECUTABLES);
|
||||||
else
|
else
|
||||||
RARCH_LOG("Start [%s] found in retroarch.cfg.\n", libretro_path);
|
RARCH_LOG("Start [%s] found in retroarch.cfg.\n", len);
|
||||||
|
|
||||||
if (!config_file_exists)
|
if (!config_file_exists)
|
||||||
{
|
{
|
||||||
|
@ -136,7 +136,7 @@ static void salamander_init(char *libretro_path, size_t sizeof_libretro_path)
|
||||||
|
|
||||||
if (conf)
|
if (conf)
|
||||||
{
|
{
|
||||||
config_set_string(conf, "libretro_path", libretro_path);
|
config_set_string(conf, "libretro_path", len);
|
||||||
config_file_write(conf, g_defaults.config_path);
|
config_file_write(conf, g_defaults.config_path);
|
||||||
config_file_free(conf);
|
config_file_free(conf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -425,12 +425,12 @@ static int system_property_get_density(char *value)
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dpi_get_density(char *name, size_t sizeof_name)
|
static void dpi_get_density(char *s, size_t len)
|
||||||
{
|
{
|
||||||
system_property_get("ro.sf.lcd_density", name);
|
system_property_get("ro.sf.lcd_density", s);
|
||||||
|
|
||||||
if (name[0] == '\0')
|
if (s[0] == '\0')
|
||||||
system_property_get_density(name);
|
system_property_get_density(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool android_gfx_ctx_get_metrics(void *data,
|
static bool android_gfx_ctx_get_metrics(void *data,
|
||||||
|
|
|
@ -238,18 +238,18 @@ static void rmenu_set_texture(void)
|
||||||
menu_texture_inited = true;
|
menu_texture_inited = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rmenu_wallpaper_set_defaults(char *menu_bg, size_t sizeof_menu_bg)
|
static void rmenu_wallpaper_set_defaults(char *s, size_t len)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
fill_pathname_join(menu_bg, settings->assets_directory,
|
fill_pathname_join(s, settings->assets_directory,
|
||||||
"rmenu", sizeof_menu_bg);
|
"rmenu", len);
|
||||||
#ifdef _XBOX1
|
#ifdef _XBOX1
|
||||||
fill_pathname_join(menu_bg, menu_bg, "sd", sizeof_menu_bg);
|
fill_pathname_join(s, s, "sd", len);
|
||||||
#else
|
#else
|
||||||
fill_pathname_join(menu_bg, menu_bg, "hd", sizeof_menu_bg);
|
fill_pathname_join(s, s, "hd", len);
|
||||||
#endif
|
#endif
|
||||||
fill_pathname_join(menu_bg, menu_bg, "main_menu.png", sizeof_menu_bg);
|
fill_pathname_join(s, s, "main_menu.png", len);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rmenu_context_reset(void)
|
static void rmenu_context_reset(void)
|
||||||
|
|
|
@ -27,16 +27,16 @@ static INLINE void replace_chars(char *str, char c1, char c2)
|
||||||
*pos = c2;
|
*pos = c2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static INLINE void sanitize_to_string(char *title, const char *label, size_t sizeof_title)
|
static INLINE void sanitize_to_string(char *s, const char *label, size_t len)
|
||||||
{
|
{
|
||||||
char new_label[PATH_MAX_LENGTH];
|
char new_label[PATH_MAX_LENGTH];
|
||||||
strlcpy(new_label, label, sizeof(new_label));
|
strlcpy(new_label, label, sizeof(new_label));
|
||||||
strlcpy(title, string_to_upper(new_label), sizeof_title);
|
strlcpy(s, string_to_upper(new_label), len);
|
||||||
replace_chars(title, '_', ' ');
|
replace_chars(s, '_', ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
static int action_get_title_default(const char *path, const char *label,
|
static int action_get_title_default(const char *path, const char *label,
|
||||||
unsigned menu_type, char *title, size_t sizeof_title)
|
unsigned menu_type, char *s, size_t len)
|
||||||
{
|
{
|
||||||
char elem0[PATH_MAX_LENGTH], elem1[PATH_MAX_LENGTH];
|
char elem0[PATH_MAX_LENGTH], elem1[PATH_MAX_LENGTH];
|
||||||
char elem0_path[PATH_MAX_LENGTH], elem1_path[PATH_MAX_LENGTH];
|
char elem0_path[PATH_MAX_LENGTH], elem1_path[PATH_MAX_LENGTH];
|
||||||
|
@ -71,62 +71,62 @@ static int action_get_title_default(const char *path, const char *label,
|
||||||
RARCH_LOG("label %s, elem0 %s, elem1 %s\n", label, elem0, elem1);
|
RARCH_LOG("label %s, elem0 %s, elem1 %s\n", label, elem0, elem1);
|
||||||
#endif
|
#endif
|
||||||
if (!strcmp(label, "deferred_database_manager_list"))
|
if (!strcmp(label, "deferred_database_manager_list"))
|
||||||
snprintf(title, sizeof_title, "DATABASE SELECTION - %s", (elem0_path[0] != '\0') ? path_basename(elem0_path) : "");
|
snprintf(s, len, "DATABASE SELECTION - %s", (elem0_path[0] != '\0') ? path_basename(elem0_path) : "");
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list"))
|
else if (!strcmp(label, "deferred_cursor_manager_list"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST - %s", (elem0_path[0] != '\0') ? path_basename(elem0_path) : "");
|
snprintf(s, len, "DATABASE CURSOR LIST - %s", (elem0_path[0] != '\0') ? path_basename(elem0_path) : "");
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_developer"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_developer"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: DEVELOPER - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: DEVELOPER - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_publisher"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_publisher"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: PUBLISHER - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: PUBLISHER - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_origin"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_origin"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: ORIGIN - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: ORIGIN - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_franchise"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_franchise"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: FRANCHISE - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: FRANCHISE - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_edge_magazine_rating"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_edge_magazine_rating"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: EDGE MAGAZINE RATING - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: EDGE MAGAZINE RATING - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_edge_magazine_issue"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_edge_magazine_issue"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: EDGE MAGAZINE ISSUE - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: EDGE MAGAZINE ISSUE - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_releasemonth"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_releasemonth"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: RELEASEDATE BY MONTH - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: RELEASEDATE BY MONTH - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_releaseyear"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_releaseyear"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: RELEASEDATE BY YEAR - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: RELEASEDATE BY YEAR - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_esrb_rating"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_esrb_rating"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: ESRB RATING - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: ESRB RATING - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_elspa_rating"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_elspa_rating"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: ELSPA RATING - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: ELSPA RATING - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_pegi_rating"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_pegi_rating"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: PEGI RATING - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: PEGI RATING - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_cero_rating"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_cero_rating"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: CERO RATING - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: CERO RATING - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_bbfc_rating"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_bbfc_rating"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: BBFC RATING - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: BBFC RATING - %s)", elem0_path);
|
||||||
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_max_users"))
|
else if (!strcmp(label, "deferred_cursor_manager_list_rdb_entry_max_users"))
|
||||||
snprintf(title, sizeof_title, "DATABASE CURSOR LIST (FILTER: MAX USERS - %s)", elem0_path);
|
snprintf(s, len, "DATABASE CURSOR LIST (FILTER: MAX USERS - %s)", elem0_path);
|
||||||
else if (!strcmp(elem0, "deferred_rdb_entry_detail"))
|
else if (!strcmp(elem0, "deferred_rdb_entry_detail"))
|
||||||
snprintf(title, sizeof_title, "DATABASE INFO: %s", elem1);
|
snprintf(s, len, "DATABASE INFO: %s", elem1);
|
||||||
else if (!strcmp(label, "deferred_core_list"))
|
else if (!strcmp(label, "deferred_core_list"))
|
||||||
snprintf(title, sizeof_title, "DETECTED CORES %s", path);
|
snprintf(s, len, "DETECTED CORES %s", path);
|
||||||
else if (!strcmp(label, "configurations"))
|
else if (!strcmp(label, "configurations"))
|
||||||
snprintf(title, sizeof_title, "CONFIG %s", path);
|
snprintf(s, len, "CONFIG %s", path);
|
||||||
else if (!strcmp(label, "disk_image_append"))
|
else if (!strcmp(label, "disk_image_append"))
|
||||||
snprintf(title, sizeof_title, "DISK APPEND %s", path);
|
snprintf(s, len, "DISK APPEND %s", path);
|
||||||
else if (menu_entries_common_is_settings_entry(elem0))
|
else if (menu_entries_common_is_settings_entry(elem0))
|
||||||
{
|
{
|
||||||
strlcpy(title, string_to_upper(elem0), sizeof_title);
|
strlcpy(s, string_to_upper(elem0), len);
|
||||||
if (elem1[0] != '\0')
|
if (elem1[0] != '\0')
|
||||||
{
|
{
|
||||||
strlcat(title, " - ", sizeof_title);
|
strlcat(s, " - ", len);
|
||||||
strlcat(title, string_to_upper(elem1), sizeof_title);
|
strlcat(s, string_to_upper(elem1), len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (menu_type == MENU_SETTINGS_CUSTOM_BIND ||
|
else if (menu_type == MENU_SETTINGS_CUSTOM_BIND ||
|
||||||
menu_type == MENU_SETTINGS_CUSTOM_BIND_KEYBOARD)
|
menu_type == MENU_SETTINGS_CUSTOM_BIND_KEYBOARD)
|
||||||
{
|
{
|
||||||
strlcpy(title, "INPUT SETTINGS", sizeof_title);
|
strlcpy(s, "INPUT SETTINGS", len);
|
||||||
if (elem1[0] != '\0')
|
if (elem1[0] != '\0')
|
||||||
{
|
{
|
||||||
strlcat(title, " - ", sizeof_title);
|
strlcat(s, " - ", len);
|
||||||
strlcat(title, string_to_upper(elem1), sizeof_title);
|
strlcat(s, string_to_upper(elem1), len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
|
@ -154,69 +154,69 @@ static int action_get_title_default(const char *path, const char *label,
|
||||||
|| (!strcmp(label, "deferred_core_updater_list"))
|
|| (!strcmp(label, "deferred_core_updater_list"))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
sanitize_to_string(title, label, sizeof_title);
|
sanitize_to_string(s, label, len);
|
||||||
}
|
}
|
||||||
else if (!strcmp(label, "video_shader_pass"))
|
else if (!strcmp(label, "video_shader_pass"))
|
||||||
snprintf(title, sizeof_title, "SHADER %s", path);
|
snprintf(s, len, "SHADER %s", path);
|
||||||
else if (!strcmp(label, "video_shader_preset"))
|
else if (!strcmp(label, "video_shader_preset"))
|
||||||
snprintf(title, sizeof_title, "SHADER PRESET %s", path);
|
snprintf(s, len, "SHADER PRESET %s", path);
|
||||||
else if (!strcmp(label, "cheat_file_load"))
|
else if (!strcmp(label, "cheat_file_load"))
|
||||||
snprintf(title, sizeof_title, "CHEAT FILE %s", path);
|
snprintf(s, len, "CHEAT FILE %s", path);
|
||||||
else if (!strcmp(label, "remap_file_load"))
|
else if (!strcmp(label, "remap_file_load"))
|
||||||
snprintf(title, sizeof_title, "REMAP FILE %s", path);
|
snprintf(s, len, "REMAP FILE %s", path);
|
||||||
else if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT ||
|
else if (menu_type == MENU_SETTINGS_CUSTOM_VIEWPORT ||
|
||||||
!strcmp(label, "custom_viewport_2") ||
|
!strcmp(label, "custom_viewport_2") ||
|
||||||
!strcmp(label, "help") ||
|
!strcmp(label, "help") ||
|
||||||
menu_type == MENU_SETTINGS)
|
menu_type == MENU_SETTINGS)
|
||||||
snprintf(title, sizeof_title, "MENU %s", path);
|
snprintf(s, len, "MENU %s", path);
|
||||||
else if (!strcmp(label, "input_overlay"))
|
else if (!strcmp(label, "input_overlay"))
|
||||||
snprintf(title, sizeof_title, "OVERLAY %s", path);
|
snprintf(s, len, "OVERLAY %s", path);
|
||||||
else if (!strcmp(label, "video_font_path"))
|
else if (!strcmp(label, "video_font_path"))
|
||||||
snprintf(title, sizeof_title, "FONT %s", path);
|
snprintf(s, len, "FONT %s", path);
|
||||||
else if (!strcmp(label, "video_filter"))
|
else if (!strcmp(label, "video_filter"))
|
||||||
snprintf(title, sizeof_title, "FILTER %s", path);
|
snprintf(s, len, "FILTER %s", path);
|
||||||
else if (!strcmp(label, "audio_dsp_plugin"))
|
else if (!strcmp(label, "audio_dsp_plugin"))
|
||||||
snprintf(title, sizeof_title, "DSP FILTER %s", path);
|
snprintf(s, len, "DSP FILTER %s", path);
|
||||||
else if (!strcmp(label, "rgui_browser_directory"))
|
else if (!strcmp(label, "rgui_browser_directory"))
|
||||||
snprintf(title, sizeof_title, "BROWSER DIR %s", path);
|
snprintf(s, len, "BROWSER DIR %s", path);
|
||||||
else if (!strcmp(label, "playlist_directory"))
|
else if (!strcmp(label, "playlist_directory"))
|
||||||
snprintf(title, sizeof_title, "PLAYLIST DIR %s", path);
|
snprintf(s, len, "PLAYLIST DIR %s", path);
|
||||||
else if (!strcmp(label, "content_directory"))
|
else if (!strcmp(label, "content_directory"))
|
||||||
snprintf(title, sizeof_title, "CONTENT DIR %s", path);
|
snprintf(s, len, "CONTENT DIR %s", path);
|
||||||
else if (!strcmp(label, "screenshot_directory"))
|
else if (!strcmp(label, "screenshot_directory"))
|
||||||
snprintf(title, sizeof_title, "SCREENSHOT DIR %s", path);
|
snprintf(s, len, "SCREENSHOT DIR %s", path);
|
||||||
else if (!strcmp(label, "video_shader_dir"))
|
else if (!strcmp(label, "video_shader_dir"))
|
||||||
snprintf(title, sizeof_title, "SHADER DIR %s", path);
|
snprintf(s, len, "SHADER DIR %s", path);
|
||||||
else if (!strcmp(label, "video_filter_dir"))
|
else if (!strcmp(label, "video_filter_dir"))
|
||||||
snprintf(title, sizeof_title, "FILTER DIR %s", path);
|
snprintf(s, len, "FILTER DIR %s", path);
|
||||||
else if (!strcmp(label, "audio_filter_dir"))
|
else if (!strcmp(label, "audio_filter_dir"))
|
||||||
snprintf(title, sizeof_title, "DSP FILTER DIR %s", path);
|
snprintf(s, len, "DSP FILTER DIR %s", path);
|
||||||
else if (!strcmp(label, "savestate_directory"))
|
else if (!strcmp(label, "savestate_directory"))
|
||||||
snprintf(title, sizeof_title, "SAVESTATE DIR %s", path);
|
snprintf(s, len, "SAVESTATE DIR %s", path);
|
||||||
else if (!strcmp(label, "libretro_dir_path"))
|
else if (!strcmp(label, "libretro_dir_path"))
|
||||||
snprintf(title, sizeof_title, "LIBRETRO DIR %s", path);
|
snprintf(s, len, "LIBRETRO DIR %s", path);
|
||||||
else if (!strcmp(label, "libretro_info_path"))
|
else if (!strcmp(label, "libretro_info_path"))
|
||||||
snprintf(title, sizeof_title, "LIBRETRO INFO DIR %s", path);
|
snprintf(s, len, "LIBRETRO INFO DIR %s", path);
|
||||||
else if (!strcmp(label, "rgui_config_directory"))
|
else if (!strcmp(label, "rgui_config_directory"))
|
||||||
snprintf(title, sizeof_title, "CONFIG DIR %s", path);
|
snprintf(s, len, "CONFIG DIR %s", path);
|
||||||
else if (!strcmp(label, "savefile_directory"))
|
else if (!strcmp(label, "savefile_directory"))
|
||||||
snprintf(title, sizeof_title, "SAVEFILE DIR %s", path);
|
snprintf(s, len, "SAVEFILE DIR %s", path);
|
||||||
else if (!strcmp(label, "overlay_directory"))
|
else if (!strcmp(label, "overlay_directory"))
|
||||||
snprintf(title, sizeof_title, "OVERLAY DIR %s", path);
|
snprintf(s, len, "OVERLAY DIR %s", path);
|
||||||
else if (!strcmp(label, "system_directory"))
|
else if (!strcmp(label, "system_directory"))
|
||||||
snprintf(title, sizeof_title, "SYSTEM DIR %s", path);
|
snprintf(s, len, "SYSTEM DIR %s", path);
|
||||||
else if (!strcmp(label, "assets_directory"))
|
else if (!strcmp(label, "assets_directory"))
|
||||||
snprintf(title, sizeof_title, "ASSETS DIR %s", path);
|
snprintf(s, len, "ASSETS DIR %s", path);
|
||||||
else if (!strcmp(label, "extraction_directory"))
|
else if (!strcmp(label, "extraction_directory"))
|
||||||
snprintf(title, sizeof_title, "EXTRACTION DIR %s", path);
|
snprintf(s, len, "EXTRACTION DIR %s", path);
|
||||||
else if (!strcmp(label, "joypad_autoconfig_dir"))
|
else if (!strcmp(label, "joypad_autoconfig_dir"))
|
||||||
snprintf(title, sizeof_title, "AUTOCONFIG DIR %s", path);
|
snprintf(s, len, "AUTOCONFIG DIR %s", path);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
|
|
||||||
if (driver->menu->defer_core)
|
if (driver->menu->defer_core)
|
||||||
snprintf(title, sizeof_title, "CONTENT %s", path);
|
snprintf(s, len, "CONTENT %s", path);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
@ -226,7 +226,7 @@ static int action_get_title_default(const char *path, const char *label,
|
||||||
core_name = global->system.info.library_name;
|
core_name = global->system.info.library_name;
|
||||||
if (!core_name)
|
if (!core_name)
|
||||||
core_name = "No Core";
|
core_name = "No Core";
|
||||||
snprintf(title, sizeof_title, "CONTENT (%s) %s", core_name, path);
|
snprintf(s, len, "CONTENT (%s) %s", core_name, path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ typedef struct menu_file_list_cbs
|
||||||
int (*action_select)(const char *path, const char *label, unsigned type,
|
int (*action_select)(const char *path, const char *label, unsigned type,
|
||||||
size_t idx);
|
size_t idx);
|
||||||
int (*action_get_title)(const char *path, const char *label,
|
int (*action_get_title)(const char *path, const char *label,
|
||||||
unsigned type, char *title, size_t sizeof_title);
|
unsigned type, char *s, size_t len);
|
||||||
int (*action_ok)(const char *path, const char *label, unsigned type,
|
int (*action_ok)(const char *path, const char *label, unsigned type,
|
||||||
size_t idx);
|
size_t idx);
|
||||||
int (*action_cancel)(const char *path, const char *label, unsigned type,
|
int (*action_cancel)(const char *path, const char *label, unsigned type,
|
||||||
|
|
18
retroarch.c
18
retroarch.c
|
@ -1361,19 +1361,19 @@ void rarch_playlist_load_content(void *data, unsigned idx)
|
||||||
* @dir : Directory. Gets joined with @path.
|
* @dir : Directory. Gets joined with @path.
|
||||||
* @path : Path. Gets joined with @dir.
|
* @path : Path. Gets joined with @dir.
|
||||||
* @menu_label : Label identifier of menu setting.
|
* @menu_label : Label identifier of menu setting.
|
||||||
* @deferred_path : Deferred core path. Will be filled in
|
* @s : Deferred core path. Will be filled in
|
||||||
* by function.
|
* by function.
|
||||||
* @sizeof_deferred_path : Size of @deferred_path.
|
* @len : Size of @s.
|
||||||
*
|
*
|
||||||
* Gets deferred core.
|
* Gets deferred core.
|
||||||
*
|
*
|
||||||
* Returns: 0 if there are multiple deferred cores and a
|
* Returns: 0 if there are multiple deferred cores and a
|
||||||
* selection needs to be made from a list, otherwise
|
* selection needs to be made from a list, otherwise
|
||||||
* returns -1 and fills in @deferred_path with path to core.
|
* returns -1 and fills in @s with path to core.
|
||||||
**/
|
**/
|
||||||
int rarch_defer_core(core_info_list_t *core_info, const char *dir,
|
int rarch_defer_core(core_info_list_t *core_info, const char *dir,
|
||||||
const char *path, const char *menu_label,
|
const char *path, const char *menu_label,
|
||||||
char *deferred_path, size_t sizeof_deferred_path)
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
char new_core_path[PATH_MAX_LENGTH];
|
char new_core_path[PATH_MAX_LENGTH];
|
||||||
const core_info_t *info = NULL;
|
const core_info_t *info = NULL;
|
||||||
|
@ -1381,20 +1381,20 @@ int rarch_defer_core(core_info_list_t *core_info, const char *dir,
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
fill_pathname_join(deferred_path, dir, path, sizeof_deferred_path);
|
fill_pathname_join(s, dir, path, len);
|
||||||
|
|
||||||
#ifdef HAVE_COMPRESSION
|
#ifdef HAVE_COMPRESSION
|
||||||
if (path_is_compressed_file(dir))
|
if (path_is_compressed_file(dir))
|
||||||
{
|
{
|
||||||
/* In case of a compressed archive, we have to join with a hash */
|
/* In case of a compressed archive, we have to join with a hash */
|
||||||
/* We are going to write at the position of dir: */
|
/* We are going to write at the position of dir: */
|
||||||
rarch_assert(strlen(dir) < strlen(deferred_path));
|
rarch_assert(strlen(dir) < strlen(s));
|
||||||
deferred_path[strlen(dir)] = '#';
|
s[strlen(dir)] = '#';
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (core_info)
|
if (core_info)
|
||||||
core_info_list_get_supported_cores(core_info, deferred_path, &info,
|
core_info_list_get_supported_cores(core_info, s, &info,
|
||||||
&supported);
|
&supported);
|
||||||
|
|
||||||
if (!strcmp(menu_label, "load_content"))
|
if (!strcmp(menu_label, "load_content"))
|
||||||
|
@ -1415,7 +1415,7 @@ int rarch_defer_core(core_info_list_t *core_info, const char *dir,
|
||||||
if (supported != 1)
|
if (supported != 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
strlcpy(global->fullpath, deferred_path, sizeof(global->fullpath));
|
strlcpy(global->fullpath, s, sizeof(global->fullpath));
|
||||||
|
|
||||||
if (path_file_exists(new_core_path))
|
if (path_file_exists(new_core_path))
|
||||||
strlcpy(settings->libretro, new_core_path,
|
strlcpy(settings->libretro, new_core_path,
|
||||||
|
|
|
@ -131,19 +131,19 @@ void rarch_playlist_load_content(void *data, unsigned index);
|
||||||
* @dir : Directory. Gets joined with @path.
|
* @dir : Directory. Gets joined with @path.
|
||||||
* @path : Path. Gets joined with @dir.
|
* @path : Path. Gets joined with @dir.
|
||||||
* @menu_label : Label identifier of menu setting.
|
* @menu_label : Label identifier of menu setting.
|
||||||
* @deferred_path : Deferred core path. Will be filled in
|
* @s : Deferred core path. Will be filled in
|
||||||
* by function.
|
* by function.
|
||||||
* @sizeof_deferred_path : Size of @deferred_path.
|
* @len : Size of @s.
|
||||||
*
|
*
|
||||||
* Gets deferred core.
|
* Gets deferred core.
|
||||||
*
|
*
|
||||||
* Returns: 0 if there are multiple deferred cores and a
|
* Returns: 0 if there are multiple deferred cores and a
|
||||||
* selection needs to be made from a list, otherwise
|
* selection needs to be made from a list, otherwise
|
||||||
* returns -1 and fills in @deferred_path with path to core.
|
* returns -1 and fills in @s with path to core.
|
||||||
**/
|
**/
|
||||||
int rarch_defer_core(core_info_list_t *data,
|
int rarch_defer_core(core_info_list_t *data,
|
||||||
const char *dir, const char *path, const char *menu_label,
|
const char *dir, const char *path, const char *menu_label,
|
||||||
char *deferred_path, size_t sizeof_deferred_path);
|
char *s, size_t len);
|
||||||
|
|
||||||
void rarch_fill_pathnames(void);
|
void rarch_fill_pathnames(void);
|
||||||
|
|
||||||
|
|
|
@ -369,7 +369,7 @@ void rarch_main_data_msg_queue_push(unsigned type,
|
||||||
msg_queue_push(queue, new_msg, prio, duration);
|
msg_queue_push(queue, new_msg, prio, duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
void data_runloop_osd_msg(const char *msg, size_t sizeof_msg)
|
void data_runloop_osd_msg(const char *msg, size_t len)
|
||||||
{
|
{
|
||||||
strlcpy(data_runloop_msg, msg, sizeof_msg);
|
strlcpy(data_runloop_msg, msg, len);
|
||||||
}
|
}
|
||||||
|
|
371
settings.c
371
settings.c
File diff suppressed because it is too large
Load Diff
16
settings.h
16
settings.h
|
@ -71,13 +71,12 @@ void setting_set_with_string_representation(
|
||||||
/**
|
/**
|
||||||
* setting_get_string_representation:
|
* setting_get_string_representation:
|
||||||
* @setting : pointer to setting
|
* @setting : pointer to setting
|
||||||
* @buf : buffer to write contents of string representation to.
|
* @s : buffer to write contents of string representation to.
|
||||||
* @sizeof_buf : size of the buffer (@buf)
|
* @len : size of the buffer (@s)
|
||||||
*
|
*
|
||||||
* Get a setting value's string representation.
|
* Get a setting value's string representation.
|
||||||
**/
|
**/
|
||||||
void setting_get_string_representation(void *data,
|
void setting_get_string_representation(void *data, char *s, size_t len);
|
||||||
char* buf, size_t sizeof_buf);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setting_action_setting:
|
* setting_action_setting:
|
||||||
|
@ -299,17 +298,16 @@ rarch_setting_t setting_string_setting_options(enum setting_type type,
|
||||||
/**
|
/**
|
||||||
* setting_get_description:
|
* setting_get_description:
|
||||||
* @label : identifier label of setting
|
* @label : identifier label of setting
|
||||||
* @msg : output message
|
* @s : output message
|
||||||
* @sizeof_msg : size of @msg
|
* @len : size of @s
|
||||||
*
|
*
|
||||||
* Writes a 'Help' description message to @msg if there is
|
* Writes a 'Help' description message to @s if there is
|
||||||
* one available based on the identifier label of the setting
|
* one available based on the identifier label of the setting
|
||||||
* (@label).
|
* (@label).
|
||||||
*
|
*
|
||||||
* Returns: 0 (always for now). TODO: make it handle -1 as well.
|
* Returns: 0 (always for now). TODO: make it handle -1 as well.
|
||||||
**/
|
**/
|
||||||
int setting_get_description(const char *label, char *msg,
|
int setting_get_description(const char *label, char *s, size_t len);
|
||||||
size_t msg_sizeof);
|
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -102,7 +102,7 @@ typedef int (*action_start_handler_t )(void *data);
|
||||||
typedef int (*action_iterate_handler_t )(unsigned action);
|
typedef int (*action_iterate_handler_t )(unsigned action);
|
||||||
typedef int (*action_cancel_handler_t )(void *data, unsigned action);
|
typedef int (*action_cancel_handler_t )(void *data, unsigned action);
|
||||||
typedef int (*action_ok_handler_t )(void *data, unsigned action);
|
typedef int (*action_ok_handler_t )(void *data, unsigned action);
|
||||||
typedef void (*get_string_representation_t )(void *data, char *buf, size_t sizeof_buf);
|
typedef void (*get_string_representation_t )(void *data, char *s, size_t len);
|
||||||
|
|
||||||
typedef struct rarch_setting_info
|
typedef struct rarch_setting_info
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,7 +60,7 @@ void rarch_main_data_overlay_iterate(bool is_thread, void *data);
|
||||||
void rarch_main_data_nbio_iterate(bool is_thread,
|
void rarch_main_data_nbio_iterate(bool is_thread,
|
||||||
void *runloop);
|
void *runloop);
|
||||||
|
|
||||||
void data_runloop_osd_msg(const char *msg, size_t sizeof_msg);
|
void data_runloop_osd_msg(const char *s, size_t len);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue