RetroArch
Macros | Typedefs | Functions
file_stream.h File Reference
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>
#include <sys/types.h>
#include <libretro.h>
#include <retro_common_api.h>
#include <retro_inline.h>
#include <boolean.h>
#include <stdarg.h>
Include dependency graph for file_stream.h:

Go to the source code of this file.

Macros

#define FILESTREAM_REQUIRED_VFS_VERSION   2
 
#define FILESTREAM_REQUIRED_VFS_VERSION   2
 

Typedefs

typedef typedefRETRO_BEGIN_DECLS struct RFILE RFILE
 

Functions

void filestream_vfs_init (const struct retro_vfs_interface_info *vfs_info)
 
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)
 
int64_t filestream_seek (RFILE *stream, int64_t offset, int seek_position)
 
int64_t filestream_read (RFILE *stream, void *data, int64_t len)
 
int64_t filestream_write (RFILE *stream, const void *data, int64_t len)
 
int64_t filestream_tell (RFILE *stream)
 
void filestream_rewind (RFILE *stream)
 
int filestream_close (RFILE *stream)
 
int64_t filestream_read_file (const char *path, void **buf, int64_t *len)
 
char * filestream_gets (RFILE *stream, char *s, size_t len)
 
int filestream_getc (RFILE *stream)
 
int filestream_scanf (RFILE *stream, const char *format,...)
 
int filestream_eof (RFILE *stream)
 
bool filestream_write_file (const char *path, const void *data, int64_t size)
 
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_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)
 
bool filestream_exists (const char *path)
 
char * filestream_getline (RFILE *stream)
 

Macro Definition Documentation

◆ FILESTREAM_REQUIRED_VFS_VERSION [1/2]

#define FILESTREAM_REQUIRED_VFS_VERSION   2

◆ FILESTREAM_REQUIRED_VFS_VERSION [2/2]

#define FILESTREAM_REQUIRED_VFS_VERSION   2

Typedef Documentation

◆ RFILE

typedef typedefRETRO_BEGIN_DECLS struct RFILE RFILE

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) : optional buffer size (-1 or 0 to use default)

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

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 data,
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 data,
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: