Add core options path accessors

This commit is contained in:
twinaphex 2016-09-17 13:37:37 +02:00
parent 075599e818
commit b51aca2fa5
2 changed files with 61 additions and 15 deletions

38
paths.c
View File

@ -475,6 +475,44 @@ const char *path_get_config(void)
return NULL;
}
bool path_is_core_options_empty(void)
{
global_t *global = global_get_ptr();
if (global && string_is_empty(global->path.core_options_path))
return true;
return false;
}
void path_clear_core_options(void)
{
global_t *global = global_get_ptr();
if (!global)
return;
*global->path.core_options_path = '\0';
}
void path_set_core_options(const char *path)
{
global_t *global = global_get_ptr();
if (!global)
return;
strlcpy(global->path.core_options_path, path, sizeof(global->path.core_options_path));
}
const char *path_get_core_options(void)
{
if (!path_is_core_options_empty())
{
global_t *global = global_get_ptr();
if (global)
return global->path.core_options_path;
}
return NULL;
}
enum rarch_content_type path_is_media_type(const char *path)
{
char ext_lower[PATH_MAX_LENGTH] = {0};

38
paths.h
View File

@ -23,36 +23,44 @@ RETRO_BEGIN_DECLS
void path_init_savefile(void);
void path_set_names(const char *path);
void path_fill_names(void);
void path_set_redirect(void);
void path_set_names(const char *path);
void path_set_special(char **argv, unsigned num_content);
void path_set_basename(const char *path);
const char *path_get_current_savefile_dir(void);
char *path_get_core_ptr(void);
const char *path_get_core(void);
bool path_is_core_empty(void);
size_t path_get_core_size(void);
void path_set_core(const char *path);
void path_clear_core(void);
const char *path_get_config(void);
void path_set_core_options(const char *path);
void path_set_config(const char *path);
char *path_get_core_ptr(void);
const char *path_get_current_savefile_dir(void);
const char *path_get_core(void);
const char *path_get_core_options(void);
const char *path_get_config(void);
size_t path_get_core_size(void);
bool path_is_core_empty(void);
bool path_is_config_empty(void);
bool path_is_core_options_empty(void);
void path_clear_core(void);
void path_clear_core_options(void);
enum rarch_content_type path_is_media_type(const char *path);
RETRO_END_DECLS