RetroArch
Classes | Macros | Functions | Variables
file_stream.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include <errno.h>
#include <streams/file_stream.h>
#include <vfs/vfs_implementation.h>
Include dependency graph for file_stream.c:

Classes

struct  RFILE
 

Macros

#define VFS_FRONTEND
 

Functions

void filestream_vfs_init (const struct retro_vfs_interface_info *vfs_info)
 
bool filestream_exists (const char *path)
 
int64_t filestream_get_size (RFILE *stream)
 
int64_t filestream_truncate (RFILE *stream, int64_t length)
 
RFILEfilestream_open (const char *path, unsigned mode, unsigned hints)
 
char * filestream_gets (RFILE *stream, char *s, size_t len)
 
int filestream_getc (RFILE *stream)
 
int filestream_scanf (RFILE *stream, const char *format,...)
 
int64_t filestream_seek (RFILE *stream, int64_t offset, int seek_position)
 
int filestream_eof (RFILE *stream)
 
int64_t filestream_tell (RFILE *stream)
 
void filestream_rewind (RFILE *stream)
 
int64_t filestream_read (RFILE *stream, void *s, int64_t len)
 
int filestream_flush (RFILE *stream)
 
int filestream_delete (const char *path)
 
int filestream_rename (const char *old_path, const char *new_path)
 
const char * filestream_get_path (RFILE *stream)
 
int64_t filestream_write (RFILE *stream, const void *s, int64_t len)
 
int filestream_putc (RFILE *stream, int c)
 
int filestream_vprintf (RFILE *stream, const char *format, va_list args)
 
int filestream_printf (RFILE *stream, const char *format,...)
 
int filestream_error (RFILE *stream)
 
int filestream_close (RFILE *stream)
 
int64_t filestream_read_file (const char *path, void **buf, int64_t *len)
 
bool filestream_write_file (const char *path, const void *data, int64_t size)
 
char * filestream_getline (RFILE *stream)
 

Variables

static const int64_t vfs_error_return_value = -1
 
static retro_vfs_get_path_t filestream_get_path_cb = NULL
 
static retro_vfs_open_t filestream_open_cb = NULL
 
static retro_vfs_close_t filestream_close_cb = NULL
 
static retro_vfs_size_t filestream_size_cb = NULL
 
static retro_vfs_truncate_t filestream_truncate_cb = NULL
 
static retro_vfs_tell_t filestream_tell_cb = NULL
 
static retro_vfs_seek_t filestream_seek_cb = NULL
 
static retro_vfs_read_t filestream_read_cb = NULL
 
static retro_vfs_write_t filestream_write_cb = NULL
 
static retro_vfs_flush_t filestream_flush_cb = NULL
 
static retro_vfs_remove_t filestream_remove_cb = NULL
 
static retro_vfs_rename_t filestream_rename_cb = NULL
 

Macro Definition Documentation

◆ VFS_FRONTEND

#define VFS_FRONTEND

Function Documentation

◆ filestream_close()

int filestream_close ( RFILE stream)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_delete()

int filestream_delete ( const char *  path)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_eof()

int filestream_eof ( RFILE stream)
Here is the caller graph for this function:

◆ filestream_error()

int filestream_error ( RFILE stream)
Here is the caller graph for this function:

◆ filestream_exists()

bool filestream_exists ( const char *  path)
Here is the call graph for this function:

◆ filestream_flush()

int filestream_flush ( RFILE stream)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_get_path()

const char* filestream_get_path ( RFILE stream)
Here is the call graph for this function:

◆ filestream_get_size()

int64_t filestream_get_size ( RFILE stream)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_getc()

int filestream_getc ( RFILE stream)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_getline()

char* filestream_getline ( RFILE stream)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_gets()

char* filestream_gets ( RFILE stream,
char *  s,
size_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_open()

RFILE* filestream_open ( const char *  path,
unsigned  mode,
unsigned  hints 
)

filestream_open: : path to file : file mode to use when opening (read/write) :

Opens a file for reading or writing, depending on the requested mode. Returns a pointer to an RFILE if opened successfully, otherwise NULL.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_printf()

int filestream_printf ( RFILE stream,
const char *  format,
  ... 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_putc()

int filestream_putc ( RFILE stream,
int  c 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_read()

int64_t filestream_read ( RFILE stream,
void s,
int64_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_read_file()

int64_t filestream_read_file ( const char *  path,
void **  buf,
int64_t len 
)

filestream_read_file: : path to file. : buffer to allocate and read the contents of the file into. Needs to be freed manually.

Read the contents of a file into .

Returns: number of items read, -1 on error.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_rename()

int filestream_rename ( const char *  old_path,
const char *  new_path 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_rewind()

void filestream_rewind ( RFILE stream)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_scanf()

int filestream_scanf ( RFILE stream,
const char *  format,
  ... 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_seek()

int64_t filestream_seek ( RFILE stream,
int64_t  offset,
int  seek_position 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_tell()

int64_t filestream_tell ( RFILE stream)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_truncate()

int64_t filestream_truncate ( RFILE stream,
int64_t  length 
)
Here is the call graph for this function:

◆ filestream_vfs_init()

void filestream_vfs_init ( const struct retro_vfs_interface_info vfs_info)
Here is the caller graph for this function:

◆ filestream_vprintf()

int filestream_vprintf ( RFILE stream,
const char *  format,
va_list  args 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_write()

int64_t filestream_write ( RFILE stream,
const void s,
int64_t  len 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filestream_write_file()

bool filestream_write_file ( const char *  path,
const void data,
int64_t  size 
)

filestream_write_file: : path to file. : contents to write to the file. : size of the contents.

Writes data to a file.

Returns: true (1) on success, false (0) otherwise.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ filestream_close_cb

retro_vfs_close_t filestream_close_cb = NULL
static

◆ filestream_flush_cb

retro_vfs_flush_t filestream_flush_cb = NULL
static

◆ filestream_get_path_cb

retro_vfs_get_path_t filestream_get_path_cb = NULL
static

◆ filestream_open_cb

retro_vfs_open_t filestream_open_cb = NULL
static

◆ filestream_read_cb

retro_vfs_read_t filestream_read_cb = NULL
static

◆ filestream_remove_cb

retro_vfs_remove_t filestream_remove_cb = NULL
static

◆ filestream_rename_cb

retro_vfs_rename_t filestream_rename_cb = NULL
static

◆ filestream_seek_cb

retro_vfs_seek_t filestream_seek_cb = NULL
static

◆ filestream_size_cb

retro_vfs_size_t filestream_size_cb = NULL
static

◆ filestream_tell_cb

retro_vfs_tell_t filestream_tell_cb = NULL
static

◆ filestream_truncate_cb

retro_vfs_truncate_t filestream_truncate_cb = NULL
static

◆ filestream_write_cb

retro_vfs_write_t filestream_write_cb = NULL
static

◆ vfs_error_return_value

const int64_t vfs_error_return_value = -1
static