Start using VFS API constant defines

This commit is contained in:
twinaphex 2017-12-11 12:15:00 +01:00
parent 93ee4df5f5
commit 318f17c4cb
26 changed files with 94 additions and 58 deletions

View File

@ -2641,7 +2641,7 @@ static int cheevos_iterate(coro_t* coro)
if (!CHEEVOS_VAR_DATA) if (!CHEEVOS_VAR_DATA)
{ {
CHEEVOS_VAR_STREAM = filestream_open(CHEEVOS_VAR_PATH, CHEEVOS_VAR_STREAM = filestream_open(CHEEVOS_VAR_PATH,
RFILE_MODE_READ, RFILE_HINT_NONE); RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
if (!CHEEVOS_VAR_STREAM) if (!CHEEVOS_VAR_STREAM)
CORO_STOP(); CORO_STOP();

View File

@ -19,6 +19,7 @@
#include <ctype.h> #include <ctype.h>
#include <libretro.h>
#include <file/config_file.h> #include <file/config_file.h>
#include <file/file_path.h> #include <file/file_path.h>
#include <compat/strl.h> #include <compat/strl.h>
@ -3792,17 +3793,17 @@ bool config_save_file(const char *path)
#ifdef HAVE_LAKKA #ifdef HAVE_LAKKA
if (settings->bools.ssh_enable) if (settings->bools.ssh_enable)
filestream_close(filestream_open(LAKKA_SSH_PATH, filestream_close(filestream_open(LAKKA_SSH_PATH,
RFILE_MODE_WRITE, RFILE_HINT_NONE)); RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE));
else else
path_file_remove(LAKKA_SSH_PATH); path_file_remove(LAKKA_SSH_PATH);
if (settings->bools.samba_enable) if (settings->bools.samba_enable)
filestream_close(filestream_open(LAKKA_SAMBA_PATH, filestream_close(filestream_open(LAKKA_SAMBA_PATH,
RFILE_MODE_WRITE, RFILE_HINT_NONE)); RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE));
else else
path_file_remove(LAKKA_SAMBA_PATH); path_file_remove(LAKKA_SAMBA_PATH);
if (settings->bools.bluetooth_enable) if (settings->bools.bluetooth_enable)
filestream_close(filestream_open(LAKKA_BLUETOOTH_PATH, filestream_close(filestream_open(LAKKA_BLUETOOTH_PATH,
RFILE_MODE_WRITE, RFILE_HINT_NONE)); RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE));
else else
path_file_remove(LAKKA_BLUETOOTH_PATH); path_file_remove(LAKKA_BLUETOOTH_PATH);
#endif #endif

View File

@ -21,6 +21,7 @@
#include <gccore.h> #include <gccore.h>
#include <ogcsys.h> #include <ogcsys.h>
#include <libretro.h>
#include <streams/file_stream.h> #include <streams/file_stream.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
@ -719,7 +720,8 @@ static void gx_efb_screenshot(void)
{ {
int x, y; int x, y;
uint8_t tga_header[] = {0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0xE0, 0x01, 0x18, 0x00}; uint8_t tga_header[] = {0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0xE0, 0x01, 0x18, 0x00};
RFILE *out = filestream_open("/screenshot.tga", RFILE_MODE_WRITE, RFILE_HINT_NONE); RFILE *out = filestream_open("/screenshot.tga",
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
if (!out) if (!out)
return; return;

View File

@ -17,6 +17,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <libretro.h>
#include <compat/posix_string.h> #include <compat/posix_string.h>
#include <compat/msvc.h> #include <compat/msvc.h>
#include <compat/strl.h> #include <compat/strl.h>
@ -545,7 +546,8 @@ bool video_shader_resolve_parameters(config_file_t *conf,
/* If that doesn't work, fallback to the old path. /* If that doesn't work, fallback to the old path.
* Ideally, we'd get rid of this path sooner or later. */ * Ideally, we'd get rid of this path sooner or later. */
#endif #endif
file = filestream_open(path, RFILE_MODE_READ, RFILE_HINT_NONE); file = filestream_open(path,
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
if (!file) if (!file)
{ {

View File

@ -321,7 +321,7 @@ static unsigned char check_arm_cpu_feature(const char* feature)
char line[1024]; char line[1024];
unsigned char status = 0; unsigned char status = 0;
RFILE *fp = filestream_open("/proc/cpuinfo", RFILE *fp = filestream_open("/proc/cpuinfo",
RFILE_MODE_READ, RFILE_HINT_NONE); RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
if (!fp) if (!fp)
return 0; return 0;

View File

@ -355,7 +355,7 @@ static config_file_t *config_file_new_internal(
conf->include_depth = depth; conf->include_depth = depth;
file = filestream_open(path, file = filestream_open(path,
RFILE_MODE_READ, RFILE_HINT_NONE); RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
if (!file) if (!file)
{ {

View File

@ -28,6 +28,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <libretro.h>
#include <boolean.h> #include <boolean.h>
#include <file/file_path.h> #include <file/file_path.h>
#include <streams/file_stream.h> #include <streams/file_stream.h>
@ -410,7 +411,8 @@ bool path_file_exists(const char *path)
if (!path || !*path) if (!path || !*path)
return false; return false;
dummy = filestream_open(path, RFILE_MODE_READ, RFILE_HINT_NONE); dummy = filestream_open(path,
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
if (!dummy) if (!dummy)
return false; return false;

View File

@ -215,7 +215,8 @@ bool rbmp_save_image(
unsigned pitch, enum rbmp_source_type type) unsigned pitch, enum rbmp_source_type type)
{ {
bool ret = false; bool ret = false;
RFILE *file = filestream_open(filename, RFILE_MODE_WRITE, RFILE_HINT_NONE); RFILE *file = filestream_open(filename,
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
if (!file) if (!file)
return false; return false;

View File

@ -227,7 +227,8 @@ static bool rpng_save_image(const char *path,
void *stream = NULL; void *stream = NULL;
uint32_t total_in = 0; uint32_t total_in = 0;
uint32_t total_out = 0; uint32_t total_out = 0;
RFILE *file = filestream_open(path, RFILE_MODE_WRITE, RFILE_HINT_NONE); RFILE *file = filestream_open(path,
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
if (!file) if (!file)
GOTO_END_ERROR(); GOTO_END_ERROR();

View File

@ -419,7 +419,8 @@ rxml_document_t *rxml_load_document(const char *path)
char *new_memory_buffer = NULL; char *new_memory_buffer = NULL;
const char *mem_ptr = NULL; const char *mem_ptr = NULL;
long len = 0; long len = 0;
RFILE *file = filestream_open(path, RFILE_MODE_READ, RFILE_HINT_NONE); RFILE *file = filestream_open(path,
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
if (!file) if (!file)
return NULL; return NULL;

View File

@ -511,7 +511,8 @@ int sha1_calculate(const char *path, char *result)
SHA1Context sha; SHA1Context sha;
unsigned char buff[4096]; unsigned char buff[4096];
int rv = 1; int rv = 1;
RFILE *fd = filestream_open(path, RFILE_MODE_READ, RFILE_HINT_NONE); RFILE *fd = filestream_open(path,
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
if (!fd) if (!fd)
goto error; goto error;

View File

@ -1044,6 +1044,13 @@ struct retro_hw_render_context_negotiation_interface
* recognize or support. Should be set in either retro_init or retro_load_game, but not both. * recognize or support. Should be set in either retro_init or retro_load_game, but not both.
*/ */
/* File open flags
* Introduced in VFS API v1 */
#define RETRO_VFS_FILE_ACCESS_READ (1 << 0) /* Read only mode */
#define RETRO_VFS_FILE_ACCESS_WRITE (1 << 1) /* Write only mode, discard contents and overwrites existing file unless RETRO_VFS_FILE_ACCESS_UPDATE is also specified */
#define RETRO_VFS_FILE_ACCESS_READ_WRITE (RETRO_VFS_FILE_ACCESS_READ | RETRO_VFS_FILE_ACCESS_WRITE) /* Read-write mode, discard contents and overwrites existing file unless RETRO_VFS_FILE_ACCESS_UPDATE is also specified*/
#define RETRO_VFS_FILE_ACCESS_UPDATE_EXISTING (1 << 2) /* Prevents discarding content of existing files opened for writing */
#define RETRO_MEMDESC_CONST (1 << 0) /* The frontend will never change this memory area once retro_load_game has returned. */ #define RETRO_MEMDESC_CONST (1 << 0) /* The frontend will never change this memory area once retro_load_game has returned. */
#define RETRO_MEMDESC_BIGENDIAN (1 << 1) /* The memory area contains big endian data. Default is little endian. */ #define RETRO_MEMDESC_BIGENDIAN (1 << 1) /* The memory area contains big endian data. Default is little endian. */

View File

@ -30,6 +30,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <libretro.h>
#include <retro_common_api.h> #include <retro_common_api.h>
#include <retro_inline.h> #include <retro_inline.h>
#include <boolean.h> #include <boolean.h>
@ -40,16 +41,11 @@ RETRO_BEGIN_DECLS
typedef struct RFILE RFILE; typedef struct RFILE RFILE;
#define RFILE_HINT_NONE (0) #define FILESTREAM_REQUIRED_VFS_VERSION 1
/* requires RFILE_MODE_READ */
#define RFILE_HINT_MMAP (1 << 9)
enum #define RFILE_HINT_NONE (0)
{ /* requires RETRO_VFS_FILE_ACCESS_READ */
RFILE_MODE_READ = 0, #define RFILE_HINT_MMAP (1 << 9)
RFILE_MODE_WRITE,
RFILE_MODE_READ_WRITE
};
int64_t filestream_get_size(RFILE *stream); int64_t filestream_get_size(RFILE *stream);

View File

@ -164,7 +164,7 @@ RFILE *filestream_open(const char *path, unsigned mode, unsigned hints)
stream->hints = hints; stream->hints = hints;
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
if (stream->hints & RFILE_HINT_MMAP && mode == RFILE_MODE_READ) if (stream->hints & RFILE_HINT_MMAP && mode == RETRO_VFS_FILE_ACCESS_READ)
stream->hints |= RFILE_HINT_UNBUFFERED; stream->hints |= RFILE_HINT_UNBUFFERED;
else else
#endif #endif
@ -172,13 +172,13 @@ RFILE *filestream_open(const char *path, unsigned mode, unsigned hints)
switch (mode) switch (mode)
{ {
case RFILE_MODE_READ: case RETRO_VFS_FILE_ACCESS_READ:
if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0)
mode_str = MODE_STR_READ_UNBUF; mode_str = MODE_STR_READ_UNBUF;
/* No "else" here */ /* No "else" here */
flags = O_RDONLY; flags = O_RDONLY;
break; break;
case RFILE_MODE_WRITE: case RETRO_VFS_FILE_ACCESS_WRITE:
if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0)
mode_str = MODE_STR_WRITE_UNBUF; mode_str = MODE_STR_WRITE_UNBUF;
else else
@ -189,7 +189,7 @@ RFILE *filestream_open(const char *path, unsigned mode, unsigned hints)
#endif #endif
} }
break; break;
case RFILE_MODE_READ_WRITE: case RETRO_VFS_FILE_ACCESS_READ_WRITE:
if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0)
mode_str = MODE_STR_WRITE_PLUS; mode_str = MODE_STR_WRITE_PLUS;
else else
@ -200,6 +200,9 @@ RFILE *filestream_open(const char *path, unsigned mode, unsigned hints)
#endif #endif
} }
break; break;
/* TODO/FIXME - implement */
case RETRO_VFS_FILE_ACCESS_UPDATE_EXISTING:
break;
} }
if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0 && mode_str) if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0 && mode_str)
@ -550,7 +553,7 @@ int filestream_read_file(const char *path, void **buf, ssize_t *len)
ssize_t content_buf_size = 0; ssize_t content_buf_size = 0;
void *content_buf = NULL; void *content_buf = NULL;
RFILE *file = filestream_open(path, RFILE *file = filestream_open(path,
RFILE_MODE_READ, RFILE_HINT_NONE); RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
if (!file) if (!file)
{ {
@ -616,7 +619,8 @@ error:
bool filestream_write_file(const char *path, const void *data, ssize_t size) bool filestream_write_file(const char *path, const void *data, ssize_t size)
{ {
ssize_t ret = 0; ssize_t ret = 0;
RFILE *file = filestream_open(path, RFILE_MODE_WRITE, RFILE_HINT_NONE); RFILE *file = filestream_open(path,
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
if (!file) if (!file)
return false; return false;

View File

@ -19,22 +19,23 @@
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <streams/file_stream.h>
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
#include <libretro.h>
#include <streams/file_stream.h>
RFILE* rfopen(const char *path, const char *mode) RFILE* rfopen(const char *path, const char *mode)
{ {
unsigned int retro_mode = 0; unsigned int retro_mode = 0;
if (strstr(mode, "r")) if (strstr(mode, "r"))
if (strstr(mode, "b")) if (strstr(mode, "b"))
retro_mode = RFILE_MODE_READ; retro_mode = RETRO_VFS_FILE_ACCESS_READ;
if (strstr(mode, "w")) if (strstr(mode, "w"))
retro_mode = RFILE_MODE_WRITE; retro_mode = RETRO_VFS_FILE_ACCESS_WRITE;
if (strstr(mode, "+")) if (strstr(mode, "+"))
retro_mode = RFILE_MODE_READ_WRITE; retro_mode = RETRO_VFS_FILE_ACCESS_READ_WRITE;
return filestream_open(path, retro_mode, -1); return filestream_open(path, retro_mode, -1);
} }

View File

@ -804,7 +804,8 @@ int main(int argc, char** argv)
dat_buffer++; dat_buffer++;
} }
rdb_file = filestream_open(rdb_path, RFILE_MODE_WRITE, RFILE_HINT_NONE); rdb_file = filestream_open(rdb_path,
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
if (!rdb_file) if (!rdb_file)
{ {

View File

@ -216,8 +216,9 @@ int libretrodb_open(const char *path, libretrodb_t *db)
{ {
libretrodb_header_t header; libretrodb_header_t header;
libretrodb_metadata_t md; libretrodb_metadata_t md;
int rv; int rv = 0;
RFILE *fd = filestream_open(path, RFILE_MODE_READ, RFILE_HINT_NONE); RFILE *fd = filestream_open(path,
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
if (!fd) if (!fd)
return -errno; return -errno;
@ -428,18 +429,21 @@ void libretrodb_cursor_close(libretrodb_cursor_t *cursor)
int libretrodb_cursor_open(libretrodb_t *db, libretrodb_cursor_t *cursor, int libretrodb_cursor_open(libretrodb_t *db, libretrodb_cursor_t *cursor,
libretrodb_query_t *q) libretrodb_query_t *q)
{ {
RFILE *fd = NULL;
if (!db || string_is_empty(db->path)) if (!db || string_is_empty(db->path))
return -errno; return -errno;
cursor->fd = filestream_open(db->path, RFILE_MODE_READ, RFILE_HINT_MMAP); fd = filestream_open(db->path,
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_MMAP);
if (!cursor->fd) if (!fd)
return -errno; return -errno;
cursor->db = db; cursor->fd = fd;
cursor->db = db;
cursor->is_valid = 1; cursor->is_valid = 1;
libretrodb_cursor_reset(cursor); libretrodb_cursor_reset(cursor);
cursor->query = q; cursor->query = q;
if (q) if (q)
libretrodb_query_inc_ref(q); libretrodb_query_inc_ref(q);

View File

@ -92,7 +92,8 @@ int main(int argc, char ** argv)
call_init(L, argc - 2, (const char **) argv + 2); call_init(L, argc - 2, (const char **) argv + 2);
dst = filestream_open(db_file, RFILE_MODE_WRITE, RFILE_HINT_NONE); dst = filestream_open(db_file,
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
if (!dst) if (!dst)
{ {

View File

@ -106,7 +106,8 @@ static int create_db(lua_State *L)
} }
lua_setfield(L, LUA_REGISTRYINDEX, "testlib_get_value"); lua_setfield(L, LUA_REGISTRYINDEX, "testlib_get_value");
dst = filestream_open(db_file, RFILE_MODE_WRITE, RFILE_HINT_NONE); dst = filestream_open(db_file,
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
if (!dst) if (!dst)
{ {
lua_pushstring(L, "Could not open destination file"); lua_pushstring(L, "Could not open destination file");

View File

@ -186,9 +186,10 @@ static struct rmsgpack_read_callbacks stub_callbacks = {
int main(void) int main(void)
{ {
struct stub_state state; struct stub_state state;
RFILE *fd = filestream_open("test.msgpack", RFILE_MODE_READ, RFILE_HINT_NONE); RFILE *fd = filestream_open("test.msgpack",
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
state.i = 0; state.i = 0;
state.stack[0] = 0; state.stack[0] = 0;
rmsgpack_read(fd, &stub_callbacks, &state); rmsgpack_read(fd, &stub_callbacks, &state);

View File

@ -22,6 +22,7 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <libretro.h>
#include <lists/file_list.h> #include <lists/file_list.h>
#include <file/file_path.h> #include <file/file_path.h>
#include <string/stdstring.h> #include <string/stdstring.h>
@ -1877,7 +1878,7 @@ static void systemd_service_toggle(const char *path, char *unit, bool enable)
if (enable) if (enable)
filestream_close(filestream_open(path, filestream_close(filestream_open(path,
RFILE_MODE_WRITE, RFILE_HINT_NONE)); RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE));
else else
path_file_remove(path); path_file_remove(path);

View File

@ -75,7 +75,8 @@ static bool bsv_movie_init_playback(bsv_movie_t *handle, const char *path)
uint32_t state_size = 0; uint32_t state_size = 0;
uint32_t content_crc = 0; uint32_t content_crc = 0;
uint32_t header[4] = {0}; uint32_t header[4] = {0};
RFILE *file = filestream_open(path, RFILE_MODE_READ, RFILE_HINT_NONE); RFILE *file = filestream_open(path,
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
if (!file) if (!file)
{ {
@ -152,7 +153,8 @@ static bool bsv_movie_init_record(bsv_movie_t *handle, const char *path)
uint32_t state_size = 0; uint32_t state_size = 0;
uint32_t content_crc = 0; uint32_t content_crc = 0;
uint32_t header[4] = {0}; uint32_t header[4] = {0};
RFILE *file = filestream_open(path, RFILE_MODE_WRITE, RFILE_HINT_NONE); RFILE *file = filestream_open(path,
RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
if (!file) if (!file)
{ {

View File

@ -18,6 +18,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <libretro.h>
#include <boolean.h> #include <boolean.h>
#include <compat/posix_string.h> #include <compat/posix_string.h>
#include <string/stdstring.h> #include <string/stdstring.h>
@ -394,7 +395,7 @@ void playlist_write_file(playlist_t *playlist)
return; return;
file = filestream_open(playlist->conf_path, file = filestream_open(playlist->conf_path,
RFILE_MODE_WRITE, RFILE_HINT_NONE); RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
if (!file) if (!file)
{ {
@ -494,7 +495,7 @@ static bool playlist_read_file(
unsigned i; unsigned i;
char buf[PLAYLIST_ENTRIES][1024]; char buf[PLAYLIST_ENTRIES][1024];
RFILE *file = filestream_open( RFILE *file = filestream_open(
path, RFILE_MODE_READ, RFILE_HINT_NONE); path, RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
for (i = 0; i < PLAYLIST_ENTRIES; i++) for (i = 0; i < PLAYLIST_ENTRIES; i++)
buf[i][0] = '\0'; buf[i][0] = '\0';

View File

@ -101,7 +101,7 @@ static intfstream_t* intfstream_open_file(const char *path)
if (!fd) if (!fd)
return NULL; return NULL;
if (!intfstream_open(fd, path, RFILE_MODE_READ, RFILE_HINT_NONE)) if (!intfstream_open(fd, path, RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE))
goto error; goto error;
return fd; return fd;
@ -130,7 +130,7 @@ static intfstream_t *open_memory(void *data, size_t size)
if (!fd) if (!fd)
return NULL; return NULL;
if (!intfstream_open(fd, NULL, RFILE_MODE_READ, RFILE_HINT_NONE)) if (!intfstream_open(fd, NULL, RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE))
goto error; goto error;
return fd; return fd;
@ -158,7 +158,8 @@ open_chd_track(const char *path, int32_t track)
if (!fd) if (!fd)
return NULL; return NULL;
if (!intfstream_open(fd, path, RFILE_MODE_READ, RFILE_HINT_NONE)) if (!intfstream_open(fd, path,
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE))
goto error; goto error;
return fd; return fd;

View File

@ -413,7 +413,8 @@ clean:
static ssize_t get_file_size(const char *path) static ssize_t get_file_size(const char *path)
{ {
ssize_t rv; ssize_t rv;
RFILE *fd = filestream_open(path, RFILE_MODE_READ, RFILE_HINT_NONE); RFILE *fd = filestream_open(path,
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE);
if (fd == NULL) if (fd == NULL)
return -1; return -1;
rv = filestream_get_size(fd); rv = filestream_get_size(fd);
@ -467,7 +468,8 @@ int cue_find_track(const char *cue_path, bool first,
if (!fd) if (!fd)
goto error; goto error;
if (!intfstream_open(fd, cue_path, RFILE_MODE_READ, RFILE_HINT_NONE)) if (!intfstream_open(fd, cue_path,
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE))
{ {
RARCH_LOG("Could not open CUE file '%s': %s\n", cue_path, RARCH_LOG("Could not open CUE file '%s': %s\n", cue_path,
strerror(errno)); strerror(errno));
@ -621,7 +623,8 @@ int gdi_find_track(const char *gdi_path, bool first,
if (!fd) if (!fd)
goto error; goto error;
if (!intfstream_open(fd, gdi_path, RFILE_MODE_READ, RFILE_HINT_NONE)) if (!intfstream_open(fd, gdi_path,
RETRO_VFS_FILE_ACCESS_READ, RFILE_HINT_NONE))
{ {
RARCH_LOG("Could not open GDI file '%s': %s\n", gdi_path, RARCH_LOG("Could not open GDI file '%s': %s\n", gdi_path,
strerror(errno)); strerror(errno));

View File

@ -158,7 +158,7 @@ static void autosave_thread(void *data)
{ {
/* Should probably deal with this more elegantly. */ /* Should probably deal with this more elegantly. */
RFILE *file = filestream_open(save->path, RFILE *file = filestream_open(save->path,
RFILE_MODE_WRITE, RFILE_HINT_NONE); RETRO_VFS_FILE_ACCESS_WRITE, RFILE_HINT_NONE);
if (file) if (file)
{ {
@ -565,7 +565,7 @@ static void task_save_handler(retro_task_t *task)
if (!state->file) if (!state->file)
{ {
state->file = filestream_open(state->path, RFILE_MODE_WRITE, state->file = filestream_open(state->path, RETRO_VFS_FILE_ACCESS_WRITE,
RFILE_HINT_NONE); RFILE_HINT_NONE);
if (!state->file) if (!state->file)
@ -738,7 +738,8 @@ static void task_load_handler(retro_task_t *task)
if (!state->file) if (!state->file)
{ {
state->file = filestream_open(state->path, RFILE_MODE_READ, state->file = filestream_open(state->path,
RETRO_VFS_FILE_ACCESS_READ,
RFILE_HINT_NONE); RFILE_HINT_NONE);
if (!state->file) if (!state->file)