Create config append functions
This commit is contained in:
parent
98d325ad67
commit
0254d8714d
36
paths.c
36
paths.c
|
@ -45,6 +45,7 @@
|
||||||
static char current_savefile_dir[PATH_MAX_LENGTH] = {0};
|
static char current_savefile_dir[PATH_MAX_LENGTH] = {0};
|
||||||
static char path_libretro[PATH_MAX_LENGTH] = {0};
|
static char path_libretro[PATH_MAX_LENGTH] = {0};
|
||||||
static char path_config_file[PATH_MAX_LENGTH] = {0};
|
static char path_config_file[PATH_MAX_LENGTH] = {0};
|
||||||
|
static char path_config_append_file[PATH_MAX_LENGTH] = {0};
|
||||||
/* Config file associated with per-core configs. */
|
/* Config file associated with per-core configs. */
|
||||||
static char path_core_options_file[PATH_MAX_LENGTH] = {0};
|
static char path_core_options_file[PATH_MAX_LENGTH] = {0};
|
||||||
|
|
||||||
|
@ -418,6 +419,8 @@ void path_fill_names(void)
|
||||||
sizeof(global->name.ips));
|
sizeof(global->name.ips));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Core file path */
|
||||||
|
|
||||||
char *path_get_core_ptr(void)
|
char *path_get_core_ptr(void)
|
||||||
{
|
{
|
||||||
return path_libretro;
|
return path_libretro;
|
||||||
|
@ -448,6 +451,8 @@ void path_clear_core(void)
|
||||||
*path_libretro = '\0';
|
*path_libretro = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Config file path */
|
||||||
|
|
||||||
bool path_is_config_empty(void)
|
bool path_is_config_empty(void)
|
||||||
{
|
{
|
||||||
if (string_is_empty(path_config_file))
|
if (string_is_empty(path_config_file))
|
||||||
|
@ -474,6 +479,8 @@ void path_clear_config(void)
|
||||||
*path_config_file = '\0';
|
*path_config_file = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Core options file path */
|
||||||
|
|
||||||
bool path_is_core_options_empty(void)
|
bool path_is_core_options_empty(void)
|
||||||
{
|
{
|
||||||
if (string_is_empty(path_core_options_file))
|
if (string_is_empty(path_core_options_file))
|
||||||
|
@ -500,11 +507,40 @@ const char *path_get_core_options(void)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Append config file path */
|
||||||
|
|
||||||
|
bool path_is_config_append_empty(void)
|
||||||
|
{
|
||||||
|
if (string_is_empty(path_config_append_file))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void path_clear_config_append(void)
|
||||||
|
{
|
||||||
|
*path_config_append_file = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
void path_set_config_append(const char *path)
|
||||||
|
{
|
||||||
|
strlcpy(path_config_append_file, path, sizeof(path_config_append_file));
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *path_get_config_append(void)
|
||||||
|
{
|
||||||
|
if (!path_is_config_append_empty())
|
||||||
|
return path_config_append_file;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void path_clear_all(void)
|
void path_clear_all(void)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
path_clear_config();
|
path_clear_config();
|
||||||
|
path_clear_config_append();
|
||||||
path_clear_core_options();
|
path_clear_core_options();
|
||||||
|
|
||||||
if (global)
|
if (global)
|
||||||
|
|
8
paths.h
8
paths.h
|
@ -39,6 +39,8 @@ void path_set_core_options(const char *path);
|
||||||
|
|
||||||
void path_set_config(const char *path);
|
void path_set_config(const char *path);
|
||||||
|
|
||||||
|
void path_set_config_append(const char *path);
|
||||||
|
|
||||||
char *path_get_core_ptr(void);
|
char *path_get_core_ptr(void);
|
||||||
|
|
||||||
const char *path_get_current_savefile_dir(void);
|
const char *path_get_current_savefile_dir(void);
|
||||||
|
@ -49,6 +51,8 @@ const char *path_get_core_options(void);
|
||||||
|
|
||||||
const char *path_get_config(void);
|
const char *path_get_config(void);
|
||||||
|
|
||||||
|
const char *path_get_config_append(void);
|
||||||
|
|
||||||
size_t path_get_core_size(void);
|
size_t path_get_core_size(void);
|
||||||
|
|
||||||
bool path_is_core_empty(void);
|
bool path_is_core_empty(void);
|
||||||
|
@ -57,12 +61,16 @@ bool path_is_config_empty(void);
|
||||||
|
|
||||||
bool path_is_core_options_empty(void);
|
bool path_is_core_options_empty(void);
|
||||||
|
|
||||||
|
bool path_is_config_append_empty(void);
|
||||||
|
|
||||||
void path_clear_core(void);
|
void path_clear_core(void);
|
||||||
|
|
||||||
void path_clear_config(void);
|
void path_clear_config(void);
|
||||||
|
|
||||||
void path_clear_core_options(void);
|
void path_clear_core_options(void);
|
||||||
|
|
||||||
|
void path_clear_config_append(void);
|
||||||
|
|
||||||
void path_clear_all(void);
|
void path_clear_all(void);
|
||||||
|
|
||||||
enum rarch_content_type path_is_media_type(const char *path);
|
enum rarch_content_type path_is_media_type(const char *path);
|
||||||
|
|
Loading…
Reference in New Issue