diff options
Diffstat (limited to 'uisimulator/common/file.h')
-rw-r--r-- | uisimulator/common/file.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/uisimulator/common/file.h b/uisimulator/common/file.h new file mode 100644 index 0000000000..8d91b61831 --- /dev/null +++ b/uisimulator/common/file.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Daniel Stenberg <daniel@haxx.se> | ||
11 | * | ||
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. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef _SIM_FILE_H_ | ||
21 | #define _SIM_FILE_H_ | ||
22 | |||
23 | #ifdef WIN32 | ||
24 | #include <io.h> | ||
25 | #include <fcntl.h> | ||
26 | #else | ||
27 | #include <stdio.h> | ||
28 | #endif | ||
29 | |||
30 | #include <sys/types.h> | ||
31 | |||
32 | #ifdef WIN32 | ||
33 | #ifndef _commit | ||
34 | extern int _commit( int handle ); | ||
35 | #endif | ||
36 | #endif | ||
37 | |||
38 | int sim_open(const char *name, int opts); | ||
39 | int sim_close(int fd); | ||
40 | int sim_rename(const char *oldpath, const char *newpath); | ||
41 | int sim_filesize(int fd); | ||
42 | int sim_creat(const char *name, mode_t mode); | ||
43 | int sim_remove(const char *name); | ||
44 | |||
45 | #ifndef NO_REDEFINES_PLEASE | ||
46 | #define open(x,y) sim_open(x,y) | ||
47 | #define close(x) sim_close(x) | ||
48 | #define filesize(x) sim_filesize(x) | ||
49 | #define creat(x,y) sim_creat(x,y) | ||
50 | #define remove(x) sim_remove(x) | ||
51 | #define rename(x,y) sim_rename(x,y) | ||
52 | #ifdef WIN32 | ||
53 | #define fsync _commit | ||
54 | #endif | ||
55 | #endif | ||
56 | |||
57 | #include "../../firmware/include/file.h" | ||
58 | |||
59 | #ifndef WIN32 | ||
60 | int open(const char* pathname, int flags); | ||
61 | int close(int fd); | ||
62 | int printf(const char *format, ...); | ||
63 | int ftruncate(int fd, off_t length); | ||
64 | int fsync(int fd); | ||
65 | |||
66 | off_t lseek(int fildes, off_t offset, int whence); | ||
67 | ssize_t read(int fd, void *buf, size_t count); | ||
68 | ssize_t write(int fd, const void *buf, size_t count); | ||
69 | #endif | ||
70 | |||
71 | #endif | ||