Create dir_get_size

This commit is contained in:
twinaphex 2016-10-03 08:07:52 +02:00
parent 6d821ad6a4
commit 849ce80c50
3 changed files with 23 additions and 28 deletions

35
dirs.c
View File

@ -197,24 +197,27 @@ bool dir_is_empty(enum rarch_dir_type type)
/* get size functions */
size_t dir_get_system_size(void)
size_t dir_get_size(enum rarch_dir_type type)
{
return sizeof(dir_system);
}
switch (type)
{
case RARCH_DIR_SYSTEM:
return sizeof(dir_system);
case RARCH_DIR_SAVESTATE:
return sizeof(dir_savestate);
case RARCH_DIR_CURRENT_SAVESTATE:
return sizeof(current_savestate_dir);
case RARCH_DIR_SAVEFILE:
return sizeof(dir_savefile);
case RARCH_DIR_CURRENT_SAVEFILE:
return sizeof(current_savefile_dir);
case RARCH_DIR_OSK_OVERLAY:
return sizeof(dir_osk_overlay);
case RARCH_DIR_NONE:
break;
}
size_t dir_get_savestate_size(void)
{
return sizeof(dir_savestate);
}
size_t dir_get_savefile_size(void)
{
return sizeof(dir_savefile);
}
size_t dir_get_osk_overlay_size(void)
{
return sizeof(dir_osk_overlay);
return 0;
}
/* clear functions */

10
dirs.h
View File

@ -54,15 +54,7 @@ void dir_clear(enum rarch_dir_type type);
void dir_clear_all(void);
/* get size functions */
size_t dir_get_osk_overlay_size(void);
size_t dir_get_system_size(void);
size_t dir_get_savestate_size(void);
size_t dir_get_savefile_size(void);
size_t dir_get_size(enum rarch_dir_type type);
/* get ptr functions */

View File

@ -6503,7 +6503,7 @@ static bool setting_append_list(
CONFIG_DIR(
list, list_info,
dir_get_osk_overlay_ptr(),
dir_get_osk_overlay_size(),
dir_get_size(RARCH_DIR_OSK_OVERLAY),
msg_hash_to_str(MENU_ENUM_LABEL_OSK_OVERLAY_DIRECTORY),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OSK_OVERLAY_DIRECTORY),
g_defaults.dir.osk_overlay,
@ -6579,7 +6579,7 @@ static bool setting_append_list(
CONFIG_DIR(
list, list_info,
dir_get_savefile_ptr(),
dir_get_savefile_size(),
dir_get_size(RARCH_DIR_SAVEFILE),
msg_hash_to_str(MENU_ENUM_LABEL_SAVEFILE_DIRECTORY),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SAVEFILE_DIRECTORY),
"",
@ -6594,7 +6594,7 @@ static bool setting_append_list(
CONFIG_DIR(
list, list_info,
dir_get_savestate_ptr(),
dir_get_savestate_size(),
dir_get_size(RARCH_DIR_SAVESTATE),
msg_hash_to_str(MENU_ENUM_LABEL_SAVESTATE_DIRECTORY),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SAVESTATE_DIRECTORY),
"",