Skip to content

Commit

Permalink
Create dir_get
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Sep 30, 2016
1 parent fa469c4 commit db3738b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 31 deletions.
2 changes: 1 addition & 1 deletion configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -2085,7 +2085,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_osk_overlay(), "default"))
if (string_is_equal(dir_get(RARCH_DIR_OSK_OVERLAY), "default"))
dir_clear(RARCH_DIR_OSK_OVERLAY);
#endif
if (string_is_equal(settings->directory.system, "default"))
Expand Down
32 changes: 16 additions & 16 deletions dirs.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,24 +266,24 @@ char *dir_get_savestate_ptr(void)

/* get functions */

const char *dir_get_osk_overlay(void)
const char *dir_get(enum rarch_dir_type type)
{
return dir_osk_overlay;
}

const char *dir_get_system(void)
{
return dir_system;
}

const char *dir_get_savefile(void)
{
return dir_savefile;
}
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;
}

const char *dir_get_savestate(void)
{
return dir_savestate;
return NULL;
}

/* set functions */
Expand Down
8 changes: 1 addition & 7 deletions dirs.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,7 @@ char *dir_get_osk_overlay_ptr(void);

/* get functions */

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);
const char *dir_get(enum rarch_dir_type type);

/* set functions */

Expand Down
2 changes: 1 addition & 1 deletion dynamic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_system());
dir_get(RARCH_DIR_SYSTEM));
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions paths.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_savefile();
const char *old_savestate_dir = dir_get_savestate();
const char *old_savefile_dir = dir_get(RARCH_DIR_SAVEFILE);
const char *old_savestate_dir = dir_get(RARCH_DIR_SAVESTATE);

runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info);

Expand Down Expand Up @@ -360,11 +360,11 @@ static bool path_init_subsystem(void)

snprintf(ext, sizeof(ext), ".%s", mem->extension);

if (path_is_directory(dir_get_savefile()))
if (path_is_directory(dir_get(RARCH_DIR_SAVEFILE)))
{
/* Use SRAM dir */
/* Redirect content fullpath to save directory. */
strlcpy(path, dir_get_savefile(), sizeof(path));
strlcpy(path, dir_get(RARCH_DIR_SAVEFILE), sizeof(path));
fill_pathname_dir(path,
subsystem_fullpaths->elems[i].data, ext,
sizeof(path));
Expand Down
4 changes: 2 additions & 2 deletions tasks/task_content.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_savefile();
wrap_args->sram_path = dir_get(RARCH_DIR_SAVEFILE);
if (!dir_is_empty(RARCH_DIR_SAVESTATE))
wrap_args->state_path = dir_get_savestate();
wrap_args->state_path = dir_get(RARCH_DIR_SAVESTATE);
if (fullpath && *fullpath)
wrap_args->content_path = fullpath;
if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_LIBRETRO))
Expand Down

0 comments on commit db3738b

Please sign in to comment.