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)
60 typedef int (*open_func
)(const char* pathname
, int flags
);
61 typedef ssize_t (*read_func
)(int fd
, void *buf
, size_t count
);
62 typedef int (*creat_func
)(const char *pathname
);
63 typedef ssize_t (*write_func
)(int fd
, const void *buf
, size_t count
);
64 typedef void (*qsort_func
)(void *base
, size_t nmemb
, size_t size
,
65 int(*_compar
)(const void *, const void *));
67 extern int open(const char* pathname
, int flags
);
68 extern int close(int fd
);
69 extern int fsync(int fd
);
70 extern ssize_t
read(int fd
, void *buf
, size_t count
);
71 extern off_t
lseek(int fildes
, off_t offset
, int whence
);
72 extern int creat(const char *pathname
);
73 extern ssize_t
write(int fd
, const void *buf
, size_t count
);
74 extern int remove(const char* pathname
);
75 extern int rename(const char* path
, const char* newname
);
76 extern int ftruncate(int fd
, off_t length
);
77 extern off_t
filesize(int fd
);
78 extern int release_files(int volume
);