1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 by Björn Stenberg
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
23 #include <sys/types.h>
25 #undef MAX_PATH /* this avoids problems when building simulator */
28 #define MAX_OPEN_FILES 11
50 #define open(x,y) sim_open(x,y)
51 #define creat(x) sim_creat(x)
52 #define remove(x) sim_remove(x)
53 #define rename(x,y) sim_rename(x,y)
54 #define filesize(x) sim_filesize(x)
55 #define fsync(x) sim_fsync(x)
56 #define ftruncate(x,y) sim_ftruncate(x,y)
57 #define lseek(x,y,z) sim_lseek(x,y,z)
58 #define read(x,y,z) sim_read(x,y,z)
59 #define write(x,y,z) sim_write(x,y,z)
60 #define close(x) sim_close(x)
63 typedef int (*open_func
)(const char* pathname
, int flags
);
64 typedef ssize_t (*read_func
)(int fd
, void *buf
, size_t count
);
65 typedef int (*creat_func
)(const char *pathname
);
66 typedef ssize_t (*write_func
)(int fd
, const void *buf
, size_t count
);
67 typedef void (*qsort_func
)(void *base
, size_t nmemb
, size_t size
,
68 int(*_compar
)(const void *, const void *));
70 extern int open(const char* pathname
, int flags
);
71 extern int close(int fd
);
72 extern int fsync(int fd
);
73 extern ssize_t
read(int fd
, void *buf
, size_t count
);
74 extern off_t
lseek(int fildes
, off_t offset
, int whence
);
75 extern int creat(const char *pathname
);
76 extern ssize_t
write(int fd
, const void *buf
, size_t count
);
77 extern int remove(const char* pathname
);
78 extern int rename(const char* path
, const char* newname
);
79 extern int ftruncate(int fd
, off_t length
);
80 extern off_t
filesize(int fd
);
81 extern int release_files(int volume
);