summaryrefslogtreecommitdiff
path: root/firmware/include/file.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/include/file.h')
-rw-r--r--firmware/include/file.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/firmware/include/file.h b/firmware/include/file.h
index b60c744549..ec0ab87759 100644
--- a/firmware/include/file.h
+++ b/firmware/include/file.h
@@ -49,7 +49,7 @@
49#endif 49#endif
50 50
51#if defined(SIMULATOR) && !defined(PLUGIN) && !defined(CODEC) 51#if defined(SIMULATOR) && !defined(PLUGIN) && !defined(CODEC)
52#define open(x,y) sim_open(x,y) 52#define open(x, ...) sim_open(x, __VA_ARGS__)
53#define creat(x,m) sim_creat(x,m) 53#define creat(x,m) sim_creat(x,m)
54#define remove(x) sim_remove(x) 54#define remove(x) sim_remove(x)
55#define rename(x,y) sim_rename(x,y) 55#define rename(x,y) sim_rename(x,y)
@@ -61,16 +61,17 @@
61#define write(x,y,z) sim_write(x,y,z) 61#define write(x,y,z) sim_write(x,y,z)
62#define close(x) sim_close(x) 62#define close(x) sim_close(x)
63extern int sim_creat(const char *pathname, mode_t mode); 63extern int sim_creat(const char *pathname, mode_t mode);
64extern int sim_open(const char *pathname, int flags, ...);
64#endif 65#endif
65 66
66typedef int (*open_func)(const char* pathname, int flags); 67typedef int (*open_func)(const char* pathname, int flags, ...);
67typedef ssize_t (*read_func)(int fd, void *buf, size_t count); 68typedef ssize_t (*read_func)(int fd, void *buf, size_t count);
68typedef int (*creat_func)(const char *pathname, mode_t mode); 69typedef int (*creat_func)(const char *pathname, mode_t mode);
69typedef ssize_t (*write_func)(int fd, const void *buf, size_t count); 70typedef ssize_t (*write_func)(int fd, const void *buf, size_t count);
70typedef void (*qsort_func)(void *base, size_t nmemb, size_t size, 71typedef void (*qsort_func)(void *base, size_t nmemb, size_t size,
71 int(*_compar)(const void *, const void *)); 72 int(*_compar)(const void *, const void *));
72 73
73extern int open(const char* pathname, int flags); 74extern int file_open(const char* pathname, int flags);
74extern int close(int fd); 75extern int close(int fd);
75extern int fsync(int fd); 76extern int fsync(int fd);
76extern ssize_t read(int fd, void *buf, size_t count); 77extern ssize_t read(int fd, void *buf, size_t count);
@@ -83,6 +84,9 @@ static inline int creat(const char *pathname, mode_t mode)
83 (void)mode; 84 (void)mode;
84 return file_creat(pathname); 85 return file_creat(pathname);
85} 86}
87#if !defined(CODEC) && !defined(PLUGIN)
88#define open(x, y, ...) file_open(x,y)
89#endif
86#endif 90#endif
87extern ssize_t write(int fd, const void *buf, size_t count); 91extern ssize_t write(int fd, const void *buf, size_t count);
88extern int remove(const char* pathname); 92extern int remove(const char* pathname);