diff options
Diffstat (limited to 'firmware/include/file.h')
-rw-r--r-- | firmware/include/file.h | 10 |
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) |
63 | extern int sim_creat(const char *pathname, mode_t mode); | 63 | extern int sim_creat(const char *pathname, mode_t mode); |
64 | extern int sim_open(const char *pathname, int flags, ...); | ||
64 | #endif | 65 | #endif |
65 | 66 | ||
66 | typedef int (*open_func)(const char* pathname, int flags); | 67 | typedef int (*open_func)(const char* pathname, int flags, ...); |
67 | typedef ssize_t (*read_func)(int fd, void *buf, size_t count); | 68 | typedef ssize_t (*read_func)(int fd, void *buf, size_t count); |
68 | typedef int (*creat_func)(const char *pathname, mode_t mode); | 69 | typedef int (*creat_func)(const char *pathname, mode_t mode); |
69 | typedef ssize_t (*write_func)(int fd, const void *buf, size_t count); | 70 | typedef ssize_t (*write_func)(int fd, const void *buf, size_t count); |
70 | typedef void (*qsort_func)(void *base, size_t nmemb, size_t size, | 71 | typedef 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 | ||
73 | extern int open(const char* pathname, int flags); | 74 | extern int file_open(const char* pathname, int flags); |
74 | extern int close(int fd); | 75 | extern int close(int fd); |
75 | extern int fsync(int fd); | 76 | extern int fsync(int fd); |
76 | extern ssize_t read(int fd, void *buf, size_t count); | 77 | extern 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 |
87 | extern ssize_t write(int fd, const void *buf, size_t count); | 91 | extern ssize_t write(int fd, const void *buf, size_t count); |
88 | extern int remove(const char* pathname); | 92 | extern int remove(const char* pathname); |