Added headers for the msvcrt library.
diff --git a/include/Makefile.in b/include/Makefile.in
index b4c4574..9ac5587 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -43,6 +43,23 @@
mmsystem.h \
msacm.h \
msacmdlg.h \
+ msvcrt/conio.h \
+ msvcrt/ctype.h \
+ msvcrt/direct.h \
+ msvcrt/dos.h \
+ msvcrt/fcntl.h \
+ msvcrt/io.h \
+ msvcrt/process.h \
+ msvcrt/stddef.h \
+ msvcrt/stdio.h \
+ msvcrt/stdlib.h \
+ msvcrt/string.h \
+ msvcrt/sys/stat.h \
+ msvcrt/sys/timeb.h \
+ msvcrt/sys/types.h \
+ msvcrt/sys/utime.h \
+ msvcrt/time.h \
+ msvcrt/wchar.h \
nspapi.h \
ntsecapi.h \
oaidl.h \
@@ -152,19 +169,22 @@
wtypes.h \
zmouse.h
-EXTRASUBDIRS = bitmaps wine
+EXTRASUBDIRS = bitmaps msvcrt msvcrt/sys wine
@MAKE_RULES@
install::
[ -d $(includedir) ] || $(MKDIR) $(includedir)
[ -d $(includedir)/wine ] || $(MKDIR) $(includedir)/wine
+ [ -d $(includedir)/msvcrt ] || $(MKDIR) $(includedir)/msvcrt
+ [ -d $(includedir)/msvcrt/sys ] || $(MKDIR) $(includedir)/msvcrt/sys
for f in $(INSTALLED_INCLUDES); do $(INSTALL_DATA) $(SRCDIR)/$$f $(includedir)/$$f; done
# Don't just do a rm -rf on $(includedir) -- don't want to wipe out
# anything extra the user may have put there.
uninstall::
cd $(includedir) && $(RM) $(INSTALLED_INCLUDES)
+ -rmdir $(includedir)/wine/msvcrt/sys $(includedir)/wine/msvcrt
-rmdir $(includedir)/wine $(includedir)
### Dependencies:
diff --git a/include/msvcrt/conio.h b/include/msvcrt/conio.h
new file mode 100644
index 0000000..4ded304
--- /dev/null
+++ b/include/msvcrt/conio.h
@@ -0,0 +1,58 @@
+/*
+ * Console I/O definitions
+ *
+ * Derived from the mingw header written by Colin Peters.
+ * Modified for Wine use by Jon Griffiths and Francois Gouget.
+ * This file is in the public domain.
+ */
+#ifndef __WINE_CONIO_H
+#define __WINE_CONIO_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char* _cgets(char*);
+int _cprintf(const char*,...);
+int _cputs(const char*);
+int _cscanf(const char*,...);
+int _getch(void);
+int _getche(void);
+int _kbhit(void);
+int _putch(int);
+int _ungetch(int);
+
+#ifdef _M_IX86
+int _inp(unsigned short);
+unsigned long _inpd(unsigned short);
+unsigned short _inpw(unsigned short);
+int _outp(unsigned short, int);
+unsigned long _outpd(unsigned short, unsigned long);
+unsigned short _outpw(unsigned short, unsigned short);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define cgets _cgets
+#define cprintf _cprintf
+#define cputs _cputs
+#define cscanf _cscanf
+#define getch _getch
+#define getche _getche
+#define kbhit _kbhit
+#define putch _putch
+#define ungetch _ungetch
+#ifdef _M_IX86
+#define inp _inp
+#define inpw _inpw
+#define outp _outp
+#define outpw _outpw
+#endif
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_CONIO_H */
diff --git a/include/msvcrt/ctype.h b/include/msvcrt/ctype.h
new file mode 100644
index 0000000..225f5fa
--- /dev/null
+++ b/include/msvcrt/ctype.h
@@ -0,0 +1,51 @@
+/*
+ * Character type definitions
+ *
+ * Derived from the mingw header written by Colin Peters.
+ * Modified for Wine use by Jon Griffiths and Francois Gouget.
+ * This file is in the public domain.
+ */
+#ifndef __WINE_CTYPE_H
+#define __WINE_CTYPE_H
+
+#include "msvcrt/wctype.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int MSVCRT(__isascii)(int);
+int MSVCRT(__iscsym)(int);
+int MSVCRT(__iscsymf)(int);
+int MSVCRT(__toascii)(int);
+int MSVCRT(_isctype)(int,int);
+int MSVCRT(_tolower)(int);
+int MSVCRT(_toupper)(int);
+int MSVCRT(isalnum)(int);
+int MSVCRT(isalpha)(int);
+int MSVCRT(iscntrl)(int);
+int MSVCRT(isdigit)(int);
+int MSVCRT(isgraph)(int);
+int MSVCRT(islower)(int);
+int MSVCRT(isprint)(int);
+int MSVCRT(ispunct)(int);
+int MSVCRT(isspace)(int);
+int MSVCRT(isupper)(int);
+int MSVCRT(isxdigit)(int);
+int MSVCRT(tolower)(int);
+int MSVCRT(toupper)(int);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define isascii __isascii
+#define iscsym __iscsym
+#define iscsymf __iscsymf
+#define toascii __toascii
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_CTYPE_H */
diff --git a/include/msvcrt/direct.h b/include/msvcrt/direct.h
new file mode 100644
index 0000000..ffedce9
--- /dev/null
+++ b/include/msvcrt/direct.h
@@ -0,0 +1,46 @@
+/*
+ * Path and directory definitions
+ *
+ * Derived from the mingw header written by Colin Peters.
+ * Modified for Wine use by Jon Griffiths and Francois Gouget.
+ * This file is in the public domain.
+ */
+#ifndef __WINE_DIRECT_H
+#define __WINE_DIRECT_H
+
+#include "winnt.h"
+#include "msvcrt/dos.h" /* For _getdiskfree & co */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int _chdir(const char*);
+int _chdrive(int);
+char* _getcwd(char*,int);
+char* _getdcwd(int,char*,int);
+int _getdrive(void);
+unsigned long _getdrives(void);
+int _mkdir(const char*);
+int _rmdir(const char*);
+
+int _wchdir(const WCHAR*);
+WCHAR* _wgetcwd(WCHAR*,int);
+WCHAR* _wgetdcwd(int,WCHAR*,int);
+int _wmkdir(const WCHAR*);
+int _wrmdir(const WCHAR*);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define chdir _chdir
+#define getcwd _getcwd
+#define mkdir _mkdir
+#define rmdir _rmdir
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_DIRECT_H */
diff --git a/include/msvcrt/dos.h b/include/msvcrt/dos.h
new file mode 100644
index 0000000..2ea7e14
--- /dev/null
+++ b/include/msvcrt/dos.h
@@ -0,0 +1,44 @@
+/*
+ * DOS definitions
+ *
+ * Derived from the mingw header written by Colin Peters.
+ * Modified for Wine use by Jon Griffiths and Francois Gouget.
+ * This file is in the public domain.
+ */
+#ifndef __WINE_DOS_H
+#define __WINE_DOS_H
+
+
+/* The following are also defined in io.h */
+#define _A_NORMAL 0x00000000
+#define _A_RDONLY 0x00000001
+#define _A_HIDDEN 0x00000002
+#define _A_SYSTEM 0x00000004
+#define _A_VOLID 0x00000008
+#define _A_SUBDIR 0x00000010
+#define _A_ARCH 0x00000020
+
+struct _diskfree_t {
+ unsigned int total_clusters;
+ unsigned int avail_clusters;
+ unsigned int sectors_per_cluster;
+ unsigned int bytes_per_sector;
+};
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+unsigned int _getdiskfree(unsigned int, struct _diskfree_t *);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define diskfree_t _diskfree_t
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_DOS_H */
diff --git a/include/msvcrt/fcntl.h b/include/msvcrt/fcntl.h
new file mode 100644
index 0000000..5f10aa0
--- /dev/null
+++ b/include/msvcrt/fcntl.h
@@ -0,0 +1,48 @@
+/*
+ * File definitions
+ *
+ * Derived from the mingw header written by Colin Peters.
+ * Modified for Wine use by Jon Griffiths and Francois Gouget.
+ * This file is in the public domain.
+ */
+#ifndef __WINE_FCNTL_H
+#define __WINE_FCNTL_H
+
+
+#define _O_RDONLY 0
+#define _O_WRONLY 1
+#define _O_RDWR 2
+#define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
+#define _O_APPEND 0x0008
+#define _O_RANDOM 0x0010
+#define _O_SEQUENTIAL 0x0020
+#define _O_TEMPORARY 0x0040
+#define _O_NOINHERIT 0x0080
+#define _O_CREAT 0x0100
+#define _O_TRUNC 0x0200
+#define _O_EXCL 0x0400
+#define _O_SHORT_LIVED 0x1000
+#define _O_TEXT 0x4000
+#define _O_BINARY 0x8000
+#define _O_RAW _O_BINARY
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define O_RDONLY _O_RDONLY
+#define O_WRONLY _O_WRONLY
+#define O_RDWR _O_RDWR
+#define O_ACCMODE _O_ACCMODE
+#define O_APPEND _O_APPEND
+#define O_RANDOM _O_RANDOM
+#define O_SEQENTIAL _O_SEQUENTIAL
+#define O_TEMPORARY _O_TEMPORARY
+#define O_NOINHERIT _O_NOINHERIT
+#define O_CREAT _O_CREAT
+#define O_TRUNC _O_TRUNC
+#define O_EXCL _O_EXCL
+#define O_TEXT _O_TEXT
+#define O_BINARY _O_BINARY
+#define O_RAW _O_BINARY
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_FCNTL_H */
diff --git a/include/msvcrt/io.h b/include/msvcrt/io.h
new file mode 100644
index 0000000..2d05946
--- /dev/null
+++ b/include/msvcrt/io.h
@@ -0,0 +1,148 @@
+/*
+ * System I/O definitions.
+ *
+ * Derived from the mingw header written by Colin Peters.
+ * Modified for Wine use by Jon Griffiths and Francois Gouget.
+ * This file is in the public domain.
+ */
+#ifndef __WINE_IO_H
+#define __WINE_IO_H
+
+#include "msvcrt/stdio.h" /* For FILENAME_MAX */
+#include "msvcrt/sys/types.h" /* For time_t */
+
+/* The following are also defined in dos.h */
+#define _A_NORMAL 0x00000000
+#define _A_RDONLY 0x00000001
+#define _A_HIDDEN 0x00000002
+#define _A_SYSTEM 0x00000004
+#define _A_VOLID 0x00000008
+#define _A_SUBDIR 0x00000010
+#define _A_ARCH 0x00000020
+
+typedef unsigned long _fsize_t;
+
+struct _finddata_t
+{
+ unsigned attrib;
+ MSVCRT(time_t) time_create;
+ MSVCRT(time_t) time_access;
+ MSVCRT(time_t) time_write;
+ _fsize_t size;
+ char name[MSVCRT(FILENAME_MAX)];
+};
+
+struct _finddatai64_t
+{
+ unsigned attrib;
+ MSVCRT(time_t) time_create;
+ MSVCRT(time_t) time_access;
+ MSVCRT(time_t) time_write;
+ __int64 size;
+ char name[MSVCRT(FILENAME_MAX)];
+};
+
+struct _wfinddata_t {
+ unsigned attrib;
+ MSVCRT(time_t) time_create;
+ MSVCRT(time_t) time_access;
+ MSVCRT(time_t) time_write;
+ _fsize_t size;
+ WCHAR name[MSVCRT(FILENAME_MAX)];
+};
+
+struct _wfinddatai64_t {
+ unsigned attrib;
+ MSVCRT(time_t) time_create;
+ MSVCRT(time_t) time_access;
+ MSVCRT(time_t) time_write;
+ __int64 size;
+ WCHAR name[MSVCRT(FILENAME_MAX)];
+};
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int _access(const char*,int);
+int _chmod(const char*,int);
+int _chsize(int,long);
+int _close(int);
+int _commit(int);
+int _creat(const char*,int);
+int _dup(int);
+int _dup2(int,int);
+int _eof(int);
+__int64 _filelengthi64(int);
+long _filelength(int);
+int _findclose(long);
+long _findfirst(const char*,struct _finddata_t*);
+long _findfirsti64(const char*, struct _finddatai64_t*);
+int _findnext(long,struct _finddata_t*);
+int _findnexti64(long, struct _finddatai64_t*);
+long _get_osfhandle(int);
+int _isatty(int);
+int _locking(int,int,long);
+long _lseek(int,long,int);
+__int64 _lseeki64(int,__int64,int);
+char* _mktemp(char*);
+int _open(const char*,int,...);
+int _open_osfhandle(long,int);
+int _pipe(int*,unsigned int,int);
+int _read(int,void*,unsigned int);
+int _setmode(int,int);
+int _sopen(const char*,int,int,...);
+long _tell(int);
+__int64 _telli64(int);
+int _umask(int);
+int _unlink(const char*);
+int _write(int,const void*,unsigned int);
+
+int MSVCRT(remove)(const char*);
+int MSVCRT(rename)(const char*,const char*);
+
+int _waccess(const WCHAR*,int);
+int _wchmod(const WCHAR*,int);
+int _wcreat(const WCHAR*,int);
+long _wfindfirst(const WCHAR*,struct _wfinddata_t*);
+long _wfindfirsti64(const WCHAR*, struct _wfinddatai64_t*);
+int _wfindnext(long,struct _wfinddata_t*);
+int _wfindnexti64(long, struct _wfinddatai64_t*);
+WCHAR* _wmktemp(WCHAR*);
+int _wopen(const WCHAR*,int,...);
+int _wrename(const WCHAR*,const WCHAR*);
+int _wsopen(const WCHAR*,int,int,...);
+int _wunlink(const WCHAR*);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define access _access
+#define chmod _chmod
+#define chsize _chsize
+#define close _close
+#define creat _creat
+#define dup _dup
+#define dup2 _dup2
+#define eof _eof
+#define filelength _filelength
+#define isatty _isatty
+#define locking _locking
+#define lseek _lseek
+#define mktemp _mktemp
+#define open _open
+#define read _read
+#define setmode _setmode
+#define sopen _sopen
+#define tell _tell
+#define umask _umask
+#define unlink _unlink
+#define write _write
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_IO_H */
diff --git a/include/msvcrt/process.h b/include/msvcrt/process.h
new file mode 100644
index 0000000..da09e73
--- /dev/null
+++ b/include/msvcrt/process.h
@@ -0,0 +1,118 @@
+/*
+ * Process definitions
+ *
+ * Derived from the mingw header written by Colin Peters.
+ * Modified for Wine use by Jon Griffiths and Francois Gouget.
+ * This file is in the public domain.
+ */
+#ifndef __WINE_PROCESS_H
+#define __WINE_PROCESS_H
+
+#include "winnt.h"
+
+#ifdef USE_MSVCRT_PREFIX
+#define MSVCRT(x) MSVCRT_##x
+#else
+#define MSVCRT(x) x
+#endif
+
+
+/* Process creation flags */
+#define _P_WAIT 0
+#define _P_NOWAIT 1
+#define _P_OVERLAY 2
+#define _P_NOWAITO 3
+#define _P_DETACH 4
+
+#define _WAIT_CHILD 0
+#define _WAIT_GRANDCHILD 1
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+unsigned long _beginthread(void (*)(void*),unsigned,void*);
+unsigned long _beginthreadex(void*,unsigned,unsigned __stdcall (*)(void*),void*,unsigned, unsigned*);
+int _cwait(int*,int,int);
+void _endthread(void);
+void _endthreadex(unsigned);
+int _execl(const char*,const char*,...);
+int _execle(const char*,const char*,...);
+int _execlp(const char*,const char*,...);
+int _execlpe(const char*,const char*,...);
+int _execv(const char*,char* const *);
+int _execve(const char*,char* const *,const char* const *);
+int _execvp(const char*,char* const *);
+int _execvpe(const char*,char* const *,const char* const *);
+int _getpid(void);
+int _spawnl(int,const char*,const char*,...);
+int _spawnle(int,const char*,const char*,...);
+int _spawnlp(int,const char*,const char*,...);
+int _spawnlpe(int,const char*,const char*,...);
+int _spawnv(int,const char*,const char* const *);
+int _spawnve(int,const char*,const char* const *,const char* const *);
+int _spawnvp(int,const char* ,const char* const *);
+int _spawnvpe(int,const char*,const char* const *,const char* const *);
+
+void MSVCRT(_c_exit)(void);
+void MSVCRT(_cexit)(void);
+void MSVCRT(_exit)(int);
+void MSVCRT(abort)(void);
+void MSVCRT(exit)(int);
+int MSVCRT(system)(const char*);
+
+int _wexecl(const WCHAR*,const WCHAR*,...);
+int _wexecle(const WCHAR*,const WCHAR*,...);
+int _wexeclp(const WCHAR*,const WCHAR*,...);
+int _wexeclpe(const WCHAR*,const WCHAR*,...);
+int _wexecv(const WCHAR*,const WCHAR* const *);
+int _wexecve(const WCHAR*,const WCHAR* const *,const WCHAR* const *);
+int _wexecvp(const WCHAR*,const WCHAR* const *);
+int _wexecvpe(const WCHAR*,const WCHAR* const *,const WCHAR* const *);
+int _wspawnl(int,const WCHAR*,const WCHAR*,...);
+int _wspawnle(int,const WCHAR*,const WCHAR*,...);
+int _wspawnlp(int,const WCHAR*,const WCHAR*,...);
+int _wspawnlpe(int,const WCHAR*,const WCHAR*,...);
+int _wspawnv(int,const WCHAR*,const WCHAR* const *);
+int _wspawnve(int,const WCHAR*,const WCHAR* const *,const WCHAR* const *);
+int _wspawnvp(int,const WCHAR*,const WCHAR* const *);
+int _wspawnvpe(int,const WCHAR*,const WCHAR* const *,const WCHAR* const *);
+int _wsystem(const WCHAR*);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define P_WAIT _P_WAIT
+#define P_NOWAIT _P_NOWAIT
+#define P_OVERLAY _P_OVERLAY
+#define P_NOWAITO _P_NOWAITO
+#define P_DETACH _P_DETACH
+
+#define WAIT_CHILD _WAIT_CHILD
+#define WAIT_GRANDCHILD _WAIT_GRANDCHILD
+
+#define cwait _cwait
+#define getpid _getpid
+#define execl _execl
+#define execle _execle
+#define execlp _execlp
+#define execlpe _execlpe
+#define execv _execv
+#define execve _execve
+#define execvp _execvp
+#define execvpe _execvpe
+#define spawnl _spawnl
+#define spawnle _spawnle
+#define spawnlp _spawnlp
+#define spawnlpe _spawnlpe
+#define spawnv _spawnv
+#define spawnve _spawnve
+#define spawnvp _spawnvp
+#define spawnvpe _spawnvpe
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_PROCESS_H */
diff --git a/include/msvcrt/stddef.h b/include/msvcrt/stddef.h
new file mode 100644
index 0000000..e8aee35
--- /dev/null
+++ b/include/msvcrt/stddef.h
@@ -0,0 +1,34 @@
+/*
+ * Time definitions
+ *
+ * Copyright 2000 Francois Gouget.
+ */
+#ifndef __WINE_STDDEF_H
+#define __WINE_STDDEF_H
+
+#include "winnt.h"
+
+
+typedef int ptrdiff_t;
+
+#ifndef MSVCRT_SIZE_T_DEFINED
+typedef unsigned int MSVCRT(size_t);
+#define MSVCRT_SIZE_T_DEFINED
+#endif
+
+/* Best to leave this one alone: wchar_t */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+unsigned long __threadid();
+unsigned long __threadhandle();
+#define _threadid (__threadid())
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WINE_STDDEF_H */
diff --git a/include/msvcrt/stdio.h b/include/msvcrt/stdio.h
new file mode 100644
index 0000000..ef51591
--- /dev/null
+++ b/include/msvcrt/stdio.h
@@ -0,0 +1,223 @@
+/*
+ * Standard I/O definitions.
+ *
+ * Derived from the mingw header written by Colin Peters.
+ * Modified for Wine use by Jon Griffiths and Francois Gouget.
+ * This file is in the public domain.
+ */
+#ifndef __WINE_STDIO_H
+#define __WINE_STDIO_H
+
+#include <stdarg.h>
+#include "msvcrt/wctype.h" /* For wint_t */
+
+
+/* file._flag flags */
+#define _IOREAD 0x0001
+#define _IOWRT 0x0002
+#define _IOMYBUF 0x0008
+#define _IOEOF 0x0010
+#define _IOERR 0x0020
+#define _IOSTRG 0x0040
+#define _IORW 0x0080
+#define _IOAPPEND 0x0200
+
+
+#ifndef USE_MSVCRT_PREFIX
+
+#define STDIN_FILENO 0
+#define STDOUT_FILENO 1
+#define STDERR_FILENO 2
+
+/* more file._flag flags, but these conflict with Unix */
+#define _IOFBF 0x0000
+#define _IONBF 0x0004
+#define _IOLBF 0x0040
+
+#define EOF (-1)
+#define FILENAME_MAX 260
+#define FOPEN_MAX 20
+#define L_tmpnam 260
+
+#define BUFSIZ 512
+
+#ifndef SEEK_SET
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+#endif
+
+#else
+
+/* more file._flag flags, but these conflict with Unix */
+#define MSVCRT__IOFBF 0x0000
+#define MSVCRT__IONBF 0x0004
+#define MSVCRT__IOLBF 0x0040
+
+#define MSVCRT_FILENAME_MAX 260
+
+#define MSVCRT_EOF (-1)
+
+#endif /* USE_MSVCRT_PREFIX */
+
+typedef struct MSVCRT(_iobuf)
+{
+ char* _ptr;
+ int _cnt;
+ char* _base;
+ int _flag;
+ int _file;
+ int _charbuf;
+ int _bufsiz;
+ char* _tmpfname;
+} MSVCRT(FILE);
+
+typedef long MSVCRT(fpos_t);
+
+#ifndef MSVCRT_SIZE_T_DEFINED
+typedef unsigned int MSVCRT(size_t);
+#define MSVCRT_SIZE_T_DEFINED
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+MSVCRT(FILE)* MSVCRT(__p__iob)(void);
+#define _iob (__p__iob())
+#ifndef USE_MSVCRT_PREFIX
+#define stdin (_iob+STDIN_FILENO)
+#define stdout (_iob+STDOUT_FILENO)
+#define stderr (_iob+STDERR_FILENO)
+#elif !defined(__WINE__)
+#define MSVCRT_stdin (_iob+STDIN_FILENO)
+#define MSVCRT_stdout (_iob+STDOUT_FILENO)
+#define MSVCRT_stderr (_iob+STDERR_FILENO)
+#endif /* USE_MSVCRT_PREFIX, __WINE__ */
+
+
+int _fcloseall(void);
+MSVCRT(FILE)* _fdopen(int,const char*);
+int _fgetchar(void);
+int _filbuf(MSVCRT(FILE*));
+int _fileno(MSVCRT(FILE)*);
+int _flsbuf(int,MSVCRT(FILE)*);
+int _flushall(void);
+int _fputchar(int);
+MSVCRT(FILE)* _fsopen(const char*,const char*,int);
+int _getmaxstdio(void);
+int _getw(MSVCRT(FILE)*);
+int _pclose(MSVCRT(FILE)*);
+MSVCRT(FILE)* _popen(const char*,const char*);
+int _putw(int,MSVCRT(FILE)*);
+int _rmtmp(void);
+int _setmaxstdio(int);
+int _snprintf(char*,MSVCRT(size_t),const char*,...);
+char* _tempnam(const char*,const char*);
+int _unlink(const char*);
+int _vsnprintf(char*,MSVCRT(size_t),const char*,va_list);
+
+void MSVCRT(clearerr)(MSVCRT(FILE)*);
+int MSVCRT(fclose)(MSVCRT(FILE)*);
+int MSVCRT(feof)(MSVCRT(FILE)*);
+int MSVCRT(ferror)(MSVCRT(FILE)*);
+int MSVCRT(fflush)(MSVCRT(FILE)*);
+int MSVCRT(fgetc)(MSVCRT(FILE)*);
+int MSVCRT(fgetpos)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
+char* MSVCRT(fgets)(char*,int,MSVCRT(FILE)*);
+MSVCRT(FILE)* MSVCRT(fopen)(const char*,const char*);
+int MSVCRT(fprintf)(MSVCRT(FILE)*,const char*,...);
+int MSVCRT(fputc)(int,MSVCRT(FILE)*);
+int MSVCRT(fputs)(const char*,MSVCRT(FILE)*);
+MSVCRT(size_t) MSVCRT(fread)(void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
+MSVCRT(FILE)* MSVCRT(freopen)(const char*,const char*,MSVCRT(FILE)*);
+int MSVCRT(fscanf)(MSVCRT(FILE)*,const char*,...);
+int MSVCRT(fseek)(MSVCRT(FILE)*,long,int);
+int MSVCRT(fsetpos)(MSVCRT(FILE)*,MSVCRT(fpos_t)*);
+long MSVCRT(ftell)(MSVCRT(FILE)*);
+MSVCRT(size_t) MSVCRT(fwrite)(const void*,MSVCRT(size_t),MSVCRT(size_t),MSVCRT(FILE)*);
+int MSVCRT(getc)(MSVCRT(FILE)*);
+int MSVCRT(getchar)(void);
+char* MSVCRT(gets)(char*);
+void MSVCRT(perror)(const char*);
+int MSVCRT(printf)(const char*,...);
+int MSVCRT(putc)(int,MSVCRT(FILE)*);
+int MSVCRT(putchar)(int);
+int MSVCRT(puts)(const char*);
+int MSVCRT(remove)(const char*);
+int MSVCRT(rename)(const char*,const char*);
+void MSVCRT(rewind)(MSVCRT(FILE)*);
+int MSVCRT(scanf)(const char*,...);
+void MSVCRT(setbuf)(MSVCRT(FILE)*,char*);
+int MSVCRT(setvbuf)(MSVCRT(FILE)*,char*,int,MSVCRT(size_t));
+int MSVCRT(sprintf)(char*,const char*,...);
+int MSVCRT(sscanf)(const char*,const char*,...);
+MSVCRT(FILE)* MSVCRT(tmpfile)(void);
+char* MSVCRT(tmpnam)(char*);
+int MSVCRT(ungetc)(int,MSVCRT(FILE)*);
+int MSVCRT(vfprintf)(MSVCRT(FILE)*,const char*,va_list);
+int MSVCRT(vprintf)(const char*,va_list);
+int MSVCRT(vsprintf)(char*,const char*,va_list);
+
+MSVCRT(wint_t) _fgetwchar(void);
+MSVCRT(wint_t) _fputwchar(MSVCRT(wint_t));
+WCHAR* _getws(WCHAR*);
+int _putws(const WCHAR*);
+int _snwprintf(WCHAR*,MSVCRT(size_t),const WCHAR*,...);
+int _vsnwprintf(WCHAR*,MSVCRT(size_t),const WCHAR*,va_list);
+MSVCRT(FILE)* _wfdopen(int,const WCHAR*);
+MSVCRT(FILE)* _wfopen(const WCHAR*,const WCHAR*);
+MSVCRT(FILE)* _wfreopen(const WCHAR*,const WCHAR*,MSVCRT(FILE)*);
+MSVCRT(FILE)* _wfsopen(const WCHAR*,const WCHAR*,int);
+void _wperror(const WCHAR*);
+MSVCRT(FILE)* _wpopen(const WCHAR*,const WCHAR*);
+int _wremove(const WCHAR*);
+WCHAR* _wtempnam(const WCHAR*,const WCHAR*);
+WCHAR* _wtmpnam(WCHAR*);
+
+MSVCRT(wint_t) MSVCRT(fgetwc)(MSVCRT(FILE)*);
+WCHAR* MSVCRT(fgetws)(WCHAR*,int,MSVCRT(FILE)*);
+MSVCRT(wint_t) MSVCRT(fputwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
+int MSVCRT(fputws)(const WCHAR*,MSVCRT(FILE)*);
+int MSVCRT(fwprintf)(MSVCRT(FILE)*,const WCHAR*,...);
+int MSVCRT(fputws)(const WCHAR*,MSVCRT(FILE)*);
+int MSVCRT(fwscanf)(MSVCRT(FILE)*,const WCHAR*,...);
+MSVCRT(wint_t) MSVCRT(getwc)(MSVCRT(FILE)*);
+MSVCRT(wint_t) MSVCRT(getwchar)(void);
+WCHAR* MSVCRT(getws)(WCHAR*);
+MSVCRT(wint_t) MSVCRT(putwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
+MSVCRT(wint_t) MSVCRT(putwchar)(MSVCRT(wint_t));
+int MSVCRT(putws)(const WCHAR*);
+int MSVCRT(swprintf)(WCHAR*,const WCHAR*,...);
+int MSVCRT(swscanf)(WCHAR*,const WCHAR*,...);
+MSVCRT(wint_t) MSVCRT(ungetwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
+int MSVCRT(vfwprintf)(MSVCRT(FILE)*,const WCHAR*,va_list);
+int MSVCRT(vswprintf)(WCHAR*,const WCHAR*,va_list);
+int MSVCRT(vwprintf)(const WCHAR*,va_list);
+int MSVCRT(wprintf)(const WCHAR*,...);
+int MSVCRT(wscanf)(const WCHAR*,...);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define fdopen _fdopen
+#define fgetchar _fgetchar
+#define fileno _fileno
+#define fputchar _fputchar
+#define pclose _pclose
+#define popen _popen
+#define tempnam _tempnam
+#define unlink _unlink
+
+#define fgetwchar _fgetwchar
+#define fputwchar _fputwchar
+#define getw _getw
+#define putw _putw
+#define wpopen _wpopen
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_STDIO_H */
diff --git a/include/msvcrt/stdlib.h b/include/msvcrt/stdlib.h
new file mode 100644
index 0000000..11736f9
--- /dev/null
+++ b/include/msvcrt/stdlib.h
@@ -0,0 +1,224 @@
+/*
+ * Standard library definitions
+ *
+ * Derived from the mingw header written by Colin Peters.
+ * Modified for Wine use by Jon Griffiths and Francois Gouget.
+ * This file is in the public domain.
+ */
+#ifndef __WINE_STDLIB_H
+#define __WINE_STDLIB_H
+
+#include "winnt.h"
+
+#ifdef USE_MSVCRT_PREFIX
+#define MSVCRT(x) MSVCRT_##x
+#else
+#define MSVCRT(x) x
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE -1
+#define RAND_MAX 0x7FFF
+#else
+#define MSVCRT_RAND_MAX 0x7FFF
+#endif /* USE_MSVCRT_PREFIX */
+
+#ifndef _MAX_PATH
+#define _MAX_DRIVE 3
+#define _MAX_FNAME 256
+#define _MAX_DIR _MAX_FNAME
+#define _MAX_EXT _MAX_FNAME
+#define _MAX_PATH 260
+#endif
+
+
+#ifndef MSVCRT_SIZE_T_DEFINED
+typedef unsigned int MSVCRT(size_t);
+#define MSVCRT_SIZE_T_DEFINED
+#endif
+
+typedef struct MSVCRT(_div_t) {
+ int quot;
+ int rem;
+} MSVCRT(div_t);
+
+typedef struct MSVCRT(_ldiv_t) {
+ long quot;
+ long rem;
+} MSVCRT(ldiv_t);
+
+
+#define __max(a,b) (((a) > (b)) ? (a) : (b))
+#define __min(a,b) (((a) < (b)) ? (a) : (b))
+#ifndef __cplusplus
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern unsigned int* __p__osver();
+extern unsigned int* __p__winver();
+extern unsigned int* __p__winmajor();
+extern unsigned int* __p__winminor();
+#define _osver (*__p__osver())
+#define _winver (*__p__winver())
+#define _winmajor (*__p__winmajor())
+#define _winminor (*__p__winminor())
+
+extern int* __p___argc(void);
+extern char*** __p___argv(void);
+extern WCHAR*** __p___wargv(void);
+extern char*** __p__environ(void);
+extern WCHAR*** __p__wenviron(void);
+extern int* __p___mb_cur_max(void);
+extern unsigned long* __doserrno(void);
+extern unsigned int* __p__fmode(void);
+/* FIXME: We need functions to access these:
+ * int _sys_nerr;
+ * char** _sys_errlist;
+ */
+#ifndef USE_MSVCRT_PREFIX
+#define __argc (*__p___argc())
+#define __argv (*__p___argv())
+#define __wargv (*__p___wargv())
+#define _environ (*__p__environ())
+#define _wenviron (*__p__wenviron())
+#define __mb_cur_max (*__p___mb_cur_max())
+#define _doserrno (*__doserrno())
+#define _fmode (*_fmode)
+#elif !defined(__WINE__)
+#define MSVCRT___argc (*__p___argc())
+#define MSVCRT___argv (*__p___argv())
+#define MSVCRT___wargv (*__p___wargv())
+#define MSVCRT__environ (*__p__environ())
+#define MSVCRT__wenviron (*__p__wenviron())
+#define MSVCRT___mb_cur_max (*__p___mb_cur_max())
+#define MSVCRT__doserrno (*__doserrno())
+#define MSVCRT__fmode (*_fmode())
+#endif /* USE_MSVCRT_PREFIX, __WINE__ */
+
+
+extern int* MSVCRT(_errno)(void);
+#ifndef USE_MSVCRT_PREFIX
+#define errno (*_errno())
+#elif !defined(__WINE__)
+#define MSVCRT_errno (*MSVCRT__errno())
+#endif /* USE_MSVCRT_PREFIX, __WINE__ */
+
+
+typedef int (*_onexit_t)(void);
+typedef int (*_pfunccmp_t)(const void*,const void*);
+
+
+__int64 _atoi64(const char*);
+long double _atold(const char*);
+void _beep(unsigned int,unsigned int);
+char* _ecvt(double,int,int*,int*);
+char* _fcvt(double,int,int*,int*);
+char* _fullpath(char*,const char*,MSVCRT(size_t));
+char* _gcvt(double,int,char*);
+char* _i64toa(__int64,char*,int);
+char* _itoa(int,char*,int);
+char* _ltoa(long,char*,int);
+unsigned long _lrotl(unsigned long,int);
+unsigned long _lrotr(unsigned long,int);
+void _makepath(char*,const char*,const char*,const char*,const char*);
+MSVCRT(size_t) _mbstrlen(const char*);
+_onexit_t _onexit(_onexit_t);
+int _putenv(const char*);
+unsigned int _rotl(unsigned int,int);
+unsigned int _rotr(unsigned int,int);
+void _searchenv(const char*,const char*,char*);
+int _set_error_mode(int);
+void _seterrormode(int);
+void _sleep(unsigned long);
+void _splitpath(const char*,char*,char*,char*,char*);
+long double _strtold(const char*,char**);
+void _swab(char*,char*,int);
+char* _ui64toa(unsigned __int64,char*,int);
+char* _ultoa(unsigned long,char*,int);
+
+void MSVCRT(_exit)(int);
+void MSVCRT(abort)();
+int MSVCRT(abs)(int);
+int MSVCRT(atexit)(_onexit_t);
+double MSVCRT(atof)(const char*);
+int MSVCRT(atoi)(const char*);
+long MSVCRT(atol)(const char*);
+void* MSVCRT(bsearch)(const void*,const void*,MSVCRT(size_t),MSVCRT(size_t),_pfunccmp_t);
+void* MSVCRT(calloc)(MSVCRT(size_t),MSVCRT(size_t));
+#ifdef __i386__
+LONGLONG MSVCRT(div)(int,int);
+ULONGLONG MSVCRT(ldiv)(long,long);
+#else
+MSVCRT(div_t) MSVCRT(div)(int,int);
+MSVCRT(ldiv_t) MSVCRT(ldiv)(long,long);
+#endif
+void MSVCRT(exit)(int);
+void MSVCRT(free)(void*);
+char* MSVCRT(getenv)(const char*);
+long MSVCRT(labs)(long);
+void* MSVCRT(malloc)(MSVCRT(size_t));
+int MSVCRT(mblen)(const char*,MSVCRT(size_t));
+void MSVCRT(perror)(const char*);
+void MSVCRT(qsort)(const void*,MSVCRT(size_t),MSVCRT(size_t),_pfunccmp_t);
+int MSVCRT(rand)(void);
+void* MSVCRT(realloc)(void*,MSVCRT(size_t));
+void MSVCRT(srand)(unsigned int);
+double MSVCRT(strtod)(const char*,char**);
+long MSVCRT(strtol)(const char*,char**,int);
+unsigned long MSVCRT(strtoul)(const char*,char**,int);
+int MSVCRT(system)(const char*);
+
+WCHAR* _itow(int,WCHAR*,int);
+WCHAR* _i64tow(__int64,WCHAR*,int);
+WCHAR* _ltow(long,WCHAR*,int);
+WCHAR* _ui64tow(unsigned __int64,WCHAR*,int);
+WCHAR* _ultow(unsigned long,WCHAR*,int);
+WCHAR* _wfullpath(WCHAR*,const WCHAR*,size_t);
+WCHAR* _wgetenv(const WCHAR*);
+void _wmakepath(WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*);
+void _wperror(const WCHAR*);
+int _wputenv(const WCHAR*);
+void _wsearchenv(const WCHAR*,const WCHAR*,WCHAR*);
+void _wsplitpath(const WCHAR*,WCHAR*,WCHAR*,WCHAR*,WCHAR*);
+int _wsystem(const WCHAR*);
+int _wtoi(const WCHAR*);
+__int64 _wtoi64(const WCHAR*);
+long _wtol(const WCHAR*);
+
+MSVCRT(size_t) MSVCRT(mbstowcs)(WCHAR*,const char*,MSVCRT(size_t));
+int MSVCRT(mbtowc)(WCHAR*,const char*,MSVCRT(size_t));
+double MSVCRT(wcstod)(const WCHAR*,WCHAR**);
+long MSVCRT(wcstol)(const WCHAR*,WCHAR**,int);
+MSVCRT(size_t) MSVCRT(wcstombs)(char*,const WCHAR*,MSVCRT(size_t));
+unsigned long MSVCRT(wcstoul)(const WCHAR*,WCHAR**,int);
+int MSVCRT(wctomb)(char*,WCHAR);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define environ _environ
+#define onexit_t _onexit_t
+
+#define ecvt _ecvt
+#define fcvt _fcvt
+#define gcvt _gcvt
+#define itoa _itoa
+#define ltoa _ltoa
+#define onexit _onexit
+#define putenv _putenv
+#define swab _swab
+#define ultoa _ultoa
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_STDLIB_H */
diff --git a/include/msvcrt/string.h b/include/msvcrt/string.h
new file mode 100644
index 0000000..c9c22ae
--- /dev/null
+++ b/include/msvcrt/string.h
@@ -0,0 +1,128 @@
+/*
+ * String definitions
+ *
+ * Derived from the mingw header written by Colin Peters.
+ * Modified for Wine use by Jon Griffiths and Francois Gouget.
+ * This file is in the public domain.
+ */
+#ifndef __WINE_STRING_H
+#define __WINE_STRING_H
+
+#include "winnt.h"
+
+#ifdef USE_MSVCRT_PREFIX
+#define MSVCRT(x) MSVCRT_##x
+#else
+#define MSVCRT(x) x
+#endif
+
+
+#ifndef MSVCRT_SIZE_T_DEFINED
+typedef unsigned int MSVCRT(size_t);
+#define MSVCRT_SIZE_T_DEFINED
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+unsigned char* _mbschr(const unsigned char*,unsigned int);
+unsigned char* _mbsncat(unsigned char*,const unsigned char*,MSVCRT(size_t));
+unsigned char* _mbstok(unsigned char*,unsigned char*);
+void* _memccpy(void*,const void*,int,MSVCRT(size_t));
+int _memicmp(const void*,const void*,MSVCRT(size_t));
+int _strcmpi(const char*,const char*);
+char* _strdup(const char*);
+char* _strerror(int);
+int _stricmp(const char*,const char*);
+int _stricoll(const char*,const char*);
+char* _strlwr(char*);
+int _strnicmp(const char*,const char*,MSVCRT(size_t));
+char* _strnset(char*,int,MSVCRT(size_t));
+char* _strrev(char*);
+char* _strset(char*,int);
+char* _strupr(char*);
+
+void* MSVCRT(memchr)(const void*,int,MSVCRT(size_t));
+int MSVCRT(memcmp)(const void*,const void*,MSVCRT(size_t));
+void* MSVCRT(memcpy)(void*,const void*,MSVCRT(size_t));
+void* MSVCRT(memmove)(void*,const void*,MSVCRT(size_t));
+void* MSVCRT(memset)(void*,int,MSVCRT(size_t));
+char* MSVCRT(strcat)(char*,const char*);
+char* MSVCRT(strchr)(const char*,int);
+int MSVCRT(strcmp)(const char*,const char*);
+int MSVCRT(strcoll)(const char*,const char*);
+char* MSVCRT(strcpy)(char*,const char*);
+MSVCRT(size_t) MSVCRT(strcspn)(const char*,const char*);
+char* MSVCRT(strerror)(int);
+MSVCRT(size_t) MSVCRT(strlen)(const char*);
+char* MSVCRT(strncat)(char*,const char*,MSVCRT(size_t));
+int MSVCRT(strncmp)(const char*,const char*,MSVCRT(size_t));
+char* MSVCRT(strncpy)(char*,const char*,MSVCRT(size_t));
+char* MSVCRT(strpbrk)(const char*,const char*);
+char* MSVCRT(strrchr)(const char*,int);
+MSVCRT(size_t) MSVCRT(strspn)(const char*,const char*);
+char* MSVCRT(strstr)(const char*,const char*);
+char* MSVCRT(strtok)(char*,const char*);
+MSVCRT(size_t) MSVCRT(strxfrm)(char*,const char*,MSVCRT(size_t));
+
+WCHAR* _wcsdup(const WCHAR*);
+int _wcsicmp(const WCHAR*,const WCHAR*);
+int _wcsicoll(const WCHAR*,const WCHAR*);
+WCHAR* _wcslwr(WCHAR*);
+int _wcsnicmp(const WCHAR*,const WCHAR*,MSVCRT(size_t));
+WCHAR* _wcsnset(WCHAR*,WCHAR,MSVCRT(size_t));
+WCHAR* _wcsrev(WCHAR*);
+WCHAR* _wcsset(WCHAR*,WCHAR);
+WCHAR* _wcsupr(WCHAR*);
+
+WCHAR* MSVCRT(wcscat)(WCHAR*,const WCHAR*);
+WCHAR* MSVCRT(wcschr)(const WCHAR*,WCHAR);
+int MSVCRT(wcscmp)(const WCHAR*,const WCHAR*);
+int MSVCRT(wcscoll)(const WCHAR*,const WCHAR*);
+WCHAR* MSVCRT(wcscpy)(WCHAR*,const WCHAR*);
+MSVCRT(size_t) MSVCRT(wcscspn)(const WCHAR*,const WCHAR*);
+MSVCRT(size_t) MSVCRT(wcslen)(const WCHAR*);
+WCHAR* MSVCRT(wcsncat)(WCHAR*,const WCHAR*,MSVCRT(size_t));
+int MSVCRT(wcsncmp)(const WCHAR*,const WCHAR*,MSVCRT(size_t));
+WCHAR* MSVCRT(wcsncpy)(WCHAR*,const WCHAR*,MSVCRT(size_t));
+WCHAR* MSVCRT(wcspbrk)(const WCHAR*,const WCHAR*);
+WCHAR* MSVCRT(wcsrchr)(const WCHAR*,WCHAR wcFor);
+MSVCRT(size_t) MSVCRT(wcsspn)(const WCHAR*,const WCHAR*);
+WCHAR* MSVCRT(wcsstr)(const WCHAR*,const WCHAR*);
+WCHAR* MSVCRT(wcstok)(WCHAR*,const WCHAR*);
+MSVCRT(size_t) MSVCRT(wcsxfrm)(WCHAR*,const WCHAR*,MSVCRT(size_t));
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define memccpy _memccpy
+#define memicmp _memicmp
+#define strcasecmp _strcasecmp
+#define strcmpi _strcmpi
+#define strdup _strdup
+#define stricmp _stricmp
+#define stricoll _stricoll
+#define strlwr _strlwr
+#define strncasecmp _strncasecmp
+#define strnicmp _strnicmp
+#define strnset _strnset
+#define strrev _strrev
+#define strset _strset
+#define strupr _strupr
+
+#define wcsdup _wcsdup
+#define wcsicoll _wcsicoll
+#define wcslwr _wcslwr
+#define wcsnicmp _wcsnicmp
+#define wcsnset _wcsnset
+#define wcsrev _wcsrev
+#define wcsset _wcsset
+#define wcsupr _wcsupr
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_STRING_H */
diff --git a/include/msvcrt/sys/stat.h b/include/msvcrt/sys/stat.h
new file mode 100644
index 0000000..ffc0e5d
--- /dev/null
+++ b/include/msvcrt/sys/stat.h
@@ -0,0 +1,83 @@
+/*
+ * _stat() definitions
+ *
+ * Derived from the mingw header written by Colin Peters.
+ * Modified for Wine use by Jon Griffiths and Francois Gouget.
+ * This file is in the public domain.
+ */
+#ifndef __WINE_SYS_STAT_H
+#define __WINE_SYS_STAT_H
+
+#include "msvcrt/sys/types.h"
+
+
+#define _S_IEXEC 0x0040
+#define _S_IWRITE 0x0080
+#define _S_IREAD 0x0100
+#define _S_IFIFO 0x1000
+#define _S_IFCHR 0x2000
+#define _S_IFDIR 0x4000
+#define _S_IFREG 0x8000
+#define _S_IFMT 0xF000
+
+
+struct _stat {
+ _dev_t st_dev;
+ _ino_t st_ino;
+ unsigned short st_mode;
+ short st_nlink;
+ short st_uid;
+ short st_gid;
+ _dev_t st_rdev;
+ _off_t st_size;
+ MSVCRT(time_t) st_atime;
+ MSVCRT(time_t) st_mtime;
+ MSVCRT(time_t) st_ctime;
+};
+
+struct _stati64 {
+ _dev_t st_dev;
+ _ino_t st_ino;
+ unsigned short st_mode;
+ short st_nlink;
+ short st_uid;
+ short st_gid;
+ _dev_t st_rdev;
+ __int64 st_size;
+ MSVCRT(time_t) st_atime;
+ MSVCRT(time_t) st_mtime;
+ MSVCRT(time_t) st_ctime;
+};
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int _fstat(int,struct _stat*);
+int _fstati64(int,struct _stati64*);
+int _stat(const char*,struct _stat*);
+int _stati64(const char*,struct _stati64*);
+
+int _wstat(const WCHAR*,struct _stat*);
+int _wstati64(const wchar_t*,struct _stati64*);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define S_IFMT _S_IFMT
+#define S_IFDIR _S_IFDIR
+#define S_IFCHR _S_IFCHR
+#define S_IFREG _S_IFREG
+#define S_IREAD _S_IREAD
+#define S_IWRITE _S_IWRITE
+#define S_IEXEC _S_IEXEC
+
+#define fstat _fstat
+#define stat _stat
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_SYS_STAT_H */
diff --git a/include/msvcrt/sys/timeb.h b/include/msvcrt/sys/timeb.h
new file mode 100644
index 0000000..671a4b1
--- /dev/null
+++ b/include/msvcrt/sys/timeb.h
@@ -0,0 +1,38 @@
+/*
+ * Path and directory definitions
+ *
+ * Copyright 2000 Francois Gouget.
+ */
+#ifndef __WINE_SYS_TIMEB_H
+#define __WINE_SYS_TIMEB_H
+
+#include "msvcrt/sys/types.h" /* For time_t */
+
+
+struct _timeb
+{
+ MSVCRT(time_t) time;
+ unsigned short millitm;
+ short timezone;
+ short dstflag;
+};
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void _ftime(struct _timeb*);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define timeb _timeb
+
+#define ftime _ftime
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_SYS_TIMEB_H */
diff --git a/include/msvcrt/sys/types.h b/include/msvcrt/sys/types.h
new file mode 100644
index 0000000..f2fcba2
--- /dev/null
+++ b/include/msvcrt/sys/types.h
@@ -0,0 +1,28 @@
+/*
+ * _stat() definitions
+ *
+ * Copyright 2000 Francois Gouget.
+ */
+#ifndef __WINE_SYS_TYPES_H
+#define __WINE_SYS_TYPES_H
+
+#ifdef USE_MSVCRT_PREFIX
+#define MSVCRT(x) MSVCRT_##x
+#else
+#define MSVCRT(x) x
+#endif
+
+
+typedef unsigned short _dev_t;
+typedef unsigned short _ino_t;
+typedef int _off_t;
+typedef long MSVCRT(time_t);
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define dev_t _dev_t
+#define ino_t _ino_t
+#define off_t _off_t
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_SYS_TYPES_H */
diff --git a/include/msvcrt/sys/utime.h b/include/msvcrt/sys/utime.h
new file mode 100644
index 0000000..b58e82a
--- /dev/null
+++ b/include/msvcrt/sys/utime.h
@@ -0,0 +1,40 @@
+/*
+ * Path and directory definitions
+ *
+ * Copyright 2000 Francois Gouget.
+ */
+#ifndef __WINE_SYS_UTIME_H
+#define __WINE_SYS_UTIME_H
+
+#include "winnt.h"
+#include "msvcrt/sys/types.h" /* For time_t */
+
+
+struct _utimbuf
+{
+ MSVCRT(time_t) actime;
+ MSVCRT(time_t) modtime;
+};
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int _futime(int,struct _utimbuf*);
+int _utime(const char*,struct _utimbuf*);
+
+int _wutime(const WCHAR*,struct _utimbuf*);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#ifndef USE_MSVCRT_PREFIX
+#define utimbuf _utimbuf
+
+#define utime _utime
+#endif /* USE_MSVCRT_PREFIX */
+
+#endif /* __WINE_SYS_UTIME_H */
diff --git a/include/msvcrt/time.h b/include/msvcrt/time.h
new file mode 100644
index 0000000..a83f618
--- /dev/null
+++ b/include/msvcrt/time.h
@@ -0,0 +1,66 @@
+/*
+ * Time definitions
+ *
+ * Copyright 2000 Francois Gouget.
+ */
+#ifndef __WINE_TIME_H
+#define __WINE_TIME_H
+
+#include "winnt.h"
+#include "msvcrt/sys/types.h" /* For time_t */
+
+
+#ifndef MSVCRT_SIZE_T_DEFINED
+typedef unsigned int MSVCRT(size_t);
+#define MSVCRT_SIZE_T_DEFINED
+#endif
+
+typedef long MSVCRT(clock_t);
+
+struct MSVCRT(tm) {
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+};
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* FIXME: Must do something for _daylight, _dstbias, _timezone, _tzname */
+
+
+unsigned _getsystime(struct MSVCRT(tm)*);
+unsigned _setsystime(struct MSVCRT(tm)*,unsigned);
+char* _strdate(char*);
+char* _strtime(char*);
+void _tzset(void);
+
+char* MSVCRT(asctime)(const struct MSVCRT(tm)*);
+MSVCRT(clock_t) MSVCRT(clock)(void);
+char* MSVCRT(ctime)(const MSVCRT(time_t)*);
+double MSVCRT(difftime)(MSVCRT(time_t),MSVCRT(time_t));
+struct MSVCRT(tm)* MSVCRT(gmtime)(const MSVCRT(time_t)*);
+struct MSVCRT(tm)* MSVCRT(localtime)(const MSVCRT(time_t)*);
+MSVCRT(time_t) MSVCRT(mktime)(struct MSVCRT(tm)*);
+size_t MSVCRT(strftime)(char*,size_t,const char*,const struct MSVCRT(tm)*);
+MSVCRT(time_t) MSVCRT(time)(MSVCRT(time_t)*);
+
+WCHAR* _wasctime(const struct MSVCRT(tm)*);
+MSVCRT(size_t) wcsftime(WCHAR*,MSVCRT(size_t),const WCHAR*,const struct MSVCRT(tm)*);
+WCHAR* _wctime(const MSVCRT(time_t)*);
+WCHAR* _wstrdate(WCHAR*);
+WCHAR* _wstrtime(WCHAR*);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WINE_TIME_H */
diff --git a/include/msvcrt/wchar.h b/include/msvcrt/wchar.h
new file mode 100644
index 0000000..e4c95b1
--- /dev/null
+++ b/include/msvcrt/wchar.h
@@ -0,0 +1,50 @@
+/*
+ * Unicode definitions
+ *
+ * Derived from the mingw header written by Colin Peters.
+ * Modified for Wine use by Jon Griffiths and Francois Gouget.
+ * This file is in the public domain.
+ */
+#ifndef __WINE_WCHAR_H
+#define __WINE_WCHAR_H
+
+#include "msvcrt/io.h"
+/* FIXME: does not exist yet #include "msvcrt/locale.h" */
+/* FIXME: does not exist yet #include "msvcrt/process.h" */
+#include "msvcrt/stdio.h"
+#include "msvcrt/stdlib.h"
+#include "msvcrt/string.h"
+#include "msvcrt/sys/stat.h"
+/* FIXME: does not exist yet #include "msvcrt/sys/types.h" */
+#include "msvcrt/time.h"
+#include "msvcrt/wctype.h"
+
+
+#define WCHAR_MIN 0
+#define WCHAR_MAX ((WCHAR)-1)
+
+typedef int MSVCRT(mbstate_t);
+
+#ifndef MSVCRT_SIZE_T_DEFINED
+typedef unsigned int MSVCRT(size_t);
+#define MSVCRT_SIZE_T_DEFINED
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WCHAR btowc(int);
+MSVCRT(size_t) mbrlen(const char *,MSVCRT(size_t),MSVCRT(mbstate_t)*);
+MSVCRT(size_t) mbrtowc(WCHAR*,const char*,MSVCRT(size_t),MSVCRT(mbstate_t)*);
+MSVCRT(size_t) mbsrtowcs(WCHAR*,const char**,MSVCRT(size_t),MSVCRT(mbstate_t)*);
+MSVCRT(size_t) wcrtomb(char*,WCHAR,MSVCRT(mbstate_t)*);
+MSVCRT(size_t) wcsrtombs(char*,const WCHAR**,MSVCRT(size_t),MSVCRT(mbstate_t)*);
+int wctob(MSVCRT(wint_t));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WINE_WCHAR_H */
diff --git a/include/msvcrt/wctype.h b/include/msvcrt/wctype.h
new file mode 100644
index 0000000..96aa222
--- /dev/null
+++ b/include/msvcrt/wctype.h
@@ -0,0 +1,83 @@
+/*
+ * Unicode definitions
+ *
+ * Copyright 2000 Francois Gouget.
+ */
+#ifndef __WINE_WCTYPE_H
+#define __WINE_WCTYPE_H
+
+/* FIXME: winnt.h includes 'ctype.h' which includes 'wctype.h'. So we get
+ * there but WCHAR is not defined.
+ */
+/* Some systems might have wchar_t, but we really need 16 bit characters */
+#ifndef WINE_WCHAR_DEFINED
+#ifdef WINE_UNICODE_NATIVE
+typedef wchar_t WCHAR, *PWCHAR;
+#else
+typedef unsigned short WCHAR, *PWCHAR;
+#endif
+#define WINE_WCHAR_DEFINED
+#endif
+
+#ifdef USE_MSVCRT_PREFIX
+#define MSVCRT(x) MSVCRT_##x
+#else
+#define MSVCRT(x) x
+#endif
+
+
+/* ASCII char classification table - binary compatible */
+#define _UPPER C1_UPPER
+#define _LOWER C1_LOWER
+#define _DIGIT C1_DIGIT
+#define _SPACE C1_SPACE
+#define _PUNCT C1_PUNCT
+#define _CONTROL C1_CNTRL
+#define _BLANK C1_BLANK
+#define _HEX C1_XDIGIT
+#define _LEADBYTE 0x8000
+#define _ALPHA (C1_ALPHA|_UPPER|_LOWER)
+
+#ifndef USE_MSVCRT_PREFIX
+# ifndef WEOF
+# define WEOF (WCHAR)(0xFFFF)
+# endif
+#else
+# ifndef MSVCRT_WEOF
+# define MSVCRT_WEOF (WCHAR)(0xFFFF)
+# endif
+#endif /* USE_MSVCRT_PREFIX */
+
+typedef WCHAR MSVCRT(wctype_t);
+typedef WCHAR MSVCRT(wint_t);
+
+/* FIXME: there's something to do with __p__pctype and __p__pwctype */
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int MSVCRT(is_wctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
+int MSVCRT(isleadbyte)(int);
+int MSVCRT(iswalnum)(MSVCRT(wint_t));
+int MSVCRT(iswalpha)(MSVCRT(wint_t));
+int MSVCRT(iswascii)(MSVCRT(wint_t));
+int MSVCRT(iswcntrl)(MSVCRT(wint_t));
+int MSVCRT(iswctype)(MSVCRT(wint_t),MSVCRT(wctype_t));
+int MSVCRT(iswdigit)(MSVCRT(wint_t));
+int MSVCRT(iswgraph)(MSVCRT(wint_t));
+int MSVCRT(iswlower)(MSVCRT(wint_t));
+int MSVCRT(iswprint)(MSVCRT(wint_t));
+int MSVCRT(iswpunct)(MSVCRT(wint_t));
+int MSVCRT(iswspace)(MSVCRT(wint_t));
+int MSVCRT(iswupper)(MSVCRT(wint_t));
+int MSVCRT(iswxdigit)(MSVCRT(wint_t));
+WCHAR MSVCRT(towlower)(WCHAR);
+WCHAR MSVCRT(towupper)(WCHAR);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WINE_WCTYPE_H */