RetroArch
file_stream.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2018 The RetroArch team
2  *
3  * ---------------------------------------------------------------------------------------
4  * The following license statement only applies to this file (file_stream.h).
5  * ---------------------------------------------------------------------------------------
6  *
7  * Permission is hereby granted, free of charge,
8  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation the rights to
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef __LIBRETRO_SDK_FILE_STREAM_H
24 #define __LIBRETRO_SDK_FILE_STREAM_H
25 
26 #include <stdio.h>
27 #include <stdint.h>
28 #include <stdlib.h>
29 #include <stddef.h>
30 
31 #include <sys/types.h>
32 
33 #include <libretro.h>
34 #include <retro_common_api.h>
35 #include <retro_inline.h>
36 #include <boolean.h>
37 
38 #include <stdarg.h>
39 
40 #define FILESTREAM_REQUIRED_VFS_VERSION 2
41 
43 
44 typedef struct RFILE RFILE;
45 
46 #define FILESTREAM_REQUIRED_VFS_VERSION 2
47 
48 void filestream_vfs_init(const struct retro_vfs_interface_info* vfs_info);
49 
51 
53 
63 RFILE *filestream_open(const char *path, unsigned mode, unsigned hints);
64 
65 int64_t filestream_seek(RFILE *stream, int64_t offset, int seek_position);
66 
68 
70 
72 
74 
76 
77 int64_t filestream_read_file(const char *path, void **buf, int64_t *len);
78 
79 char *filestream_gets(RFILE *stream, char *s, size_t len);
80 
82 
83 int filestream_scanf(RFILE *stream, const char* format, ...);
84 
86 
87 bool filestream_write_file(const char *path, const void *data, int64_t size);
88 
89 int filestream_putc(RFILE *stream, int c);
90 
91 int filestream_vprintf(RFILE *stream, const char* format, va_list args);
92 
93 int filestream_printf(RFILE *stream, const char* format, ...);
94 
96 
98 
99 int filestream_delete(const char *path);
100 
101 int filestream_rename(const char *old_path, const char *new_path);
102 
103 const char *filestream_get_path(RFILE *stream);
104 
105 bool filestream_exists(const char *path);
106 
108 
110 
111 #endif
int filestream_printf(RFILE *stream, const char *format,...)
Definition: file_stream.c:444
int64_t filestream_write(RFILE *stream, const void *data, int64_t len)
Definition: file_stream.c:408
GLenum mode
Definition: glext.h:6857
char * filestream_gets(RFILE *stream, char *s, size_t len)
Definition: file_stream.c:179
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
char * filestream_getline(RFILE *stream)
Definition: file_stream.c:573
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
bool filestream_write_file(const char *path, const void *data, int64_t size)
Definition: file_stream.c:555
int64_t filestream_truncate(RFILE *stream, int64_t length)
Definition: file_stream.c:133
GLsizei const GLchar ** path
Definition: glext.h:7901
GLenum GLsizei len
Definition: glext.h:7389
GLsizeiptr size
Definition: glext.h:6559
int filestream_close(RFILE *stream)
Definition: file_stream.c:461
GLdouble s
Definition: glext.h:6390
const char * filestream_get_path(RFILE *stream)
Definition: file_stream.c:400
Definition: file_stream.c:53
int64_t filestream_read(RFILE *stream, void *data, int64_t len)
Definition: file_stream.c:351
Definition: ibxm.h:9
const GLubyte * c
Definition: glext.h:9812
int filestream_scanf(RFILE *stream, const char *format,...)
Definition: file_stream.c:213
int filestream_eof(RFILE *stream)
Definition: file_stream.c:321
Definition: libretro.h:1190
int filestream_error(RFILE *stream)
Definition: file_stream.c:454
int filestream_delete(const char *path)
Definition: file_stream.c:384
int64_t filestream_read_file(const char *path, void **buf, int64_t *len)
Definition: file_stream.c:487
dictionary args
Definition: test_shaders.py:20
void filestream_rewind(RFILE *stream)
Definition: file_stream.c:342
int filestream_getc(RFILE *stream)
Definition: file_stream.c:203
bool filestream_exists(const char *path)
Definition: file_stream.c:100
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
int64_t filestream_seek(RFILE *stream, int64_t offset, int seek_position)
Definition: file_stream.c:305
void filestream_vfs_init(const struct retro_vfs_interface_info *vfs_info)
Definition: file_stream.c:62
int64_t filestream_get_size(RFILE *stream)
Definition: file_stream.c:118
GLuint GLuint stream
Definition: glext.h:8189
RFILE * filestream_open(const char *path, unsigned mode, unsigned hints)
Definition: file_stream.c:157
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glext.h:6293
signed __int64 int64_t
Definition: stdint.h:135
int filestream_putc(RFILE *stream, int c)
Definition: file_stream.c:423
int filestream_rename(const char *old_path, const char *new_path)
Definition: file_stream.c:392
int filestream_vprintf(RFILE *stream, const char *format, va_list args)
Definition: file_stream.c:431
int64_t filestream_tell(RFILE *stream)
Definition: file_stream.c:327
GLintptr offset
Definition: glext.h:6560
GLenum GLuint GLenum GLsizei length
Definition: glext.h:6233
int filestream_flush(RFILE *stream)
Definition: file_stream.c:369