Revert "Create dir_get"

This reverts commit db3738babb.
This commit is contained in:
twinaphex 2016-10-01 08:16:13 +02:00
parent 2583390d31
commit 8458a039ca
6 changed files with 31 additions and 25 deletions

View File

@ -2097,7 +2097,7 @@ static bool config_load_file(const char *path, bool set_defaults,
#ifdef HAVE_OVERLAY
if (string_is_equal(settings->directory.overlay, "default"))
*settings->directory.overlay = '\0';
if (string_is_equal(dir_get(RARCH_DIR_OSK_OVERLAY), "default"))
if (string_is_equal(dir_get_osk_overlay(), "default"))
dir_clear(RARCH_DIR_OSK_OVERLAY);
#endif
if (string_is_equal(settings->directory.system, "default"))

32
dirs.c
View File

@ -266,24 +266,24 @@ char *dir_get_savestate_ptr(void)
/* get functions */
const char *dir_get(enum rarch_dir_type type)
const char *dir_get_osk_overlay(void)
{
switch (type)
{
case RARCH_DIR_OSK_OVERLAY:
return dir_osk_overlay;
case RARCH_DIR_SYSTEM:
return dir_system;
case RARCH_DIR_SAVEFILE:
return dir_savefile;
case RARCH_DIR_SAVESTATE:
return dir_savestate;
case RARCH_DIR_NONE:
default:
break;
}
return dir_osk_overlay;
}
return NULL;
const char *dir_get_system(void)
{
return dir_system;
}
const char *dir_get_savefile(void)
{
return dir_savefile;
}
const char *dir_get_savestate(void)
{
return dir_savestate;
}
/* set functions */

8
dirs.h
View File

@ -76,7 +76,13 @@ char *dir_get_osk_overlay_ptr(void);
/* get functions */
const char *dir_get(enum rarch_dir_type type);
const char *dir_get_osk_overlay(void);
const char *dir_get_savefile(void);
const char *dir_get_savestate(void);
const char *dir_get_system(void);
/* set functions */

View File

@ -1039,7 +1039,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
*(const char**)data = dir_get_system_ptr();
RARCH_LOG("Environ SYSTEM_DIRECTORY: \"%s\".\n",
dir_get(RARCH_DIR_SYSTEM));
dir_get_system());
}
else
{

View File

@ -80,8 +80,8 @@ void path_set_redirect(void)
uint32_t library_name_hash = 0;
bool check_library_name_hash = false;
rarch_system_info_t *info = NULL;
const char *old_savefile_dir = dir_get(RARCH_DIR_SAVEFILE);
const char *old_savestate_dir = dir_get(RARCH_DIR_SAVESTATE);
const char *old_savefile_dir = dir_get_savefile();
const char *old_savestate_dir = dir_get_savestate();
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info);
@ -360,11 +360,11 @@ static bool path_init_subsystem(void)
snprintf(ext, sizeof(ext), ".%s", mem->extension);
if (path_is_directory(dir_get(RARCH_DIR_SAVEFILE)))
if (path_is_directory(dir_get_savefile()))
{
/* Use SRAM dir */
/* Redirect content fullpath to save directory. */
strlcpy(path, dir_get(RARCH_DIR_SAVEFILE), sizeof(path));
strlcpy(path, dir_get_savefile(), sizeof(path));
fill_pathname_dir(path,
subsystem_fullpaths->elems[i].data, ext,
sizeof(path));

View File

@ -848,9 +848,9 @@ static void menu_content_environment_get(int *argc, char *argv[],
if (!path_is_empty(RARCH_PATH_CONFIG))
wrap_args->config_path = path_get(RARCH_PATH_CONFIG);
if (!dir_is_empty(RARCH_DIR_SAVEFILE))
wrap_args->sram_path = dir_get(RARCH_DIR_SAVEFILE);
wrap_args->sram_path = dir_get_savefile();
if (!dir_is_empty(RARCH_DIR_SAVESTATE))
wrap_args->state_path = dir_get(RARCH_DIR_SAVESTATE);
wrap_args->state_path = dir_get_savestate();
if (fullpath && *fullpath)
wrap_args->content_path = fullpath;
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_LIBRETRO, NULL))