Move path_file_exists to filestream and do away with filestream

dependencies in file/file_path
This commit is contained in:
twinaphex 2017-12-14 20:05:46 +01:00
parent 8c0adf3594
commit c7c4b723d6
30 changed files with 135 additions and 127 deletions

View File

@ -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];
}

View File

@ -24,6 +24,7 @@
#include <file/file_path.h>
#include <lists/dir_list.h>
#include <string/stdstring.h>
#include <streams/file_stream.h>
#include <streams/stdin_stream.h>
#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;

View File

@ -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 */

View File

@ -20,6 +20,7 @@
#include <file/file_path.h>
#include <lists/dir_list.h>
#include <file/archive_file.h>
#include <streams/file_stream.h>
#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;
}

3
dirs.c
View File

@ -19,6 +19,7 @@
#include <lists/dir_list.h>
#include <lists/string_list.h>
#include <string/stdstring.h>
#include <streams/file_stream.h>
#include <retro_assert.h>
#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++)

View File

@ -51,6 +51,7 @@
#include <retro_assert.h>
#include <retro_miscellaneous.h>
#include <file/file_path.h>
#include <streams/file_stream.h>
#include <rhash.h>
#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();

View File

@ -42,6 +42,7 @@
#include <lists/file_list.h>
#endif
#include <string/stdstring.h>
#include <streams/file_stream.h>
#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

View File

@ -33,6 +33,7 @@
#include <compat/strl.h>
#include <string/stdstring.h>
#include <streams/file_stream.h>
#include <file/file_path.h>
#ifndef IS_SALAMANDER
#include <lists/file_list.h>
@ -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

View File

@ -24,6 +24,7 @@
#include <packageinfo.h>
#include <boolean.h>
#include <streams/file_stream.h>
#include <string/stdstring.h>
#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++)

View File

@ -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;

View File

@ -22,6 +22,7 @@
#include <ft2build.h>
#include <file/file_path.h>
#include <streams/file_stream.h>
#include <retro_miscellaneous.h>
#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];
}

View File

@ -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;

View File

@ -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;

View File

@ -26,6 +26,7 @@
#include <rhash.h>
#include <string/stdstring.h>
#include <streams/interface_stream.h>
#include <streams/file_stream.h>
#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));

View File

@ -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);

View File

@ -31,7 +31,6 @@
#include <libretro.h>
#include <boolean.h>
#include <file/file_path.h>
#include <streams/file_stream.h>
#ifndef __MACH__
#include <compat/strl.h>
@ -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

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -28,6 +28,7 @@
#include <formats/image.h>
#include <gfx/math/matrix_4x4.h>
#include <string/stdstring.h>
#include <streams/file_stream.h>
#include <lists/string_list.h>
#include <encodings/utf.h>
@ -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);
}

View File

@ -29,6 +29,7 @@
#include <file/file_path.h>
#include <formats/image.h>
#include <gfx/math/matrix_4x4.h>
#include <streams/file_stream.h>
#include <string/stdstring.h>
#include <lists/string_list.h>
@ -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);
}

View File

@ -28,6 +28,7 @@
#include <string/stdstring.h>
#include <lists/string_list.h>
#include <gfx/math/matrix_4x4.h>
#include <streams/file_stream.h>
#include <encodings/utf.h>
#include <features/features_cpu.h>
@ -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);

View File

@ -26,6 +26,7 @@
#include <file/file_path.h>
#include <file/archive_file.h>
#include <string/stdstring.h>
#include <streams/file_stream.h>
#include <features/features_cpu.h>
#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,

View File

@ -22,6 +22,7 @@
#include <retro_miscellaneous.h>
#include <formats/image.h>
#include <file/file_path.h>
#include <streams/file_stream.h>
#include <string/stdstring.h>
#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))

View File

@ -23,6 +23,7 @@
#include <lists/string_list.h>
#include <file/file_path.h>
#include <compat/strl.h>
#include <streams/file_stream.h>
#include <string/stdstring.h>
#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);

View File

@ -43,6 +43,7 @@
#include <compat/getopt.h>
#include <audio/audio_mixer.h>
#include <compat/posix_string.h>
#include <streams/file_stream.h>
#include <file/file_path.h>
#include <retro_assert.h>
#include <retro_miscellaneous.h>
@ -835,7 +836,7 @@ static void retroarch_parse_input(int argc, char *argv[])
"Setting libretro_directory to \"%s\" instead.\n",
optarg);
}
else if (path_file_exists(optarg))
else if (filestream_exists(optarg))
{
rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, optarg);
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_LIBRETRO, NULL);

View File

@ -19,6 +19,7 @@
#include <string/stdstring.h>
#include <file/file_path.h>
#include <file/archive_file.h>
#include <streams/file_stream.h>
#include <retro_miscellaneous.h>
#include <compat/strl.h>
@ -272,7 +273,7 @@ bool task_push_decompress(
}
/* ZIP or APK only */
if (!path_file_exists(source_file) ||
if (!filestream_exists(source_file) ||
msg_hash_to_file_type(msg_hash_calculate(path_get_extension(source_file)))
!= FILE_TYPE_COMPRESSED)
{

View File

@ -549,7 +549,7 @@ static bool try_bps_patch(bool allow_bps, const char *name_bps,
uint8_t **buf, ssize_t *size)
{
if (allow_bps && !string_is_empty(name_bps))
if (path_is_valid(name_bps) && path_file_exists(name_bps))
if (path_is_valid(name_bps) && filestream_exists(name_bps))
{
ssize_t patch_size;
bool ret = false;
@ -576,7 +576,7 @@ static bool try_ups_patch(bool allow_ups, const char *name_ups,
uint8_t **buf, ssize_t *size)
{
if (allow_ups && !string_is_empty(name_ups))
if (path_is_valid(name_ups) && path_file_exists(name_ups))
if (path_is_valid(name_ups) && filestream_exists(name_ups))
{
ssize_t patch_size;
bool ret = false;
@ -603,7 +603,7 @@ static bool try_ips_patch(bool allow_ips,
const char *name_ips, uint8_t **buf, ssize_t *size)
{
if (allow_ips && !string_is_empty(name_ips))
if (path_is_valid(name_ips) && path_file_exists(name_ips))
if (path_is_valid(name_ips) && filestream_exists(name_ips))
{
ssize_t patch_size;
bool ret = false;

View File

@ -1175,7 +1175,7 @@ bool content_save_state(const char *path, bool save_to_disk, bool autosave)
{
if (save_to_disk)
{
if (path_file_exists(path) && !autosave)
if (filestream_exists(path) && !autosave)
{
/* Before overwritting the savestate file, load it into a buffer
to allow undo_save_state() to work */
@ -1272,7 +1272,7 @@ error:
bool content_rename_state(const char *origin, const char *dest)
{
int ret = 0;
if (path_file_exists(dest))
if (filestream_exists(dest))
filestream_delete(dest);
ret = filestream_rename(origin, dest);