diff --git a/cheevos/badges.c b/cheevos/badges.c index b51ae3669f..8b41bfd230 100644 --- a/cheevos/badges.c +++ b/cheevos/badges.c @@ -13,43 +13,46 @@ badges_ctx_t badges_ctx; bool badge_exists(const char* filepath) { - if(path_file_exists(filepath)) - return true; - else - return false; + return filestream_exists(filepath); } void set_badge_menu_texture(badges_ctx_t * badges, int i) { - char fullpath[PATH_MAX_LENGTH]; - const char * locked_suffix = (badges->badge_locked[i] == true) ? "_lock.png" : ".png"; + char fullpath[PATH_MAX_LENGTH]; + const char * locked_suffix = (badges->badge_locked[i] == true) + ? "_lock.png" : ".png"; + unsigned int bufferSize = 16; - unsigned int bufferSize = 16; /* TODO/FIXME - variable length forbidden in C89 - rewrite this! */ - char badge_file[bufferSize]; + char badge_file[bufferSize]; - snprintf(badge_file, bufferSize, "%s", badges->badge_id_list[i]); - strcat(badge_file, locked_suffix); + snprintf(badge_file, bufferSize, "%s", badges->badge_id_list[i]); + strcat(badge_file, locked_suffix); - fill_pathname_application_special(fullpath, - PATH_MAX_LENGTH * sizeof(char), - APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES); + fill_pathname_application_special(fullpath, + PATH_MAX_LENGTH * sizeof(char), + APPLICATION_SPECIAL_DIRECTORY_THUMBNAILS_CHEEVOS_BADGES); - menu_display_reset_textures_list(badge_file, fullpath, &badges->menu_texture_list[i],TEXTURE_FILTER_MIPMAP_LINEAR); + menu_display_reset_textures_list(badge_file, fullpath, + &badges->menu_texture_list[i],TEXTURE_FILTER_MIPMAP_LINEAR); } -void set_badge_info (badges_ctx_t *badge_struct, int id, const char *badge_id, bool active) +void set_badge_info (badges_ctx_t *badge_struct, int id, + const char *badge_id, bool active) { - badge_struct->badge_id_list[id] = badge_id; - badge_struct->badge_locked[id] = active; - set_badge_menu_texture(badge_struct, id); + if (!badge_struct) + return; + + badge_struct->badge_id_list[id] = badge_id; + badge_struct->badge_locked[id] = active; + set_badge_menu_texture(badge_struct, id); } -menu_texture_item get_badge_texture (int id) +menu_texture_item get_badge_texture(int id) { - settings_t *settings = config_get_ptr(); - if (!settings->bools.cheevos_badges_enable) - return (menu_texture_item)NULL; + settings_t *settings = config_get_ptr(); + if (!settings->bools.cheevos_badges_enable) + return (menu_texture_item)NULL; - return badges_ctx.menu_texture_list[id]; + return badges_ctx.menu_texture_list[id]; } diff --git a/command.c b/command.c index 7b01a2b0d9..0745ec1d22 100644 --- a/command.c +++ b/command.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #ifdef HAVE_CONFIG_H @@ -1114,7 +1115,7 @@ static void command_event_load_auto_state(void) file_path_str(FILE_PATH_AUTO_EXTENSION), savestate_name_auto_size); - if (!path_file_exists(savestate_name_auto)) + if (!filestream_exists(savestate_name_auto)) goto error; ret = content_load_state(savestate_name_auto, false, true); @@ -1446,7 +1447,7 @@ static bool command_event_save_core_config(void) core_path = path_get(RARCH_PATH_CORE); /* Infer file name based on libretro core. */ - if (!string_is_empty(core_path) && path_file_exists(core_path)) + if (!string_is_empty(core_path) && filestream_exists(core_path)) { unsigned i; RARCH_LOG("%s\n", msg_hash_to_str(MSG_USING_CORE_NAME_FOR_NEW_CONFIG)); @@ -1474,7 +1475,7 @@ static bool command_event_save_core_config(void) sizeof(tmp)); strlcat(config_path, tmp, config_size); - if (!path_file_exists(config_path)) + if (!filestream_exists(config_path)) { found_path = true; break; diff --git a/configuration.c b/configuration.c index da10440ad8..db278743c7 100644 --- a/configuration.c +++ b/configuration.c @@ -1609,9 +1609,9 @@ static void config_set_defaults(void) settings->rewind_buffer_size = rewind_buffer_size; #ifdef HAVE_LAKKA - settings->bools.ssh_enable = path_file_exists(LAKKA_SSH_PATH); - settings->bools.samba_enable = path_file_exists(LAKKA_SAMBA_PATH); - settings->bools.bluetooth_enable = path_file_exists(LAKKA_BLUETOOTH_PATH); + settings->bools.ssh_enable = filestream_exists(LAKKA_SSH_PATH); + settings->bools.samba_enable = filestream_exists(LAKKA_SAMBA_PATH); + settings->bools.bluetooth_enable = filestream_exists(LAKKA_BLUETOOTH_PATH); #endif #ifdef HAVE_MENU @@ -2729,9 +2729,9 @@ static bool config_load_file(const char *path, bool set_defaults, #ifdef HAVE_LAKKA - settings->bools.ssh_enable = path_file_exists(LAKKA_SSH_PATH); - settings->bools.samba_enable = path_file_exists(LAKKA_SAMBA_PATH); - settings->bools.bluetooth_enable = path_file_exists(LAKKA_BLUETOOTH_PATH); + settings->bools.ssh_enable = filestream_exists(LAKKA_SSH_PATH); + settings->bools.samba_enable = filestream_exists(LAKKA_SAMBA_PATH); + settings->bools.bluetooth_enable = filestream_exists(LAKKA_BLUETOOTH_PATH); #endif if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL) && @@ -3882,7 +3882,7 @@ bool config_save_overrides(int override_type) fill_pathname_join(override_directory, config_directory, core_name, path_size); - if(!path_file_exists(override_directory)) + if (!filestream_exists(override_directory)) path_mkdir(override_directory); /* Concatenate strings into full paths for core_path, game_path */ diff --git a/core_info.c b/core_info.c index 2194e29648..35f107c715 100644 --- a/core_info.c +++ b/core_info.c @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef HAVE_CONFIG_H #include "config.h" @@ -540,7 +541,7 @@ static bool core_info_list_update_missing_firmware_internal( fill_pathname_join(path, systemdir, info->firmware[i].path, path_size); - info->firmware[i].missing = !path_file_exists(path); + info->firmware[i].missing = !filestream_exists(path); if (info->firmware[i].missing && !info->firmware[i].optional) { rarch_ctl(RARCH_CTL_SET_MISSING_BIOS, NULL); @@ -596,7 +597,7 @@ static void core_info_list_get_missing_firmware( { fill_pathname_join(path, systemdir, info->firmware[i].path, sizeof(path)); - info->firmware[i].missing = !path_file_exists(path); + info->firmware[i].missing = !filestream_exists(path); *num_firmware += info->firmware[i].missing; } diff --git a/dirs.c b/dirs.c index 35b7ad5413..3fc81f2962 100644 --- a/dirs.c +++ b/dirs.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "dirs.h" @@ -305,7 +306,7 @@ void dir_check_defaults(void) /* early return for people with a custom folder setup so it doesn't create unnecessary directories */ - if (path_file_exists("custom.ini")) + if (filestream_exists("custom.ini")) return; for (i = 0; i < DEFAULT_DIR_LAST; i++) diff --git a/frontend/drivers/platform_darwin.m b/frontend/drivers/platform_darwin.m index df2ff6c28f..4b1096a33c 100644 --- a/frontend/drivers/platform_darwin.m +++ b/frontend/drivers/platform_darwin.m @@ -51,6 +51,7 @@ #include #include #include +#include #include #ifdef HAVE_MENU @@ -416,7 +417,7 @@ static void frontend_darwin_get_environment_settings(int *argc, char *argv[], fill_pathname_join(assets_zip_path, bundle_path_buf, "assets.zip", sizeof(assets_zip_path)); - if (path_file_exists(assets_zip_path)) + if (filestream_exists(assets_zip_path)) { settings_t *settings = config_get_ptr(); diff --git a/frontend/drivers/platform_gx.c b/frontend/drivers/platform_gx.c index 541e1363bf..9de04586cb 100644 --- a/frontend/drivers/platform_gx.c +++ b/frontend/drivers/platform_gx.c @@ -42,6 +42,7 @@ #include #endif #include +#include #include "../frontend_driver.h" #include "../../defaults.h" @@ -424,7 +425,7 @@ static void frontend_gx_process_args(int *argc, char *argv[]) { char path[PATH_MAX_LENGTH] = {0}; strlcpy(path, strrchr(argv[0], '/') + 1, sizeof(path)); - if (path_file_exists(path)) + if (filestream_exists(path)) rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, path); } #endif diff --git a/frontend/drivers/platform_ps3.c b/frontend/drivers/platform_ps3.c index e6d49fcf43..6e959f45ca 100644 --- a/frontend/drivers/platform_ps3.c +++ b/frontend/drivers/platform_ps3.c @@ -33,6 +33,7 @@ #include #include +#include #include #ifndef IS_SALAMANDER #include @@ -125,7 +126,7 @@ static void frontend_ps3_get_environment_settings(int *argc, char *argv[], #ifdef HAVE_MULTIMAN /* not launched from external launcher, set default path */ // second param is multiMAN SELF file - if(path_file_exists(argv[2]) && *argc > 1 + if ( filestream_exists(argv[2]) && *argc > 1 && (string_is_equal(argv[2], EMULATOR_CONTENT_DIR))) { multiman_detected = true; @@ -588,7 +589,7 @@ static void frontend_ps3_process_args(int *argc, char *argv[]) { char path[PATH_MAX_LENGTH] = {0}; strlcpy(path, argv[0], sizeof(path)); - if (path_file_exists(path)) + if (filestream_exists(path)) rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, path); } #endif diff --git a/frontend/drivers/platform_qnx.c b/frontend/drivers/platform_qnx.c index d9ec683b24..e1497b3b57 100644 --- a/frontend/drivers/platform_qnx.c +++ b/frontend/drivers/platform_qnx.c @@ -24,6 +24,7 @@ #include #include +#include #include #include "../../defaults.h" @@ -54,12 +55,13 @@ static void frontend_qnx_get_environment_settings(int *argc, char *argv[], void *data, void *params_data) { unsigned i; - char assets_path[PATH_MAX] = {0}; - char data_path[PATH_MAX] = {0}; - char user_path[PATH_MAX] = {0}; - char tmp_path[PATH_MAX] = {0}; + char data_assets_path[PATH_MAX] = {0}; + char assets_path[PATH_MAX] = {0}; + char data_path[PATH_MAX] = {0}; + char user_path[PATH_MAX] = {0}; + char tmp_path[PATH_MAX] = {0}; + char workdir[PATH_MAX] = {0}; - char workdir[PATH_MAX] = {0}; getcwd(workdir, sizeof(workdir)); if(!string_is_empty(workdir)) @@ -140,20 +142,20 @@ static void frontend_qnx_get_environment_settings(int *argc, char *argv[], file_path_str(FILE_PATH_MAIN_CONFIG), sizeof(g_defaults.path.config)); /* bundle copy */ - char data_assets_path[PATH_MAX] = {0}; sprintf(data_assets_path, "%s/%s", data_path, "assets"); - if(!path_file_exists(data_assets_path)) + + if (!filestream_exists(data_assets_path)) { + char copy_command[PATH_MAX] = {0}; + RARCH_LOG( "Copying application assets to data directory...\n" ); - char copy_command[PATH_MAX] = {0}; sprintf(copy_command, "cp -r %s/. %s", assets_path, data_path); - if(system(copy_command) == -1) { + if(system(copy_command) == -1) RARCH_LOG( "Asset copy failed: Shell could not be run.\n" ); - } else { + else RARCH_LOG( "Asset copy successful.\n"); - } } for (i = 0; i < DEFAULT_DIR_LAST; i++) diff --git a/frontend/drivers/platform_unix.c b/frontend/drivers/platform_unix.c index 43847effee..5bb7fa1453 100644 --- a/frontend/drivers/platform_unix.c +++ b/frontend/drivers/platform_unix.c @@ -667,7 +667,7 @@ static void check_proc_acpi_battery(const char * node, bool * have_battery, snprintf(path, sizeof(path), "%s/%s/%s", base, node, "state"); - if (!path_file_exists(path)) + if (!filestream_exists(path)) goto end; if (!filestream_read_file(path, (void**)&buf, &length)) @@ -795,8 +795,9 @@ static void check_proc_acpi_sysfs_battery(const char *node, snprintf(path, sizeof(path), "%s/%s/%s", base, node, "status"); - if (!path_file_exists(path)) + if (!filestream_exists(path)) return; + if (filestream_read_file(path, (void**)&buf, &length) != 1) return; @@ -842,8 +843,9 @@ static void check_proc_acpi_ac_adapter(const char * node, bool *have_ac) path[0] = '\0'; snprintf(path, sizeof(path), "%s/%s/%s", base, node, "state"); - if (!path_file_exists(path)) + if (!filestream_exists(path)) return; + if (filestream_read_file(path, (void**)&buf, &length) != 1) return; @@ -873,8 +875,9 @@ static void check_proc_acpi_sysfs_ac_adapter(const char * node, bool *have_ac) path[0] = '\0'; snprintf(path, sizeof(path), "%s/%s", base, "online"); - if (!path_file_exists(path)) + if (!filestream_exists(path)) return; + if (filestream_read_file(path, (void**)&buf, &length) != 1) return; @@ -928,8 +931,9 @@ static bool frontend_unix_powerstate_check_apm( char *buf = NULL; char *str = NULL; - if (!path_file_exists(proc_apm_path)) + if (!filestream_exists(proc_apm_path)) goto error; + if (filestream_read_file(proc_apm_path, (void**)&buf, &length) != 1) goto error; diff --git a/gfx/drivers_font_renderer/freetype.c b/gfx/drivers_font_renderer/freetype.c index 2c4edbf965..d690281e7c 100644 --- a/gfx/drivers_font_renderer/freetype.c +++ b/gfx/drivers_font_renderer/freetype.c @@ -22,6 +22,7 @@ #include #include +#include #include #ifdef WIIU @@ -297,7 +298,7 @@ static const char *font_renderer_ft_get_default_font(void) for (i = 0; i < ARRAY_SIZE(font_paths); i++) { - if (path_file_exists(font_paths[i])) + if (filestream_exists(font_paths[i])) return font_paths[i]; } diff --git a/gfx/drivers_font_renderer/stb.c b/gfx/drivers_font_renderer/stb.c index 424e195859..7b7a59163f 100644 --- a/gfx/drivers_font_renderer/stb.c +++ b/gfx/drivers_font_renderer/stb.c @@ -220,7 +220,7 @@ static const char *font_renderer_stb_get_default_font(void) const char **p; for (p = paths; *p; ++p) - if (path_file_exists(*p)) + if (filestream_exists(*p)) return *p; return NULL; diff --git a/gfx/drivers_font_renderer/stb_unicode.c b/gfx/drivers_font_renderer/stb_unicode.c index 878b3cd93d..5e163e3560 100644 --- a/gfx/drivers_font_renderer/stb_unicode.c +++ b/gfx/drivers_font_renderer/stb_unicode.c @@ -298,7 +298,7 @@ static const char *font_renderer_stb_unicode_get_default_font(void) const char **p; for (p = paths; *p; ++p) - if (path_file_exists(*p)) + if (filestream_exists(*p)) return *p; return NULL; diff --git a/gfx/video_shader_parse.c b/gfx/video_shader_parse.c index 3194beb4c8..c927dccb17 100644 --- a/gfx/video_shader_parse.c +++ b/gfx/video_shader_parse.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "../msg_hash.h" #include "../verbosity.h" @@ -162,7 +163,7 @@ static bool video_shader_parse_pass(config_file_t *conf, strlcpy(tmp_path, tmp_str, path_size); path_resolve_realpath(tmp_path, path_size); - if (!path_file_exists(tmp_path)) + if (!filestream_exists(tmp_path)) strlcpy(pass->source.path, tmp_str, sizeof(pass->source.path)); else strlcpy(pass->source.path, tmp_path, sizeof(pass->source.path)); @@ -383,7 +384,7 @@ static bool video_shader_parse_textures(config_file_t *conf, path_size); path_resolve_realpath(tmp_path, path_size); - if (path_file_exists(tmp_path)) + if (filestream_exists(tmp_path)) { strlcpy(shader->lut[shader->luts].path, tmp_path, sizeof(shader->lut[shader->luts].path)); diff --git a/libretro-common/file/archive_file.c b/libretro-common/file/archive_file.c index 197c925413..ca39050746 100644 --- a/libretro-common/file/archive_file.c +++ b/libretro-common/file/archive_file.c @@ -734,7 +734,7 @@ int file_archive_compressed_read( * hoping that optional_filename is the * same as requested. */ - if (optional_filename && path_file_exists(optional_filename)) + if (optional_filename && filestream_exists(optional_filename)) { *length = 0; string_list_free(str_list); diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index 3ae3471a59..40222829cd 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -31,7 +31,6 @@ #include #include #include -#include #ifndef __MACH__ #include @@ -396,32 +395,6 @@ bool path_is_compressed_file(const char* path) return false; } -/** - * path_file_exists: - * @path : path - * - * Checks if a file already exists at the specified path (@path). - * - * Returns: true (1) if file already exists, otherwise false (0). - */ -bool path_file_exists(const char *path) -{ - RFILE *dummy; - - if (!path || !*path) - return false; - - dummy = filestream_open(path, - RETRO_VFS_FILE_ACCESS_READ, - RETRO_VFS_FILE_ACCESS_HINT_NONE); - - if (!dummy) - return false; - - filestream_close(dummy); - return true; -} - /** * fill_pathname: * @out_path : output path diff --git a/libretro-common/include/file/file_path.h b/libretro-common/include/file/file_path.h index 52e292b069..1ae750c38b 100644 --- a/libretro-common/include/file/file_path.h +++ b/libretro-common/include/file/file_path.h @@ -73,16 +73,6 @@ bool path_is_compressed_file(const char *path); **/ #define path_contains_compressed_file(path) (path_get_archive_delim((path)) != NULL) -/** - * path_file_exists: - * @path : path - * - * Checks if a file already exists at the specified path (@path). - * - * Returns: true (1) if file already exists, otherwise false (0). - */ -bool path_file_exists(const char *path); - /** * path_get_archive_delim: * @path : path diff --git a/libretro-common/include/streams/file_stream.h b/libretro-common/include/streams/file_stream.h index 0539f6214b..aa766a0016 100644 --- a/libretro-common/include/streams/file_stream.h +++ b/libretro-common/include/streams/file_stream.h @@ -96,6 +96,8 @@ int filestream_rename(const char *old_path, const char *new_path); const char *filestream_get_path(RFILE *stream); +bool filestream_exists(const char *path); + static INLINE char *filestream_getline(RFILE *stream) { char* newline = (char*)malloc(9); diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index 4354189f33..f5ffd460b9 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -92,6 +92,24 @@ void filestream_vfs_init(const struct retro_vfs_interface_info* vfs_info) } /* Callback wrappers */ +bool filestream_exists(const char *path) +{ + RFILE *dummy = NULL; + + if (!path || !*path) + return false; + + dummy = filestream_open(path, + RETRO_VFS_FILE_ACCESS_READ, + RETRO_VFS_FILE_ACCESS_HINT_NONE); + + if (!dummy) + return false; + + filestream_close(dummy); + return true; +} + int64_t filestream_get_size(RFILE *stream) { int64_t output; diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 5f47aeea29..3fb2a7a3e7 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -1241,14 +1241,14 @@ static int generic_action_ok(const char *path, { case ACTION_OK_LOAD_WALLPAPER: flush_char = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_MENU_SETTINGS_LIST); - if (path_file_exists(action_path)) + if (filestream_exists(action_path)) { settings_t *settings = config_get_ptr(); strlcpy(settings->paths.path_menu_wallpaper, action_path, sizeof(settings->paths.path_menu_wallpaper)); - if (path_file_exists(action_path)) + if (filestream_exists(action_path)) task_push_image_load(action_path, menu_display_handle_wallpaper_upload, NULL); } @@ -1763,7 +1763,7 @@ static int action_ok_audio_add_to_mixer(const char *path, playlist_get_index(tmp_playlist, entry_idx, &entry_path, NULL, NULL, NULL, NULL, NULL); - if(path_file_exists(entry_path)) + if (filestream_exists(entry_path)) task_push_audio_mixer_load(entry_path, NULL, NULL); @@ -1791,7 +1791,7 @@ static int action_ok_audio_add_to_mixer_and_collection(const char *path, "builtin", "musicplayer"); - if(path_file_exists(combined_path)) + if (filestream_exists(combined_path)) task_push_audio_mixer_load(combined_path, NULL, NULL); @@ -2066,7 +2066,7 @@ static int generic_action_ok_shader_preset_save(const char *path, core_name, sizeof(directory)); } - if(!path_file_exists(directory)) + if (!filestream_exists(directory)) path_mkdir(directory); switch (action_type) @@ -2148,7 +2148,7 @@ static int generic_action_ok_remap_file_operation(const char *path, break; } - if(!path_file_exists(directory)) + if (!filestream_exists(directory)) path_mkdir(directory); if (action_type < ACTION_OK_REMAP_FILE_REMOVE_CORE) @@ -2457,7 +2457,7 @@ static void cb_decompressed(void *task_data, void *user_data, const char *err) if (dec) { - if (path_file_exists(dec->source_file)) + if (filestream_exists(dec->source_file)) filestream_delete(dec->source_file); free(dec->source_file); @@ -2648,7 +2648,7 @@ static void cb_generic_download(void *task_data, dirname, sizeof(shaderdir)); - if (!path_file_exists(shaderdir) && !path_mkdir(shaderdir)) + if (!filestream_exists(shaderdir) && !path_mkdir(shaderdir)) goto finish; dir_path = shaderdir; diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index d02ebb420d..5dccbf882c 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -1894,7 +1895,7 @@ static void mui_context_reset(void *data, bool is_threaded) menu_display_allocate_white_texture(); mui_context_reset_textures(mui); - if (path_file_exists(settings->paths.path_menu_wallpaper)) + if (filestream_exists(settings->paths.path_menu_wallpaper)) task_push_image_load(settings->paths.path_menu_wallpaper, menu_display_handle_wallpaper_upload, NULL); } diff --git a/menu/drivers/nuklear.c b/menu/drivers/nuklear.c index eba361cdf6..b6e5154619 100644 --- a/menu/drivers/nuklear.c +++ b/menu/drivers/nuklear.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -288,7 +289,7 @@ static void nk_menu_context_load_textures(nk_menu_handle_t *nk, fill_pathname_join(path, iconpath, "pointer.png", sizeof(path)); - if (!string_is_empty(path) && path_file_exists(path)) + if (!string_is_empty(path) && filestream_exists(path)) { image_texture_load(&ti, path); video_driver_texture_load(&ti, @@ -297,7 +298,7 @@ static void nk_menu_context_load_textures(nk_menu_handle_t *nk, fill_pathname_join(path, iconpath, "bg.png", sizeof(path)); - if (!string_is_empty(path) && path_file_exists(path)) + if (!string_is_empty(path) && filestream_exists(path)) { image_texture_load(&ti, path); video_driver_texture_load(&ti, @@ -325,7 +326,7 @@ static void nk_menu_context_reset(void *data, bool is_threaded) nk_menu_init_device(nk); nk_menu_context_load_textures(nk, iconpath); - if (path_file_exists(settings->paths.path_menu_wallpaper)) + if (filestream_exists(settings->paths.path_menu_wallpaper)) task_push_image_load(settings->paths.path_menu_wallpaper, menu_display_handle_wallpaper_upload, NULL); } diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index c9b7599676..6b4a6305ea 100755 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -1077,7 +1078,7 @@ static void xmb_update_savestate_thumbnail_path(void *data, unsigned i) strlcat(path, file_path_str(FILE_PATH_PNG_EXTENSION), path_size); - if (path_file_exists(path)) + if (filestream_exists(path)) { if (!string_is_empty(xmb->savestate_thumbnail_file_path)) free(xmb->savestate_thumbnail_file_path); @@ -1097,7 +1098,7 @@ static void xmb_update_thumbnail_image(void *data) if (!xmb) return; - if (path_file_exists(xmb->thumbnail_file_path)) + if (filestream_exists(xmb->thumbnail_file_path)) task_push_image_load(xmb->thumbnail_file_path, menu_display_handle_thumbnail_upload, NULL); else @@ -1142,7 +1143,7 @@ static void xmb_update_savestate_thumbnail_image(void *data) return; if (!string_is_empty(xmb->savestate_thumbnail_file_path) - && path_file_exists(xmb->savestate_thumbnail_file_path)) + && filestream_exists(xmb->savestate_thumbnail_file_path)) task_push_image_load(xmb->savestate_thumbnail_file_path, menu_display_handle_savestate_thumbnail_upload, NULL); else @@ -1546,13 +1547,13 @@ static void xmb_list_switch_new(xmb_handle_t *xmb, file_path_str(FILE_PATH_PNG_EXTENSION), path_size); - if (!path_file_exists(path)) + if (!filestream_exists(path)) fill_pathname_application_special(path, path_size, APPLICATION_SPECIAL_DIRECTORY_ASSETS_XMB_BG); if(!string_is_equal(path, xmb->background_file_path)) { - if(path_file_exists(path)) + if(filestream_exists(path)) { task_push_image_load(path, menu_display_handle_wallpaper_upload, NULL); @@ -3838,7 +3839,7 @@ static void xmb_context_reset_background(const char *iconpath) strlcpy(path, settings->paths.path_menu_wallpaper, PATH_MAX_LENGTH * sizeof(char)); - if (path_file_exists(path)) + if (filestream_exists(path)) task_push_image_load(path, menu_display_handle_wallpaper_upload, NULL); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index c2323406d1..44fe89d7ee 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #ifdef HAVE_CONFIG_H @@ -2811,7 +2812,7 @@ static int menu_displaylist_parse_horizontal_content_actions( file_path_str(FILE_PATH_RDB_EXTENSION), PATH_MAX_LENGTH * sizeof(char)); - if (path_file_exists(db_path)) + if (filestream_exists(db_path)) menu_entries_append_enum( info->list, label, diff --git a/menu/menu_driver.c b/menu/menu_driver.c index e1bbbc5b18..018a1a2277 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #ifdef HAVE_CONFIG_H @@ -1307,7 +1308,7 @@ void menu_display_reset_textures_list( if (!string_is_empty(texture_path)) fill_pathname_join(texpath, iconpath, texture_path, texpath_size); - if (string_is_empty(texpath) || !path_file_exists(texpath)) + if (string_is_empty(texpath) || !filestream_exists(texpath)) goto error; if (!image_texture_load(&ti, texpath)) diff --git a/menu/menu_networking.c b/menu/menu_networking.c index c05134e6b0..8850fbdac8 100644 --- a/menu/menu_networking.c +++ b/menu/menu_networking.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #ifdef HAVE_NETWORKING @@ -153,7 +154,7 @@ void print_buf_lines(file_list_t *list, char *buf, sizeof(core_path)); if ( - path_file_exists(core_path) + filestream_exists(core_path) && core_info_get_display_name( core_path, display_name, sizeof(display_name))) file_list_set_alt_at_offset(list, j, display_name); diff --git a/retroarch.c b/retroarch.c index 2545b79424..ab5be3ac9e 100644 --- a/retroarch.c +++ b/retroarch.c @@ -43,6 +43,7 @@ #include #include