diff options
-rw-r--r-- | firmware/include/file.h | 7 | ||||
-rw-r--r-- | uisimulator/win32/Makefile.vc6 | 2 | ||||
-rw-r--r-- | uisimulator/win32/dir.h | 81 | ||||
-rw-r--r-- | uisimulator/win32/file.h | 5 | ||||
-rw-r--r-- | uisimulator/win32/sprintf.h | 29 | ||||
-rw-r--r-- | uisimulator/win32/uisw32.h | 2 |
6 files changed, 118 insertions, 8 deletions
diff --git a/firmware/include/file.h b/firmware/include/file.h index ff70c017be..6c81cb93d7 100644 --- a/firmware/include/file.h +++ b/firmware/include/file.h | |||
@@ -63,14 +63,7 @@ extern int write(int fd, void* buf, int count); | |||
63 | extern int remove(const char* pathname); | 63 | extern int remove(const char* pathname); |
64 | extern int rename(const char* path, const char* newname); | 64 | extern int rename(const char* path, const char* newname); |
65 | extern int ftruncate(int fd, unsigned int size); | 65 | extern int ftruncate(int fd, unsigned int size); |
66 | |||
67 | #else | ||
68 | #ifdef WIN32 | ||
69 | #include <io.h> | ||
70 | #include <stdio.h> | ||
71 | #endif /* WIN32 */ | ||
72 | #endif /* SIMULATOR */ | 66 | #endif /* SIMULATOR */ |
73 | |||
74 | #endif /* __MINGW32__ */ | 67 | #endif /* __MINGW32__ */ |
75 | 68 | ||
76 | #endif | 69 | #endif |
diff --git a/uisimulator/win32/Makefile.vc6 b/uisimulator/win32/Makefile.vc6 index 5391224f81..d92f18d86d 100644 --- a/uisimulator/win32/Makefile.vc6 +++ b/uisimulator/win32/Makefile.vc6 | |||
@@ -49,7 +49,7 @@ RC = rc | |||
49 | LINK = link | 49 | LINK = link |
50 | DEFINES = $(DEFINES) -DWIN32 -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR $(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"WIN32SIM\" | 50 | DEFINES = $(DEFINES) -DWIN32 -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR $(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"WIN32SIM\" |
51 | LDFLAGS = /OUT:uisw32.exe /SUBSYSTEM:windows /NOLOGO /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib | 51 | LDFLAGS = /OUT:uisw32.exe /SUBSYSTEM:windows /NOLOGO /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib |
52 | INCLUDES = -I$(FIRMWAREDIR) -I$(DRIVERS) -I$(COMMON) -I$(APPSCOMMON) -I$(SIMDIR) -I$(APPDIR) -I$(MODEL_SPECIFIC_DIR) | 52 | INCLUDES = -I$(FIRMWAREDIR)/export -I$(DRIVERS) -I$(COMMON) -I$(APPSCOMMON) -I$(SIMDIR) -I$(APPDIR) -I$(MODEL_SPECIFIC_DIR) |
53 | LIBS = /DEFAULTLIB:gdi32.lib /DEFAULTLIB:user32.lib /NODEFAULTLIB:libc.lib | 53 | LIBS = /DEFAULTLIB:gdi32.lib /DEFAULTLIB:user32.lib /NODEFAULTLIB:libc.lib |
54 | 54 | ||
55 | CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb" /c | 55 | CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb" /c |
diff --git a/uisimulator/win32/dir.h b/uisimulator/win32/dir.h new file mode 100644 index 0000000000..6b275abda8 --- /dev/null +++ b/uisimulator/win32/dir.h | |||
@@ -0,0 +1,81 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Björn Stenberg | ||
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 | #ifndef _DIR_H_ | ||
20 | #define _DIR_H_ | ||
21 | |||
22 | #include <stdbool.h> | ||
23 | #include "file.h" | ||
24 | |||
25 | #ifndef DIRENT_DEFINED | ||
26 | |||
27 | #define ATTR_READ_ONLY 0x01 | ||
28 | #define ATTR_HIDDEN 0x02 | ||
29 | #define ATTR_SYSTEM 0x04 | ||
30 | #define ATTR_VOLUME_ID 0x08 | ||
31 | #define ATTR_DIRECTORY 0x10 | ||
32 | #define ATTR_ARCHIVE 0x20 | ||
33 | |||
34 | struct dirent { | ||
35 | unsigned char d_name[MAX_PATH]; | ||
36 | int attribute; | ||
37 | int size; | ||
38 | int startcluster; | ||
39 | }; | ||
40 | #endif | ||
41 | |||
42 | |||
43 | #ifndef SIMULATOR | ||
44 | |||
45 | #include "fat.h" | ||
46 | |||
47 | typedef struct { | ||
48 | bool busy; | ||
49 | int startcluster; | ||
50 | struct fat_dir fatdir; | ||
51 | struct dirent theent; | ||
52 | } DIR; | ||
53 | |||
54 | #else // SIMULATOR | ||
55 | |||
56 | #ifdef WIN32 | ||
57 | #ifndef __MINGW32__ | ||
58 | #include <io.h> | ||
59 | #endif /* __MINGW32__ */ | ||
60 | |||
61 | typedef struct DIRtag | ||
62 | { | ||
63 | struct dirent fd; | ||
64 | int handle; | ||
65 | } DIR; | ||
66 | |||
67 | #endif /* WIN32 */ | ||
68 | |||
69 | #endif // SIMULATOR | ||
70 | |||
71 | #ifndef DIRFUNCTIONS_DEFINED | ||
72 | |||
73 | extern DIR* opendir(char* name); | ||
74 | extern int closedir(DIR* dir); | ||
75 | extern int mkdir(char* name); | ||
76 | |||
77 | extern struct dirent* readdir(DIR* dir); | ||
78 | |||
79 | #endif /* DIRFUNCTIONS_DEFINED */ | ||
80 | |||
81 | #endif | ||
diff --git a/uisimulator/win32/file.h b/uisimulator/win32/file.h index 81fe3dd86a..3cda3b9d8c 100644 --- a/uisimulator/win32/file.h +++ b/uisimulator/win32/file.h | |||
@@ -17,6 +17,8 @@ | |||
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | 19 | ||
20 | #ifndef _FILE_H_ | ||
21 | |||
20 | #include <stdio.h> | 22 | #include <stdio.h> |
21 | #include <string.h> | 23 | #include <string.h> |
22 | 24 | ||
@@ -26,3 +28,6 @@ int win32_rename(char *oldpath, char *newpath); | |||
26 | 28 | ||
27 | #include "../../firmware/include/file.h" | 29 | #include "../../firmware/include/file.h" |
28 | 30 | ||
31 | #undef rename | ||
32 | |||
33 | #endif | ||
diff --git a/uisimulator/win32/sprintf.h b/uisimulator/win32/sprintf.h new file mode 100644 index 0000000000..ecbbc8a419 --- /dev/null +++ b/uisimulator/win32/sprintf.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Felix Arends | ||
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 __SPRINTF_H__ | ||
21 | #define __SPRINTF_H__ | ||
22 | |||
23 | #include <stddef.h> | ||
24 | #include <stdarg.h> | ||
25 | |||
26 | int snprintf (char *buf, size_t size, const char *fmt, ...); | ||
27 | int vsnprintf (char *buf, int size, const char *fmt, va_list ap); | ||
28 | |||
29 | #endif /* __SPRINTF_H__ */ | ||
diff --git a/uisimulator/win32/uisw32.h b/uisimulator/win32/uisw32.h index 7b38c76987..9a95294819 100644 --- a/uisimulator/win32/uisw32.h +++ b/uisimulator/win32/uisw32.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef __UISW32_H__ | 20 | #ifndef __UISW32_H__ |
21 | #define __UISW32_H__ | 21 | #define __UISW32_H__ |
22 | 22 | ||
23 | typedef unsigned short wchar_t; | ||
24 | #define _WCHAR_T_DEFINED | ||
23 | #include <windows.h> | 25 | #include <windows.h> |
24 | #include "lcd-win32.h" | 26 | #include "lcd-win32.h" |
25 | 27 | ||