[MSVCRT] Separate public headers from implementation headers

Dimitrie O. Paun dpaun at rogers.com
Sun Jun 20 15:01:41 CDT 2004


Here is the final patch.

ChangeLog
    Split the MSVCRT implementation headers from the public headers.
    Make naming conventions uniform.
    Add tests to ensure consistency between the two sets of symbols.


Index: include/winsock.h
===================================================================
RCS file: /var/cvs/wine/include/winsock.h,v
retrieving revision 1.65
diff -u -r1.65 winsock.h
--- include/winsock.h	31 Mar 2004 19:58:46 -0000	1.65
+++ include/winsock.h	20 Jun 2004 19:42:57 -0000
@@ -96,7 +96,7 @@
 #ifndef _WINSOCKAPI_
 #define _WINSOCKAPI_
 
-#if (defined(_MSC_VER) || defined(__MINGW_H)) && !defined(MSVCRT_BSD_TYPES_DEFINED)
+#if (defined(_MSC_VER) || defined(__MINGW_H)) && !defined(_BSD_TYPES_DEFINED)
 /* MinGW doesn't define the u_xxx types */
 typedef unsigned char u_char;
 typedef unsigned short u_short;
Index: include/msvcrt/conio.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/conio.h,v
retrieving revision 1.5
diff -u -r1.5 conio.h
--- include/msvcrt/conio.h	18 Jul 2003 22:57:15 -0000	1.5
+++ include/msvcrt/conio.h	20 Jun 2004 19:39:07 -0000
@@ -39,7 +39,6 @@
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
 static inline char* cgets(char* str) { return _cgets(str); }
 static inline int cputs(const char* str) { return _cputs(str); }
 static inline int getch(void) { return _getch(); }
@@ -62,6 +61,4 @@
 #define cscanf _cscanf
 #endif /* __GNUC__ */
 
-#endif /* USE_MSVCRT_PREFIX */
-
 #endif /* __WINE_CONIO_H */
Index: include/msvcrt/ctype.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/ctype.h,v
retrieving revision 1.6
diff -u -r1.6 ctype.h
--- include/msvcrt/ctype.h	26 Apr 2004 23:31:39 -0000	1.6
+++ include/msvcrt/ctype.h	20 Jun 2004 19:39:07 -0000
@@ -11,38 +11,24 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
-#ifndef USE_MSVCRT_PREFIX
-# ifndef WEOF
-#  define WEOF        (wint_t)(0xFFFF)
-# endif
-#else
-# ifndef MSVCRT_WEOF
-#  define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
-# endif
-#endif /* USE_MSVCRT_PREFIX */
+#ifndef WEOF
+#define WEOF        (wint_t)(0xFFFF)
+#endif
 
 #ifndef _WCTYPE_T_DEFINED
-typedef unsigned short  MSVCRT(wint_t);
-typedef unsigned short  MSVCRT(wctype_t);
+typedef unsigned short  wint_t;
+typedef unsigned short  wctype_t;
 #define _WCTYPE_T_DEFINED
 #endif
 
@@ -58,58 +44,56 @@
 #define _LEADBYTE     0x8000
 #define _ALPHA       (0x0100|_UPPER|_LOWER)  /* (C1_ALPHA|_UPPER|_LOWER) */
 
-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);
-
-#ifndef MSVCRT_WCTYPE_DEFINED
-#define MSVCRT_WCTYPE_DEFINED
-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));
-MSVCRT(wchar_t) MSVCRT(towlower)(MSVCRT(wchar_t));
-MSVCRT(wchar_t) MSVCRT(towupper)(MSVCRT(wchar_t));
-#endif /* MSVCRT_WCTYPE_DEFINED */
+int __isascii(int);
+int __iscsym(int);
+int __iscsymf(int);
+int __toascii(int);
+int _isctype(int,int);
+int _tolower(int);
+int _toupper(int);
+int isalnum(int);
+int isalpha(int);
+int iscntrl(int);
+int isdigit(int);
+int isgraph(int);
+int islower(int);
+int isprint(int);
+int ispunct(int);
+int isspace(int);
+int isupper(int);
+int isxdigit(int);
+int tolower(int);
+int toupper(int);
+
+#ifndef _WCTYPE_DEFINED
+#define _WCTYPE_DEFINED
+int is_wctype(wint_t,wctype_t);
+int isleadbyte(int);
+int iswalnum(wint_t);
+int iswalpha(wint_t);
+int iswascii(wint_t);
+int iswcntrl(wint_t);
+int iswctype(wint_t,wctype_t);
+int iswdigit(wint_t);
+int iswgraph(wint_t);
+int iswlower(wint_t);
+int iswprint(wint_t);
+int iswpunct(wint_t);
+int iswspace(wint_t);
+int iswupper(wint_t);
+int iswxdigit(wint_t);
+wchar_t towlower(wchar_t);
+wchar_t towupper(wchar_t);
+#endif /* _WCTYPE_DEFINED */
 
 #ifdef __cplusplus
 }
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
 static inline int isascii(int c) { return __isascii(c); }
 static inline int iscsym(int c) { return __iscsym(c); }
 static inline int iscsymf(int c) { return __iscsymf(c); }
 static inline int toascii(int c) { return __toascii(c); }
-#endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_CTYPE_H */
Index: include/msvcrt/direct.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/direct.h,v
retrieving revision 1.6
diff -u -r1.6 direct.h
--- include/msvcrt/direct.h	16 Mar 2004 19:17:11 -0000	1.6
+++ include/msvcrt/direct.h	20 Jun 2004 19:39:07 -0000
@@ -11,39 +11,31 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
-#ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
-#define MSVCRT_SIZE_T_DEFINED
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
 #endif
 
-#ifndef MSVCRT_DISKFREE_T_DEFINED
-#define MSVCRT_DISKFREE_T_DEFINED
-struct MSVCRT(_diskfree_t) {
+#ifndef _DISKFREE_T_DEFINED
+#define _DISKFREE_T_DEFINED
+struct _diskfree_t {
   unsigned int total_clusters;
   unsigned int avail_clusters;
   unsigned int sectors_per_cluster;
   unsigned int bytes_per_sector;
 };
-#endif /* MSVCRT_DISKFREE_T_DEFINED */
+#endif /* _DISKFREE_T_DEFINED */
 
 int         _chdir(const char*);
 int         _chdrive(int);
@@ -54,25 +46,23 @@
 int         _mkdir(const char*);
 int         _rmdir(const char*);
 
-#ifndef MSVCRT_WDIRECT_DEFINED
-#define MSVCRT_WDIRECT_DEFINED
-int              _wchdir(const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)* _wgetcwd(MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)* _wgetdcwd(int,MSVCRT(wchar_t)*,int);
-int              _wmkdir(const MSVCRT(wchar_t)*);
-int              _wrmdir(const MSVCRT(wchar_t)*);
-#endif /* MSVCRT_WDIRECT_DEFINED */
+#ifndef _WDIRECT_DEFINED
+#define _WDIRECT_DEFINED
+int              _wchdir(const wchar_t*);
+wchar_t* _wgetcwd(wchar_t*,int);
+wchar_t* _wgetdcwd(int,wchar_t*,int);
+int              _wmkdir(const wchar_t*);
+int              _wrmdir(const wchar_t*);
+#endif /* _WDIRECT_DEFINED */
 
 #ifdef __cplusplus
 }
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
 static inline int chdir(const char* newdir) { return _chdir(newdir); }
 static inline char* getcwd(char * buf, int size) { return _getcwd(buf, size); }
 static inline int mkdir(const char* newdir) { return _mkdir(newdir); }
 static inline int rmdir(const char* dir) { return _rmdir(dir); }
-#endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_DIRECT_H */
Index: include/msvcrt/dos.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/dos.h,v
retrieving revision 1.5
diff -u -r1.5 dos.h
--- include/msvcrt/dos.h	16 Mar 2004 19:17:11 -0000	1.5
+++ include/msvcrt/dos.h	20 Jun 2004 19:39:07 -0000
@@ -20,30 +20,28 @@
 #define _A_SUBDIR 0x00000010
 #define _A_ARCH   0x00000020
 
-#ifndef MSVCRT_DISKFREE_T_DEFINED
-#define MSVCRT_DISKFREE_T_DEFINED
-struct MSVCRT(_diskfree_t) {
+#ifndef _DISKFREE_T_DEFINED
+#define _DISKFREE_T_DEFINED
+struct _diskfree_t {
   unsigned int total_clusters;
   unsigned int avail_clusters;
   unsigned int sectors_per_cluster;
   unsigned int bytes_per_sector;
 };
-#endif /* MSVCRT_DISKFREE_T_DEFINED */
+#endif /* _DISKFREE_T_DEFINED */
 
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-unsigned int MSVCRT(_getdiskfree)(unsigned int, struct MSVCRT(_diskfree_t) *);
+unsigned int _getdiskfree(unsigned int, struct _diskfree_t *);
 
 #ifdef __cplusplus
 }
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
-#define MSVCRT(diskfree_t) MSVCRT(_diskfree_t)
-#endif /* USE_MSVCRT_PREFIX */
+#define diskfree_t _diskfree_t
 
 #endif /* __WINE_DOS_H */
Index: include/msvcrt/eh.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/eh.h,v
retrieving revision 1.7
diff -u -r1.7 eh.h
--- include/msvcrt/eh.h	18 Jul 2003 22:57:15 -0000	1.7
+++ include/msvcrt/eh.h	20 Jun 2004 19:39:07 -0000
@@ -27,14 +27,6 @@
 #error "eh.h is meant only for C++ applications"
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 struct _EXCEPTION_POINTERS;
 
 typedef void (*terminate_handler)();
@@ -43,11 +35,11 @@
 typedef void (*unexpected_function)();
 typedef void (*_se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info);
 
-terminate_function MSVCRT(set_terminate)(terminate_function func);
-unexpected_function MSVCRT(set_unexpected)(unexpected_function func);
-_se_translator_function MSVCRT(_set_se_translator)(_se_translator_function func);
+terminate_function set_terminate(terminate_function func);
+unexpected_function set_unexpected(unexpected_function func);
+_se_translator_function _set_se_translator(_se_translator_function func);
 
-void        MSVCRT(terminate)();
-void        MSVCRT(unexpected)();
+void        terminate();
+void        unexpected();
 
 #endif /* __WINE_EH_H */
Index: include/msvcrt/errno.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/errno.h,v
retrieving revision 1.5
diff -u -r1.5 errno.h
--- include/msvcrt/errno.h	18 Jul 2003 22:57:15 -0000	1.5
+++ include/msvcrt/errno.h	20 Jun 2004 19:39:07 -0000
@@ -22,57 +22,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifdef USE_MSVCRT_PREFIX
-
-#  define MSVCRT_EPERM   1
-#  define MSVCRT_ENOENT  2
-#  define MSVCRT_ESRCH   3
-#  define MSVCRT_EINTR   4
-#  define MSVCRT_EIO     5
-#  define MSVCRT_ENXIO   6
-#  define MSVCRT_E2BIG   7
-#  define MSVCRT_ENOEXEC 8
-#  define MSVCRT_EBADF   9
-#  define MSVCRT_ECHILD  10
-#  define MSVCRT_EAGAIN  11
-#  define MSVCRT_ENOMEM  12
-#  define MSVCRT_EACCES  13
-#  define MSVCRT_EFAULT  14
-#  define MSVCRT_EBUSY   16
-#  define MSVCRT_EEXIST  17
-#  define MSVCRT_EXDEV   18
-#  define MSVCRT_ENODEV  19
-#  define MSVCRT_ENOTDIR 20
-#  define MSVCRT_EISDIR  21
-#  define MSVCRT_EINVAL  22
-#  define MSVCRT_ENFILE  23
-#  define MSVCRT_EMFILE  24
-#  define MSVCRT_ENOTTY  25
-#  define MSVCRT_EFBIG   27
-#  define MSVCRT_ENOSPC  28
-#  define MSVCRT_ESPIPE  29
-#  define MSVCRT_EROFS   30
-#  define MSVCRT_EMLINK  31
-#  define MSVCRT_EPIPE   32
-#  define MSVCRT_EDOM    33
-#  define MSVCRT_ERANGE  34
-#  define MSVCRT_EDEADLK 36
-#  define MSVCRT_EDEADLOCK MSVCRT_EDEADLK
-#  define MSVCRT_ENAMETOOLONG 38
-#  define MSVCRT_ENOLCK  39
-#  define MSVCRT_ENOSYS  40
-#  define MSVCRT_ENOTEMPTY 41
-
-#else /* USE_MSVCRT_PREFIX */
-
 #  define EPERM   1
 #  define ENOENT  2
 #  define ESRCH   3
@@ -112,22 +61,16 @@
 #  define ENOSYS  40
 #  define ENOTEMPTY 41
 
-#endif /* USE_MSVCRT_PREFIX */
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-extern int* MSVCRT(_errno)(void);
+extern int* _errno(void);
 
 #ifdef __cplusplus
 }
 #endif
 
-#ifndef USE_MSVCRT_PREFIX
-# define errno        (*_errno())
-#else
-# define MSVCRT_errno (*MSVCRT__errno())
-#endif
+#define errno        (*_errno())
 
 #endif  /* __WINE_ERRNO_H */
Index: include/msvcrt/fcntl.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/fcntl.h,v
retrieving revision 1.3
diff -u -r1.3 fcntl.h
--- include/msvcrt/fcntl.h	18 Jul 2003 22:57:15 -0000	1.3
+++ include/msvcrt/fcntl.h	20 Jun 2004 19:39:07 -0000
@@ -29,7 +29,6 @@
 #define _O_RAW         _O_BINARY
 
 
-#ifndef USE_MSVCRT_PREFIX
 #define O_RDONLY    _O_RDONLY
 #define O_WRONLY    _O_WRONLY
 #define O_RDWR      _O_RDWR
@@ -45,6 +44,5 @@
 #define O_TEXT      _O_TEXT
 #define O_BINARY    _O_BINARY
 #define O_RAW       _O_BINARY
-#endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_FCNTL_H */
Index: include/msvcrt/float.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/float.h,v
retrieving revision 1.2
diff -u -r1.2 float.h
--- include/msvcrt/float.h	25 Mar 2004 23:36:14 -0000	1.2
+++ include/msvcrt/float.h	20 Jun 2004 19:39:07 -0000
@@ -12,14 +12,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
Index: include/msvcrt/io.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/io.h,v
retrieving revision 1.7
diff -u -r1.7 io.h
--- include/msvcrt/io.h	16 Mar 2004 19:17:11 -0000	1.7
+++ include/msvcrt/io.h	20 Jun 2004 19:39:07 -0000
@@ -11,18 +11,10 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -41,59 +33,59 @@
 #define _A_SUBDIR 0x00000010
 #define _A_ARCH   0x00000020
 
-#ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
-#define MSVCRT_TIME_T_DEFINED
+#ifndef _TIME_T_DEFINED
+typedef long time_t;
+#define _TIME_T_DEFINED
 #endif
 
-#ifndef MSVCRT_FSIZE_T_DEFINED
-typedef unsigned long MSVCRT(_fsize_t);
-#define MSVCRT_FSIZE_T_DEFINED
+#ifndef _FSIZE_T_DEFINED
+typedef unsigned long _fsize_t;
+#define _FSIZE_T_DEFINED
 #endif
 
-#ifndef MSVCRT_FINDDATA_T_DEFINED
-#define MSVCRT_FINDDATA_T_DEFINED
-struct MSVCRT(_finddata_t)
+#ifndef _FINDDATA_T_DEFINED
+#define _FINDDATA_T_DEFINED
+struct _finddata_t
 {
   unsigned attrib;
-  MSVCRT(time_t)   time_create;
-  MSVCRT(time_t)   time_access;
-  MSVCRT(time_t)   time_write;
-  MSVCRT(_fsize_t) size;
+  time_t   time_create;
+  time_t   time_access;
+  time_t   time_write;
+  _fsize_t size;
   char             name[260];
 };
 
-struct MSVCRT(_finddatai64_t)
+struct _finddatai64_t
 {
   unsigned attrib;
-  MSVCRT(time_t) time_create;
-  MSVCRT(time_t) time_access;
-  MSVCRT(time_t) time_write;
+  time_t time_create;
+  time_t time_access;
+  time_t time_write;
   __int64        size;
   char           name[260];
 };
-#endif /* MSVCRT_FINDDATA_T_DEFINED */
+#endif /* _FINDDATA_T_DEFINED */
 
-#ifndef MSVCRT_WFINDDATA_T_DEFINED
-#define MSVCRT_WFINDDATA_T_DEFINED
-struct MSVCRT(_wfinddata_t) {
+#ifndef _WFINDDATA_T_DEFINED
+#define _WFINDDATA_T_DEFINED
+struct _wfinddata_t {
   unsigned attrib;
-  MSVCRT(time_t)   time_create;
-  MSVCRT(time_t)   time_access;
-  MSVCRT(time_t)   time_write;
-  MSVCRT(_fsize_t) size;
-  MSVCRT(wchar_t)  name[260];
+  time_t   time_create;
+  time_t   time_access;
+  time_t   time_write;
+  _fsize_t size;
+  wchar_t  name[260];
 };
 
-struct MSVCRT(_wfinddatai64_t) {
+struct _wfinddatai64_t {
   unsigned attrib;
-  MSVCRT(time_t)  time_create;
-  MSVCRT(time_t)  time_access;
-  MSVCRT(time_t)  time_write;
+  time_t  time_create;
+  time_t  time_access;
+  time_t  time_write;
   __int64         size;
-  MSVCRT(wchar_t) name[260];
+  wchar_t name[260];
 };
-#endif /* MSVCRT_WFINDDATA_T_DEFINED */
+#endif /* _WFINDDATA_T_DEFINED */
 
 #ifdef __cplusplus
 extern "C" {
@@ -111,10 +103,10 @@
 __int64     _filelengthi64(int);
 long        _filelength(int);
 int         _findclose(long);
-long        MSVCRT(_findfirst)(const char*,struct MSVCRT(_finddata_t)*);
-long        MSVCRT(_findfirsti64)(const char*, struct MSVCRT(_finddatai64_t)*);
-int         MSVCRT(_findnext)(long,struct MSVCRT(_finddata_t)*);
-int         MSVCRT(_findnexti64)(long, struct MSVCRT(_finddatai64_t)*);
+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);
@@ -133,31 +125,30 @@
 int         _unlink(const char*);
 int         _write(int,const void*,unsigned int);
 
-int         MSVCRT(remove)(const char*);
-int         MSVCRT(rename)(const char*,const char*);
+int         remove(const char*);
+int         rename(const char*,const char*);
 
-#ifndef MSVCRT_WIO_DEFINED
-#define MSVCRT_WIO_DEFINED
-int         _waccess(const MSVCRT(wchar_t)*,int);
-int         _wchmod(const MSVCRT(wchar_t)*,int);
-int         _wcreat(const MSVCRT(wchar_t)*,int);
-long        MSVCRT(_wfindfirst)(const MSVCRT(wchar_t)*,struct MSVCRT(_wfinddata_t)*);
-long        MSVCRT(_wfindfirsti64)(const MSVCRT(wchar_t)*, struct MSVCRT(_wfinddatai64_t)*);
-int         MSVCRT(_wfindnext)(long,struct MSVCRT(_wfinddata_t)*);
-int         MSVCRT(_wfindnexti64)(long, struct MSVCRT(_wfinddatai64_t)*);
-MSVCRT(wchar_t)*_wmktemp(MSVCRT(wchar_t)*);
-int         _wopen(const MSVCRT(wchar_t)*,int,...);
-int         _wrename(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int         _wsopen(const MSVCRT(wchar_t)*,int,int,...);
-int         _wunlink(const MSVCRT(wchar_t)*);
-#endif /* MSVCRT_WIO_DEFINED */
+#ifndef _WIO_DEFINED
+#define _WIO_DEFINED
+int         _waccess(const wchar_t*,int);
+int         _wchmod(const wchar_t*,int);
+int         _wcreat(const wchar_t*,int);
+long        _wfindfirst(const wchar_t*,struct _wfinddata_t*);
+long        _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
+int         _wfindnext(long,struct _wfinddata_t*);
+int         _wfindnexti64(long, struct _wfinddatai64_t*);
+wchar_t*_wmktemp(wchar_t*);
+int         _wopen(const wchar_t*,int,...);
+int         _wrename(const wchar_t*,const wchar_t*);
+int         _wsopen(const wchar_t*,int,int,...);
+int         _wunlink(const wchar_t*);
+#endif /* _WIO_DEFINED */
 
 #ifdef __cplusplus
 }
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
 static inline int access(const char* path, int mode) { return _access(path, mode); }
 static inline int chmod(const char* path, int mode) { return _chmod(path, mode); }
 static inline int chsize(int fd, long size) { return _chsize(fd, size); }
@@ -174,13 +165,13 @@
 static inline int read(int fd, void* buf, unsigned int size) { return _read(fd, buf, size); }
 static inline int setmode(int fd, int mode) { return _setmode(fd, mode); }
 static inline long tell(int fd) { return _tell(fd); }
-#ifndef MSVCRT_UMASK_DEFINED
+#ifndef _UMASK_DEFINED
 static inline int umask(int fd) { return _umask(fd); }
-#define MSVCRT_UMASK_DEFINED
+#define _UMASK_DEFINED
 #endif
-#ifndef MSVCRT_UNLINK_DEFINED
+#ifndef _UNLINK_DEFINED
 static inline int unlink(const char* path) { return _unlink(path); }
-#define MSVCRT_UNLINK_DEFINED
+#define _UNLINK_DEFINED
 #endif
 static inline int write(int fd, const void* buf, unsigned int size) { return _write(fd, buf, size); }
 
@@ -192,6 +183,4 @@
 #define sopen _sopen
 #endif /* __GNUC__ */
 
-#endif /* USE _MSVCRT_PREFIX */
-
 #endif /* __WINE_IO_H */
Index: include/msvcrt/locale.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/locale.h,v
retrieving revision 1.5
diff -u -r1.5 locale.h
--- include/msvcrt/locale.h	18 Jul 2003 22:57:15 -0000	1.5
+++ include/msvcrt/locale.h	20 Jun 2004 19:39:07 -0000
@@ -23,31 +23,13 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
-#ifdef USE_MSVCRT_PREFIX
-#define MSVCRT_LC_ALL          0
-#define MSVCRT_LC_COLLATE      1
-#define MSVCRT_LC_CTYPE        2
-#define MSVCRT_LC_MONETARY     3
-#define MSVCRT_LC_NUMERIC      4
-#define MSVCRT_LC_TIME         5
-#define MSVCRT_LC_MIN          MSVCRT_LC_ALL
-#define MSVCRT_LC_MAX          MSVCRT_LC_TIME
-#else
 #define LC_ALL                 0
 #define LC_COLLATE             1
 #define LC_CTYPE               2
@@ -56,11 +38,10 @@
 #define LC_TIME                5
 #define LC_MIN                 LC_ALL
 #define LC_MAX                 LC_TIME
-#endif /* USE_MSVCRT_PREFIX */
 
-#ifndef MSVCRT_LCONV_DEFINED
-#define MSVCRT_LCONV_DEFINED
-struct MSVCRT(lconv)
+#ifndef _LCONV_DEFINED
+#define _LCONV_DEFINED
+struct lconv
 {
     char* decimal_point;
     char* thousands_sep;
@@ -81,20 +62,20 @@
     char p_sign_posn;
     char n_sign_posn;
 };
-#endif /* MSVCRT_LCONV_DEFINED */
+#endif /* _LCONV_DEFINED */
 
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-char*       MSVCRT(setlocale)(int,const char*);
-struct MSVCRT(lconv)* MSVCRT(localeconv)(void);
+char*       setlocale(int,const char*);
+struct lconv* localeconv(void);
 
-#ifndef MSVCRT_WLOCALE_DEFINED
-#define MSVCRT_WLOCALE_DEFINED
-MSVCRT(wchar_t)* _wsetlocale(int,const MSVCRT(wchar_t)*);
-#endif /* MSVCRT_WLOCALE_DEFINED */
+#ifndef _WLOCALE_DEFINED
+#define _WLOCALE_DEFINED
+wchar_t* _wsetlocale(int,const wchar_t*);
+#endif /* _WLOCALE_DEFINED */
 
 #ifdef __cplusplus
 }
Index: include/msvcrt/malloc.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/malloc.h,v
retrieving revision 1.7
diff -u -r1.7 malloc.h
--- include/msvcrt/malloc.h	18 Jul 2003 22:57:15 -0000	1.7
+++ include/msvcrt/malloc.h	20 Jun 2004 19:39:07 -0000
@@ -23,14 +23,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 /* heap function constants */
 #define _HEAPEMPTY    -1
 #define _HEAPOK       -2
@@ -43,48 +35,46 @@
 #define _USEDENTRY     1
 
 
-#ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
-#define MSVCRT_SIZE_T_DEFINED
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
 #endif
 
-#ifndef MSVCRT_HEAPINFO_DEFINED
-#define MSVCRT_HEAPINFO_DEFINED
+#ifndef _HEAPINFO_DEFINED
+#define _HEAPINFO_DEFINED
 typedef struct _heapinfo
 {
   int*           _pentry;
-  MSVCRT(size_t) _size;
+  size_t _size;
   int            _useflag;
 } _HEAPINFO;
-#endif /* MSVCRT_HEAPINFO_DEFINED */
+#endif /* _HEAPINFO_DEFINED */
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-void*       _expand(void*,MSVCRT(size_t));
-int         _heapadd(void*,MSVCRT(size_t));
+void*       _expand(void*,size_t);
+int         _heapadd(void*,size_t);
 int         _heapchk(void);
 int         _heapmin(void);
 int         _heapset(unsigned int);
-MSVCRT(size_t) _heapused(MSVCRT(size_t)*,MSVCRT(size_t)*);
+size_t _heapused(size_t*,size_t*);
 int         _heapwalk(_HEAPINFO*);
-MSVCRT(size_t) _msize(void*);
+size_t _msize(void*);
 
-void*       MSVCRT(calloc)(MSVCRT(size_t),MSVCRT(size_t));
-void        MSVCRT(free)(void*);
-void*       MSVCRT(malloc)(MSVCRT(size_t));
-void*       MSVCRT(realloc)(void*,MSVCRT(size_t));
+void*       calloc(size_t,size_t);
+void        free(void*);
+void*       malloc(size_t);
+void*       realloc(void*,size_t);
 
 #ifdef __cplusplus
 }
 #endif
 
-#ifndef USE_MSVCRT_PREFIX
 # ifdef __GNUC__
 # define _alloca(x) __builtin_alloca((x))
 # define alloca(x) __builtin_alloca((x))
 # endif
-#endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_MALLOC_H */
Index: include/msvcrt/math.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/math.h,v
retrieving revision 1.3
diff -u -r1.3 math.h
--- include/msvcrt/math.h	9 Apr 2004 19:02:45 -0000	1.3
+++ include/msvcrt/math.h	20 Jun 2004 19:39:07 -0000
@@ -12,14 +12,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -31,9 +23,9 @@
 #define _TLOSS          5       /* total loss of precision */
 #define _PLOSS          6       /* partial loss of precision */
 
-#ifndef MSVCRT_EXCEPTION_DEFINED
-#define MSVCRT_EXCEPTION_DEFINED
-struct MSVCRT(_exception)
+#ifndef _EXCEPTION_DEFINED
+#define _EXCEPTION_DEFINED
+struct _exception
 {
   int     type;
   char    *name;
@@ -41,16 +33,16 @@
   double  arg2;
   double  retval;
 };
-#endif /* MSVCRT_EXCEPTION_DEFINED */
+#endif /* _EXCEPTION_DEFINED */
 
-#ifndef MSVCRT_COMPLEX_DEFINED
-#define MSVCRT_COMPLEX_DEFINED
-struct MSVCRT(_complex)
+#ifndef _COMPLEX_DEFINED
+#define _COMPLEX_DEFINED
+struct _complex
 {
   double x;      /* Real part */
   double y;      /* Imaginary part */
 };
-#endif /* MSVCRT_COMPLEX_DEFINED */
+#endif /* _COMPLEX_DEFINED */
 
 double sin(double);
 double cos(double);
@@ -83,8 +75,8 @@
 double y1(double);
 double yn(int, double);
 
-int MSVCRT(_matherr)(struct MSVCRT(_exception)*);
-double MSVCRT(_cabs)(struct MSVCRT(_complex));
+int _matherr(struct _exception*);
+double _cabs(struct _complex);
 
 #ifndef HUGE_VAL
 #  if defined(__GNUC__) && (__GNUC__ >= 3)
Index: include/msvcrt/mbctype.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/mbctype.h,v
retrieving revision 1.4
diff -u -r1.4 mbctype.h
--- include/msvcrt/mbctype.h	18 Jul 2003 22:57:15 -0000	1.4
+++ include/msvcrt/mbctype.h	20 Jun 2004 19:39:07 -0000
@@ -42,13 +42,13 @@
 int         _ismbbpunct(unsigned int);
 int         _setmbcp(int);
 
-#ifndef MSVCRT_MBLEADTRAIL_DEFINED
-#define MSVCRT_MBLEADTRAIL_DEFINED
+#ifndef _MBLEADTRAIL_DEFINED
+#define _MBLEADTRAIL_DEFINED
 int         _ismbblead(unsigned int);
 int         _ismbbtrail(unsigned int);
 int         _ismbslead(const unsigned char*,const unsigned char*);
 int         _ismbstrail(const unsigned char*,const unsigned char*);
-#endif /* MSVCRT_MBLEADTRAIL_DEFINED */
+#endif /* _MBLEADTRAIL_DEFINED */
 
 #ifdef __cplusplus
 }
Index: include/msvcrt/mbstring.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/mbstring.h,v
retrieving revision 1.4
diff -u -r1.4 mbstring.h
--- include/msvcrt/mbstring.h	18 Jul 2003 22:57:15 -0000	1.4
+++ include/msvcrt/mbstring.h	20 Jun 2004 19:39:07 -0000
@@ -23,22 +23,14 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
 #endif
 
-#ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
-#define MSVCRT_SIZE_T_DEFINED
-#endif
-
-#ifndef MSVCRT_NLSCMP_DEFINED
+#ifndef _NLSCMP_DEFINED
 #define _NLSCMPERROR               ((unsigned int)0x7fffffff)
-#define MSVCRT_NLSCMP_DEFINED
+#define _NLSCMP_DEFINED
 #endif
 
 #ifdef __cplusplus
@@ -67,64 +59,64 @@
 void        _mbccpy(unsigned char*,const unsigned char*);
 unsigned int _mbcjistojms(unsigned int);
 unsigned int _mbcjmstojis(unsigned int);
-MSVCRT(size_t) _mbclen(const unsigned char*);
+size_t _mbclen(const unsigned char*);
 unsigned int _mbctohira(unsigned int);
 unsigned int _mbctokata(unsigned int);
 unsigned int _mbctolower(unsigned int);
 unsigned int _mbctombb(unsigned int);
 unsigned int _mbctoupper(unsigned int);
-int         _mbsbtype(const unsigned char*,MSVCRT(size_t));
+int         _mbsbtype(const unsigned char*,size_t);
 unsigned char* _mbscat(unsigned char*,const unsigned char*);
 unsigned char* _mbschr(const unsigned char*,unsigned int);
 int         _mbscmp(const unsigned char*,const unsigned char*);
 int         _mbscoll(const unsigned char*,const unsigned char*);
 unsigned char* _mbscpy(unsigned char*,const unsigned char*);
-MSVCRT(size_t) _mbscspn(const unsigned char*,const unsigned char*);
+size_t _mbscspn(const unsigned char*,const unsigned char*);
 unsigned char* _mbsdec(const unsigned char*,const unsigned char*);
 unsigned char* _mbsdup(const unsigned char*);
 int         _mbsicmp(const unsigned char*,const unsigned char*);
 int         _mbsicoll(const unsigned char*,const unsigned char*);
 unsigned char* _mbsinc(const unsigned char*);
-MSVCRT(size_t) _mbslen(const unsigned char*);
+size_t _mbslen(const unsigned char*);
 unsigned char* _mbslwr(unsigned char*);
-unsigned char* _mbsnbcat(unsigned char*,const unsigned char*,MSVCRT(size_t));
-int         _mbsnbcmp(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-int         _mbsnbcoll(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-MSVCRT(size_t) _mbsnbcnt(const unsigned char*,MSVCRT(size_t));
+unsigned char* _mbsnbcat(unsigned char*,const unsigned char*,size_t);
+int         _mbsnbcmp(const unsigned char*,const unsigned char*,size_t);
+int         _mbsnbcoll(const unsigned char*,const unsigned char*,size_t);
+size_t _mbsnbcnt(const unsigned char*,size_t);
 unsigned char* _mbsnbcpy(unsigned char*,const unsigned char*
-,MSVCRT(size_t));
-int         _mbsnbicmp(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-int         _mbsnbicoll(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-unsigned char* _mbsnbset(unsigned char*,unsigned int,MSVCRT(size_t))
+,size_t);
+int         _mbsnbicmp(const unsigned char*,const unsigned char*,size_t);
+int         _mbsnbicoll(const unsigned char*,const unsigned char*,size_t);
+unsigned char* _mbsnbset(unsigned char*,unsigned int,size_t)
 ;
 unsigned char* _mbsncat(unsigned char*,const unsigned char*,
- MSVCRT(size_t));
-MSVCRT(size_t) _mbsnccnt(const unsigned char*,MSVCRT(size_t));
-int         _mbsncmp(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-int         _mbsncoll(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-unsigned char* _mbsncpy(unsigned char*,const unsigned char*,MSVCRT(size_t));
+ size_t);
+size_t _mbsnccnt(const unsigned char*,size_t);
+int         _mbsncmp(const unsigned char*,const unsigned char*,size_t);
+int         _mbsncoll(const unsigned char*,const unsigned char*,size_t);
+unsigned char* _mbsncpy(unsigned char*,const unsigned char*,size_t);
 unsigned int _mbsnextc (const unsigned char*);
-int         _mbsnicmp(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-int         _mbsnicoll(const unsigned char*,const unsigned char*,MSVCRT(size_t));
-unsigned char* _mbsninc(const unsigned char*,MSVCRT(size_t));
-unsigned char* _mbsnset(unsigned char*,unsigned int,MSVCRT(size_t));
+int         _mbsnicmp(const unsigned char*,const unsigned char*,size_t);
+int         _mbsnicoll(const unsigned char*,const unsigned char*,size_t);
+unsigned char* _mbsninc(const unsigned char*,size_t);
+unsigned char* _mbsnset(unsigned char*,unsigned int,size_t);
 unsigned char* _mbspbrk(const unsigned char*,const unsigned char*);
 unsigned char* _mbsrchr(const unsigned char*,unsigned int);
 unsigned char* _mbsrev(unsigned char*);
 unsigned char* _mbsset(unsigned char*,unsigned int);
-MSVCRT(size_t) _mbsspn(const unsigned char*,const unsigned char*);
+size_t _mbsspn(const unsigned char*,const unsigned char*);
 unsigned char* _mbsspnp(const unsigned char*,const unsigned char*);
 unsigned char* _mbsstr(const unsigned char*,const unsigned char*);
 unsigned char* _mbstok(unsigned char*,const unsigned char*);
 unsigned char* _mbsupr(unsigned char*);
 
-#ifndef MSVCRT_MBLEADTRAIL_DEFINED
-#define MSVCRT_MBLEADTRAIL_DEFINED
+#ifndef _MBLEADTRAIL_DEFINED
+#define _MBLEADTRAIL_DEFINED
 int         _ismbblead(unsigned int);
 int         _ismbbtrail(unsigned int);
 int         _ismbslead(const unsigned char*,const unsigned char*);
 int         _ismbstrail(const unsigned char*,const unsigned char*);
-#endif /* MSVCRT_MBLEADTRAIL_DEFINED */
+#endif /* _MBLEADTRAIL_DEFINED */
 
 #ifdef __cplusplus
 }
Index: include/msvcrt/process.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/process.h,v
retrieving revision 1.10
diff -u -r1.10 process.h
--- include/msvcrt/process.h	18 Jul 2003 22:57:15 -0000	1.10
+++ include/msvcrt/process.h	20 Jun 2004 19:39:07 -0000
@@ -11,18 +11,10 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -80,40 +72,39 @@
 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*);
-
-#ifndef MSVCRT_WPROCESS_DEFINED
-#define MSVCRT_WPROCESS_DEFINED
-int         _wexecl(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexecle(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexeclp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexeclpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexecv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wexecve(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wexecvp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wexecvpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wspawnl(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnle(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnlp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnlpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnv(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wspawnve(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wspawnvp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wspawnvpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wsystem(const MSVCRT(wchar_t)*);
-#endif /* MSVCRT_WPROCESS_DEFINED */
+void        _c_exit(void);
+void        _cexit(void);
+void        _exit(int);
+void        abort(void);
+void        exit(int);
+int         system(const char*);
+
+#ifndef _WPROCESS_DEFINED
+#define _WPROCESS_DEFINED
+int         _wexecl(const wchar_t*,const wchar_t*,...);
+int         _wexecle(const wchar_t*,const wchar_t*,...);
+int         _wexeclp(const wchar_t*,const wchar_t*,...);
+int         _wexeclpe(const wchar_t*,const wchar_t*,...);
+int         _wexecv(const wchar_t*,const wchar_t* const *);
+int         _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wexecvp(const wchar_t*,const wchar_t* const *);
+int         _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wspawnl(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnle(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnlp(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnlpe(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnv(int,const wchar_t*,const wchar_t* const *);
+int         _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wspawnvp(int,const wchar_t*,const wchar_t* const *);
+int         _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wsystem(const wchar_t*);
+#endif /* _WPROCESS_DEFINED */
 
 #ifdef __cplusplus
 }
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
 #define P_WAIT          _P_WAIT
 #define P_NOWAIT        _P_NOWAIT
 #define P_OVERLAY       _P_OVERLAY
@@ -154,6 +145,4 @@
 #define spawnlpe _spawnlpe
 #endif  /* __GNUC__ */
 
-#endif /* USE_MSVCRT_PREFIX */
-
 #endif /* __WINE_PROCESS_H */
Index: include/msvcrt/search.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/search.h,v
retrieving revision 1.7
diff -u -r1.7 search.h
--- include/msvcrt/search.h	18 Jul 2003 22:57:15 -0000	1.7
+++ include/msvcrt/search.h	20 Jun 2004 19:39:07 -0000
@@ -23,17 +23,9 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
-#define MSVCRT_SIZE_T_DEFINED
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
 #endif
 
 
@@ -45,9 +37,9 @@
                    int (*)(const void*,const void*));
 void*       _lsearch(const void*,void*,unsigned int*,unsigned int,
                      int (*)(const void*,const void*));
-void*       MSVCRT(bsearch)(const void*,const void*,MSVCRT(size_t),MSVCRT(size_t),
+void*       bsearch(const void*,const void*,size_t,size_t,
                             int (*)(const void*,const void*));
-void        MSVCRT(qsort)(void*,MSVCRT(size_t),MSVCRT(size_t),
+void        qsort(void*,size_t,size_t,
                           int (*)(const void*,const void*));
 
 #ifdef __cplusplus
@@ -55,9 +47,7 @@
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
 static inline void* lfind(const void* match, const void* start, unsigned int* array_size, unsigned int elem_size, int (*cf)(const void*,const void*)) { return _lfind(match, start, array_size, elem_size, cf); }
 static inline void* lsearch(const void* match, void* start, unsigned int* array_size, unsigned int elem_size, int (*cf)(const void*,const void*) ) { return _lsearch(match, start, array_size, elem_size, cf); }
-#endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_SEARCH_H */
Index: include/msvcrt/setjmp.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/setjmp.h,v
retrieving revision 1.5
diff -u -r1.5 setjmp.h
--- include/msvcrt/setjmp.h	18 Jul 2003 22:57:15 -0000	1.5
+++ include/msvcrt/setjmp.h	20 Jun 2004 19:39:07 -0000
@@ -23,15 +23,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-
 #ifdef __i386__
 
 typedef struct __JUMP_BUFFER
@@ -52,30 +43,22 @@
 
 #endif /* __i386__ */
 
-#ifndef USE_MSVCRT_PREFIX
 #define _JBLEN                     16
 #define _JBTYPE                    int
 typedef _JBTYPE                    jmp_buf[_JBLEN];
-#else
-#define MSVCRT__JBLEN              16
-#define MSVCRT__JBTYPE             int
-typedef MSVCRT__JBTYPE             MSVCRT_jmp_buf[MSVCRT__JBLEN];
-#endif
 
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-int         MSVCRT(_setjmp)(MSVCRT(jmp_buf));
-int         MSVCRT(longjmp)(MSVCRT(jmp_buf),int);
+int         _setjmp(jmp_buf);
+int         longjmp(jmp_buf,int);
 
 #ifdef __cplusplus
 }
 #endif
 
-#ifndef USE_MSVCRT_PREFIX
 #define setjmp _setjmp
-#endif
 
 #endif /* __WINE_SETJMP_H */
Index: include/msvcrt/stddef.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/stddef.h,v
retrieving revision 1.7
diff -u -r1.7 stddef.h
--- include/msvcrt/stddef.h	18 Jul 2003 22:57:15 -0000	1.7
+++ include/msvcrt/stddef.h	20 Jun 2004 19:39:08 -0000
@@ -23,29 +23,21 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
-#ifndef MSVCRT_PTRDIFF_T_DEFINED
+#ifndef _PTRDIFF_T_DEFINED
 typedef int ptrdiff_t;
-#define MSVCRT_PTRDIFF_T_DEFINED
+#define _PTRDIFF_T_DEFINED
 #endif
 
-#ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
-#define MSVCRT_SIZE_T_DEFINED
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
 #endif
 
 #ifndef NULL
Index: include/msvcrt/stdio.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/stdio.h,v
retrieving revision 1.19
diff -u -r1.19 stdio.h
--- include/msvcrt/stdio.h	12 May 2004 00:12:26 -0000	1.19
+++ include/msvcrt/stdio.h	20 Jun 2004 19:39:08 -0000
@@ -15,16 +15,7 @@
 #include <stdarg.h>
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 /* file._flag flags */
-#ifndef USE_MSVCRT_PREFIX
 #define _IOREAD          0x0001
 #define _IOWRT           0x0002
 #define _IOMYBUF         0x0008
@@ -32,15 +23,6 @@
 #define _IOERR           0x0020
 #define _IOSTRG          0x0040
 #define _IORW            0x0080
-#else
-#define MSVCRT__IOREAD   0x0001
-#define MSVCRT__IOWRT    0x0002
-#define MSVCRT__IOMYBUF  0x0008
-#define MSVCRT__IOEOF    0x0010
-#define MSVCRT__IOERR    0x0020
-#define MSVCRT__IOSTRG   0x0040
-#define MSVCRT__IORW     0x0080
-#endif /* USE_MSVCRT_PREFIX */
 
 #ifndef NULL
 #ifdef  __cplusplus
@@ -50,8 +32,6 @@
 #endif
 #endif
 
-#ifndef USE_MSVCRT_PREFIX
-
 #define STDIN_FILENO  0
 #define STDOUT_FILENO 1
 #define STDERR_FILENO 2
@@ -75,29 +55,9 @@
 #define SEEK_END  2
 #endif
 
-#else
-
-#define MSVCRT_STDIN_FILENO  0
-#define MSVCRT_STDOUT_FILENO 1
-#define MSVCRT_STDERR_FILENO 2
-
-/* 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_TMP_MAX   0x7fff
-
-#define MSVCRT_EOF       (-1)
-
-#define MSVCRT_BUFSIZ    512
-
-#endif /* USE_MSVCRT_PREFIX */
-
-#ifndef MSVCRT_FILE_DEFINED
-#define MSVCRT_FILE_DEFINED
-typedef struct MSVCRT(_iobuf)
+#ifndef _FILE_DEFINED
+#define _FILE_DEFINED
+typedef struct _iobuf
 {
   char* _ptr;
   int   _cnt;
@@ -107,29 +67,29 @@
   int   _charbuf;
   int   _bufsiz;
   char* _tmpfname;
-} MSVCRT(FILE);
-#endif  /* MSVCRT_FILE_DEFINED */
+} FILE;
+#endif  /* _FILE_DEFINED */
 
-#ifndef MSVCRT_FPOS_T_DEFINED
-typedef long MSVCRT(fpos_t);
-#define MSVCRT_FPOS_T_DEFINED
+#ifndef _FPOS_T_DEFINED
+typedef long fpos_t;
+#define _FPOS_T_DEFINED
 #endif
 
-#ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
-#define MSVCRT_SIZE_T_DEFINED
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
 #endif
 
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
 #ifndef _WCTYPE_T_DEFINED
-typedef unsigned short  MSVCRT(wint_t);
-typedef unsigned short  MSVCRT(wctype_t);
+typedef unsigned short  wint_t;
+typedef unsigned short  wctype_t;
 #define _WCTYPE_T_DEFINED
 #endif
 
@@ -137,153 +97,145 @@
 extern "C" {
 #endif
 
-#ifndef MSVCRT_STDIO_DEFINED
-MSVCRT(FILE)*        MSVCRT(__p__iob)(void);
+#ifndef _STDIO_DEFINED
+FILE*        __p__iob(void);
 #define _iob               (__p__iob())
-#endif /* MSVCRT_STDIO_DEFINED */
+#endif /* _STDIO_DEFINED */
 
-#ifndef USE_MSVCRT_PREFIX
 #define stdin              (_iob+STDIN_FILENO)
 #define stdout             (_iob+STDOUT_FILENO)
 #define stderr             (_iob+STDERR_FILENO)
-#else
-#define MSVCRT_stdin       (MSVCRT__iob+MSVCRT_STDIN_FILENO)
-#define MSVCRT_stdout      (MSVCRT__iob+MSVCRT_STDOUT_FILENO)
-#define MSVCRT_stderr      (MSVCRT__iob+MSVCRT_STDERR_FILENO)
-#endif /* USE_MSVCRT_PREFIX */
-
-#ifndef MSVCRT_STDIO_DEFINED
-#define MSVCRT_STDIO_DEFINED
-int         MSVCRT(_fcloseall)(void);
-MSVCRT(FILE)* MSVCRT(_fdopen)(int,const char*);
+
+#ifndef _STDIO_DEFINED
+#define _STDIO_DEFINED
+int         _fcloseall(void);
+FILE* _fdopen(int,const char*);
 int         _fgetchar(void);
-int         MSVCRT(_filbuf)(MSVCRT(FILE*));
-int         MSVCRT(_fileno)(MSVCRT(FILE)*);
-int         MSVCRT(_flsbuf)(int,MSVCRT(FILE)*);
+int         _filbuf(FILE*);
+int         _fileno(FILE*);
+int         _flsbuf(int,FILE*);
 int         _flushall(void);
 int         _fputchar(int);
-MSVCRT(FILE)* _fsopen(const char*,const char*,int);
+FILE* _fsopen(const char*,const char*,int);
 int         _getmaxstdio(void);
-int         MSVCRT(_getw)(MSVCRT(FILE)*);
-int         MSVCRT(_pclose)(MSVCRT(FILE)*);
-MSVCRT(FILE)* MSVCRT(_popen)(const char*,const char*);
-int         MSVCRT(_putw)(int,MSVCRT(FILE)*);
+int         _getw(FILE*);
+int         _pclose(FILE*);
+FILE* _popen(const char*,const char*);
+int         _putw(int,FILE*);
 int         _rmtmp(void);
 int         _setmaxstdio(int);
-int         _snprintf(char*,MSVCRT(size_t),const char*,...);
+int         _snprintf(char*,size_t,const char*,...);
 char*       _tempnam(const char*,const char*);
 int         _unlink(const char*);
-int         _vsnprintf(char*,MSVCRT(size_t),const char*,va_list);
+int         _vsnprintf(char*,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);
-
-#ifndef MSVCRT_WSTDIO_DEFINED
-#define MSVCRT_WSTDIO_DEFINED
-MSVCRT(wint_t)  _fgetwchar(void);
-MSVCRT(wint_t)  _fputwchar(MSVCRT(wint_t));
-MSVCRT(wchar_t)*_getws(MSVCRT(wchar_t)*);
-int             _putws(const MSVCRT(wchar_t)*);
-int             _snwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,...);
-int             _vsnwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,va_list);
-MSVCRT(FILE)*   MSVCRT(_wfdopen)(int,const MSVCRT(wchar_t)*);
-MSVCRT(FILE)*   MSVCRT(_wfopen)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(FILE)*   MSVCRT(_wfreopen)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
-MSVCRT(FILE)*   MSVCRT(_wfsopen)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,int);
-void            _wperror(const MSVCRT(wchar_t)*);
-MSVCRT(FILE)*   MSVCRT(_wpopen)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int             _wremove(const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wtempnam(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wtmpnam(MSVCRT(wchar_t)*);
-
-MSVCRT(wint_t)  MSVCRT(fgetwc)(MSVCRT(FILE)*);
-MSVCRT(wchar_t)*MSVCRT(fgetws)(MSVCRT(wchar_t)*,int,MSVCRT(FILE)*);
-MSVCRT(wint_t)  MSVCRT(fputwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
-int             MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
-int             MSVCRT(fwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
-int             MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
-int             MSVCRT(fwscanf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
-MSVCRT(wint_t)  MSVCRT(getwc)(MSVCRT(FILE)*);
-MSVCRT(wint_t)  MSVCRT(getwchar)(void);
-MSVCRT(wchar_t)*MSVCRT(getws)(MSVCRT(wchar_t)*);
-MSVCRT(wint_t)  MSVCRT(putwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
-MSVCRT(wint_t)  MSVCRT(putwchar)(MSVCRT(wint_t));
-int             MSVCRT(putws)(const MSVCRT(wchar_t)*);
-int             MSVCRT(swprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int             MSVCRT(swscanf)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-MSVCRT(wint_t)  MSVCRT(ungetwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
-int             MSVCRT(vfwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,va_list);
-int             MSVCRT(vswprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,va_list);
-int             MSVCRT(vwprintf)(const MSVCRT(wchar_t)*,va_list);
-int             MSVCRT(wprintf)(const MSVCRT(wchar_t)*,...);
-int             MSVCRT(wscanf)(const MSVCRT(wchar_t)*,...);
-#endif /* MSVCRT_WSTDIO_DEFINED */
+void        clearerr(FILE*);
+int         fclose(FILE*);
+int         feof(FILE*);
+int         ferror(FILE*);
+int         fflush(FILE*);
+int         fgetc(FILE*);
+int         fgetpos(FILE*,fpos_t*);
+char*       fgets(char*,int,FILE*);
+FILE* fopen(const char*,const char*);
+int         fprintf(FILE*,const char*,...);
+int         fputc(int,FILE*);
+int         fputs(const char*,FILE*);
+size_t fread(void*,size_t,size_t,FILE*);
+FILE* freopen(const char*,const char*,FILE*);
+int         fscanf(FILE*,const char*,...);
+int         fseek(FILE*,long,int);
+int         fsetpos(FILE*,fpos_t*);
+long        ftell(FILE*);
+size_t fwrite(const void*,size_t,size_t,FILE*);
+int         getc(FILE*);
+int         getchar(void);
+char*       gets(char*);
+void        perror(const char*);
+int         printf(const char*,...);
+int         putc(int,FILE*);
+int         putchar(int);
+int         puts(const char*);
+int         remove(const char*);
+int         rename(const char*,const char*);
+void        rewind(FILE*);
+int         scanf(const char*,...);
+void        setbuf(FILE*,char*);
+int         setvbuf(FILE*,char*,int,size_t);
+int         sprintf(char*,const char*,...);
+int         sscanf(const char*,const char*,...);
+FILE* tmpfile(void);
+char*       tmpnam(char*);
+int         ungetc(int,FILE*);
+int         vfprintf(FILE*,const char*,va_list);
+int         vprintf(const char*,va_list);
+int         vsprintf(char*,const char*,va_list);
+
+#ifndef _WSTDIO_DEFINED
+#define _WSTDIO_DEFINED
+wint_t  _fgetwchar(void);
+wint_t  _fputwchar(wint_t);
+wchar_t*_getws(wchar_t*);
+int             _putws(const wchar_t*);
+int             _snwprintf(wchar_t*,size_t,const wchar_t*,...);
+int             _vsnwprintf(wchar_t*,size_t,const wchar_t*,va_list);
+FILE*   _wfdopen(int,const wchar_t*);
+FILE*   _wfopen(const wchar_t*,const wchar_t*);
+FILE*   _wfreopen(const wchar_t*,const wchar_t*,FILE*);
+FILE*   _wfsopen(const wchar_t*,const wchar_t*,int);
+void            _wperror(const wchar_t*);
+FILE*   _wpopen(const wchar_t*,const wchar_t*);
+int             _wremove(const wchar_t*);
+wchar_t*_wtempnam(const wchar_t*,const wchar_t*);
+wchar_t*_wtmpnam(wchar_t*);
+
+wint_t  fgetwc(FILE*);
+wchar_t*fgetws(wchar_t*,int,FILE*);
+wint_t  fputwc(wint_t,FILE*);
+int             fputws(const wchar_t*,FILE*);
+int             fwprintf(FILE*,const wchar_t*,...);
+int             fputws(const wchar_t*,FILE*);
+int             fwscanf(FILE*,const wchar_t*,...);
+wint_t  getwc(FILE*);
+wint_t  getwchar(void);
+wchar_t*getws(wchar_t*);
+wint_t  putwc(wint_t,FILE*);
+wint_t  putwchar(wint_t);
+int             putws(const wchar_t*);
+int             swprintf(wchar_t*,const wchar_t*,...);
+int             swscanf(const wchar_t*,const wchar_t*,...);
+wint_t  ungetwc(wint_t,FILE*);
+int             vfwprintf(FILE*,const wchar_t*,va_list);
+int             vswprintf(wchar_t*,const wchar_t*,va_list);
+int             vwprintf(const wchar_t*,va_list);
+int             wprintf(const wchar_t*,...);
+int             wscanf(const wchar_t*,...);
+#endif /* _WSTDIO_DEFINED */
 
-#endif /* MSVCRT_STDIO_DEFINED */
+#endif /* _STDIO_DEFINED */
 
 #ifdef __cplusplus
 }
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
-static inline MSVCRT(FILE)* fdopen(int fd, const char *mode) { return _fdopen(fd, mode); }
+static inline FILE* fdopen(int fd, const char *mode) { return _fdopen(fd, mode); }
 static inline int fgetchar(void) { return _fgetchar(); }
-static inline int fileno(MSVCRT(FILE)* file) { return _fileno(file); }
+static inline int fileno(FILE* file) { return _fileno(file); }
 static inline int fputchar(int c) { return _fputchar(c); }
-static inline int pclose(MSVCRT(FILE)* file) { return _pclose(file); }
-static inline MSVCRT(FILE)* popen(const char* command, const char* mode) { return _popen(command, mode); }
+static inline int pclose(FILE* file) { return _pclose(file); }
+static inline FILE* popen(const char* command, const char* mode) { return _popen(command, mode); }
 static inline char* tempnam(const char *dir, const char *prefix) { return _tempnam(dir, prefix); }
-#ifndef MSVCRT_UNLINK_DEFINED
+#ifndef _UNLINK_DEFINED
 static inline int unlink(const char* path) { return _unlink(path); }
-#define MSVCRT_UNLINK_DEFINED
+#define _UNLINK_DEFINED
 #endif
 static inline int vsnprintf(char *buffer, size_t size, const char *format, va_list args) { return _vsnprintf(buffer,size,format,args); }
 
-static inline MSVCRT(wint_t) fgetwchar(void) { return _fgetwchar(); }
-static inline MSVCRT(wint_t) fputwchar(MSVCRT(wint_t) wc) { return _fputwchar(wc); }
-static inline int getw(MSVCRT(FILE)* file) { return _getw(file); }
-static inline int putw(int val, MSVCRT(FILE)* file) { return _putw(val, file); }
-static inline MSVCRT(FILE)* wpopen(const MSVCRT(wchar_t)* command,const MSVCRT(wchar_t)* mode) { return _wpopen(command, mode); }
-#endif /* USE_MSVCRT_PREFIX */
+static inline wint_t fgetwchar(void) { return _fgetwchar(); }
+static inline wint_t fputwchar(wint_t wc) { return _fputwchar(wc); }
+static inline int getw(FILE* file) { return _getw(file); }
+static inline int putw(int val, FILE* file) { return _putw(val, file); }
+static inline FILE* wpopen(const wchar_t* command,const wchar_t* mode) { return _wpopen(command, mode); }
 
 #endif /* __WINE_STDIO_H */
Index: include/msvcrt/stdlib.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/stdlib.h,v
retrieving revision 1.16
diff -u -r1.16 stdlib.h
--- include/msvcrt/stdlib.h	16 Mar 2004 19:17:11 -0000	1.16
+++ include/msvcrt/stdlib.h	20 Jun 2004 19:39:08 -0000
@@ -11,14 +11,6 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifndef NULL
 #ifdef __cplusplus
 #define NULL  0
@@ -27,10 +19,10 @@
 #endif
 #endif
 
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -40,13 +32,9 @@
 # endif
 #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
@@ -57,19 +45,19 @@
 #endif
 
 
-typedef struct MSVCRT(_div_t) {
+typedef struct _div_t {
     int quot;
     int rem;
-} MSVCRT(div_t);
+} div_t;
 
-typedef struct MSVCRT(_ldiv_t) {
+typedef struct _ldiv_t {
     long quot;
     long rem;
-} MSVCRT(ldiv_t);
+} ldiv_t;
 
-#ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
-#define MSVCRT_SIZE_T_DEFINED
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
 #endif
 
 #define __max(a,b) (((a) > (b)) ? (a) : (b))
@@ -101,17 +89,16 @@
 
 extern int*                  __p___argc(void);
 extern char***               __p___argv(void);
-extern MSVCRT(wchar_t)***    __p___wargv(void);
+extern wchar_t***    __p___wargv(void);
 extern char***               __p__environ(void);
-extern MSVCRT(wchar_t)***    __p__wenviron(void);
+extern wchar_t***    __p__wenviron(void);
 extern int*                  __p___mb_cur_max(void);
-extern unsigned long*        MSVCRT(__doserrno)(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())
@@ -120,18 +107,13 @@
 #define __mb_cur_max       (*__p___mb_cur_max())
 #define _doserrno          (*__doserrno())
 #define _fmode             (*_fmode)
-#endif /* USE_MSVCRT_PREFIX */
 
 
-extern int*           MSVCRT(_errno)(void);
-#ifndef USE_MSVCRT_PREFIX
-# define errno        (*_errno())
-#else
-# define MSVCRT_errno (*MSVCRT__errno())
-#endif
+extern int*           _errno(void);
+#define errno        (*_errno())
 
 
-typedef int (*MSVCRT(_onexit_t))(void);
+typedef int (*_onexit_t)(void);
 
 
 __int64     _atoi64(const char*);
@@ -139,7 +121,7 @@
 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*       _fullpath(char*,const char*,size_t);
 char*       _gcvt(double,int,char*);
 char*       _i64toa(__int64,char*,int);
 char*       _itoa(int,char*,int);
@@ -147,8 +129,8 @@
 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*);
-MSVCRT(_onexit_t) MSVCRT(_onexit)(MSVCRT(_onexit_t));
+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);
@@ -158,75 +140,74 @@
 void        _sleep(unsigned long);
 void        _splitpath(const char*,char*,char*,char*,char*);
 long double _strtold(const char*,char**);
-void        MSVCRT(_swab)(char*,char*,int);
+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)(void (*)(void));
-double      MSVCRT(atof)(const char*);
-int         MSVCRT(atoi)(const char*);
-long        MSVCRT(atol)(const char*);
-void*       MSVCRT(calloc)(MSVCRT(size_t),MSVCRT(size_t));
+void        _exit(int);
+void        abort();
+int         abs(int);
+int         atexit(void (*)(void));
+double      atof(const char*);
+int         atoi(const char*);
+long        atol(const char*);
+void*       calloc(size_t,size_t);
 #ifndef __i386__
-MSVCRT(div_t) MSVCRT(div)(int,int);
-MSVCRT(ldiv_t) MSVCRT(ldiv)(long,long);
+div_t div(int,int);
+ldiv_t 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*);
-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*);
-void*       MSVCRT(bsearch)(const void*,const void*,MSVCRT(size_t),MSVCRT(size_t),
+void        exit(int);
+void        free(void*);
+char*       getenv(const char*);
+long        labs(long);
+void*       malloc(size_t);
+int         mblen(const char*,size_t);
+void        perror(const char*);
+int         rand(void);
+void*       realloc(void*,size_t);
+void        srand(unsigned int);
+double      strtod(const char*,char**);
+long        strtol(const char*,char**,int);
+unsigned long strtoul(const char*,char**,int);
+int         system(const char*);
+void*       bsearch(const void*,const void*,size_t,size_t,
                             int (*)(const void*,const void*));
-void        MSVCRT(qsort)(void*,MSVCRT(size_t),MSVCRT(size_t),
+void        qsort(void*,size_t,size_t,
                           int (*)(const void*,const void*));
 
-#ifndef MSVCRT_WSTDLIB_DEFINED
-#define MSVCRT_WSTDLIB_DEFINED
-MSVCRT(wchar_t)*_itow(int,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_i64tow(__int64,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_ltow(long,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_ui64tow(unsigned __int64,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_ultow(unsigned long,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_wfullpath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*_wgetenv(const MSVCRT(wchar_t)*);
-void            _wmakepath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-void            _wperror(const MSVCRT(wchar_t)*);
-int             _wputenv(const MSVCRT(wchar_t)*);
-void            _wsearchenv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
-void            _wsplitpath(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
-int             _wsystem(const MSVCRT(wchar_t)*);
-int             _wtoi(const MSVCRT(wchar_t)*);
-__int64         _wtoi64(const MSVCRT(wchar_t)*);
-long            _wtol(const MSVCRT(wchar_t)*);
-
-MSVCRT(size_t) MSVCRT(mbstowcs)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
-int            MSVCRT(mbtowc)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
-double         MSVCRT(wcstod)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**);
-long           MSVCRT(wcstol)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
-MSVCRT(size_t) MSVCRT(wcstombs)(char*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-unsigned long  MSVCRT(wcstoul)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
-int            MSVCRT(wctomb)(char*,MSVCRT(wchar_t));
-#endif /* MSVCRT_WSTDLIB_DEFINED */
+#ifndef _WSTDLIB_DEFINED
+#define _WSTDLIB_DEFINED
+wchar_t*_itow(int,wchar_t*,int);
+wchar_t*_i64tow(__int64,wchar_t*,int);
+wchar_t*_ltow(long,wchar_t*,int);
+wchar_t*_ui64tow(unsigned __int64,wchar_t*,int);
+wchar_t*_ultow(unsigned long,wchar_t*,int);
+wchar_t*_wfullpath(wchar_t*,const wchar_t*,size_t);
+wchar_t*_wgetenv(const wchar_t*);
+void            _wmakepath(wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*);
+void            _wperror(const wchar_t*);
+int             _wputenv(const wchar_t*);
+void            _wsearchenv(const wchar_t*,const wchar_t*,wchar_t*);
+void            _wsplitpath(const wchar_t*,wchar_t*,wchar_t*,wchar_t*,wchar_t*);
+int             _wsystem(const wchar_t*);
+int             _wtoi(const wchar_t*);
+__int64         _wtoi64(const wchar_t*);
+long            _wtol(const wchar_t*);
+
+size_t mbstowcs(wchar_t*,const char*,size_t);
+int            mbtowc(wchar_t*,const char*,size_t);
+double         wcstod(const wchar_t*,wchar_t**);
+long           wcstol(const wchar_t*,wchar_t**,int);
+size_t wcstombs(char*,const wchar_t*,size_t);
+unsigned long  wcstoul(const wchar_t*,wchar_t**,int);
+int            wctomb(char*,wchar_t);
+#endif /* _WSTDLIB_DEFINED */
 
 #ifdef __cplusplus
 }
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
 #define environ _environ
 #define onexit_t _onexit_t
 
@@ -263,6 +244,4 @@
 #define ldiv(num,denom) __wine_msvcrt_ldiv(num,denom)
 #endif
 
-#endif /* USE_MSVCRT_PREFIX */
-
 #endif /* __WINE_STDLIB_H */
Index: include/msvcrt/string.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/string.h,v
retrieving revision 1.9
diff -u -r1.9 string.h
--- include/msvcrt/string.h	16 Mar 2004 19:17:11 -0000	1.9
+++ include/msvcrt/string.h	20 Jun 2004 19:39:08 -0000
@@ -11,29 +11,21 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
-#ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
-#define MSVCRT_SIZE_T_DEFINED
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
 #endif
 
-#ifndef MSVCRT_NLSCMP_DEFINED
+#ifndef _NLSCMP_DEFINED
 #define _NLSCMPERROR               ((unsigned int)0x7fffffff)
-#define MSVCRT_NLSCMP_DEFINED
+#define _NLSCMP_DEFINED
 #endif
 
 #ifndef NULL
@@ -56,73 +48,72 @@
 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));
+int         _strnicmp(const char*,const char*,size_t);
+char*       _strnset(char*,int,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));
-
-#ifndef MSVCRT_WSTRING_DEFINED
-#define MSVCRT_WSTRING_DEFINED
-MSVCRT(wchar_t)*_wcsdup(const MSVCRT(wchar_t)*);
-int             _wcsicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int             _wcsicoll(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wcslwr(MSVCRT(wchar_t)*);
-int             _wcsnicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*_wcsnset(MSVCRT(wchar_t)*,MSVCRT(wchar_t),MSVCRT(size_t));
-MSVCRT(wchar_t)*_wcsrev(MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wcsset(MSVCRT(wchar_t)*,MSVCRT(wchar_t));
-MSVCRT(wchar_t)*_wcsupr(MSVCRT(wchar_t)*);
-
-MSVCRT(wchar_t)*MSVCRT(wcscat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcschr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t));
-int             MSVCRT(wcscmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int             MSVCRT(wcscoll)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcscpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(size_t)  MSVCRT(wcscspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(size_t)  MSVCRT(wcslen)(const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcsncat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-int             MSVCRT(wcsncmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*MSVCRT(wcsncpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*MSVCRT(wcspbrk)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcsrchr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t) wcFor);
-MSVCRT(size_t)  MSVCRT(wcsspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcsstr)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcstok)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(size_t)  MSVCRT(wcsxfrm)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-#endif /* MSVCRT_WSTRING_DEFINED */
+void*       memchr(const void*,int,size_t);
+int         memcmp(const void*,const void*,size_t);
+void*       memcpy(void*,const void*,size_t);
+void*       memmove(void*,const void*,size_t);
+void*       memset(void*,int,size_t);
+char*       strcat(char*,const char*);
+char*       strchr(const char*,int);
+int         strcmp(const char*,const char*);
+int         strcoll(const char*,const char*);
+char*       strcpy(char*,const char*);
+size_t strcspn(const char*,const char*);
+char*       strerror(int);
+size_t strlen(const char*);
+char*       strncat(char*,const char*,size_t);
+int         strncmp(const char*,const char*,size_t);
+char*       strncpy(char*,const char*,size_t);
+char*       strpbrk(const char*,const char*);
+char*       strrchr(const char*,int);
+size_t strspn(const char*,const char*);
+char*       strstr(const char*,const char*);
+char*       strtok(char*,const char*);
+size_t strxfrm(char*,const char*,size_t);
+
+#ifndef _WSTRING_DEFINED
+#define _WSTRING_DEFINED
+wchar_t*_wcsdup(const wchar_t*);
+int             _wcsicmp(const wchar_t*,const wchar_t*);
+int             _wcsicoll(const wchar_t*,const wchar_t*);
+wchar_t*_wcslwr(wchar_t*);
+int             _wcsnicmp(const wchar_t*,const wchar_t*,size_t);
+wchar_t*_wcsnset(wchar_t*,wchar_t,size_t);
+wchar_t*_wcsrev(wchar_t*);
+wchar_t*_wcsset(wchar_t*,wchar_t);
+wchar_t*_wcsupr(wchar_t*);
+
+wchar_t*wcscat(wchar_t*,const wchar_t*);
+wchar_t*wcschr(const wchar_t*,wchar_t);
+int             wcscmp(const wchar_t*,const wchar_t*);
+int             wcscoll(const wchar_t*,const wchar_t*);
+wchar_t*wcscpy(wchar_t*,const wchar_t*);
+size_t  wcscspn(const wchar_t*,const wchar_t*);
+size_t  wcslen(const wchar_t*);
+wchar_t*wcsncat(wchar_t*,const wchar_t*,size_t);
+int             wcsncmp(const wchar_t*,const wchar_t*,size_t);
+wchar_t*wcsncpy(wchar_t*,const wchar_t*,size_t);
+wchar_t*wcspbrk(const wchar_t*,const wchar_t*);
+wchar_t*wcsrchr(const wchar_t*,wchar_t wcFor);
+size_t  wcsspn(const wchar_t*,const wchar_t*);
+wchar_t*wcsstr(const wchar_t*,const wchar_t*);
+wchar_t*wcstok(wchar_t*,const wchar_t*);
+size_t  wcsxfrm(wchar_t*,const wchar_t*,size_t);
+#endif /* _WSTRING_DEFINED */
 
 #ifdef __cplusplus
 }
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
-static inline void* memccpy(void *s1, const void *s2, int c, MSVCRT(size_t) n) { return _memccpy(s1, s2, c, n); }
-static inline int memicmp(const void* s1, const void* s2, MSVCRT(size_t) len) { return _memicmp(s1, s2, len); }
+static inline void* memccpy(void *s1, const void *s2, int c, size_t n) { return _memccpy(s1, s2, c, n); }
+static inline int memicmp(const void* s1, const void* s2, size_t len) { return _memicmp(s1, s2, len); }
 static inline int strcasecmp(const char* s1, const char* s2) { return _stricmp(s1, s2); }
 static inline int strcmpi(const char* s1, const char* s2) { return _strcmpi(s1, s2); }
 static inline char* strdup(const char* buf) { return _strdup(buf); }
@@ -130,20 +121,19 @@
 static inline int stricoll(const char* s1, const char* s2) { return _stricoll(s1, s2); }
 static inline char* strlwr(char* str) { return _strlwr(str); }
 static inline int strncasecmp(const char *str1, const char *str2, size_t n) { return _strnicmp(str1, str2, n); }
-static inline int strnicmp(const char* s1, const char* s2, MSVCRT(size_t) n) { return _strnicmp(s1, s2, n); }
+static inline int strnicmp(const char* s1, const char* s2, size_t n) { return _strnicmp(s1, s2, n); }
 static inline char* strnset(char* str, int value, unsigned int len) { return _strnset(str, value, len); }
 static inline char* strrev(char* str) { return _strrev(str); }
 static inline char* strset(char* str, int value) { return _strset(str, value); }
 static inline char* strupr(char* str) { return _strupr(str); }
 
-static inline MSVCRT(wchar_t)* wcsdup(const MSVCRT(wchar_t)* str) { return _wcsdup(str); }
-static inline int wcsicoll(const MSVCRT(wchar_t)* str1, const MSVCRT(wchar_t)* str2) { return _wcsicoll(str1, str2); }
-static inline MSVCRT(wchar_t)* wcslwr(MSVCRT(wchar_t)* str) { return _wcslwr(str); }
-static inline int wcsnicmp(const MSVCRT(wchar_t)* str1, const MSVCRT(wchar_t)* str2, MSVCRT(size_t) n) { return _wcsnicmp(str1, str2, n); }
-static inline MSVCRT(wchar_t)* wcsnset(MSVCRT(wchar_t)* str, MSVCRT(wchar_t) c, MSVCRT(size_t) n) { return _wcsnset(str, c, n); }
-static inline MSVCRT(wchar_t)* wcsrev(MSVCRT(wchar_t)* str) { return _wcsrev(str); }
-static inline MSVCRT(wchar_t)* wcsset(MSVCRT(wchar_t)* str, MSVCRT(wchar_t) c) { return _wcsset(str, c); }
-static inline MSVCRT(wchar_t)* wcsupr(MSVCRT(wchar_t)* str) { return _wcsupr(str); }
-#endif /* USE_MSVCRT_PREFIX */
+static inline wchar_t* wcsdup(const wchar_t* str) { return _wcsdup(str); }
+static inline int wcsicoll(const wchar_t* str1, const wchar_t* str2) { return _wcsicoll(str1, str2); }
+static inline wchar_t* wcslwr(wchar_t* str) { return _wcslwr(str); }
+static inline int wcsnicmp(const wchar_t* str1, const wchar_t* str2, size_t n) { return _wcsnicmp(str1, str2, n); }
+static inline wchar_t* wcsnset(wchar_t* str, wchar_t c, size_t n) { return _wcsnset(str, c, n); }
+static inline wchar_t* wcsrev(wchar_t* str) { return _wcsrev(str); }
+static inline wchar_t* wcsset(wchar_t* str, wchar_t c) { return _wcsset(str, c); }
+static inline wchar_t* wcsupr(wchar_t* str) { return _wcsupr(str); }
 
 #endif /* __WINE_STRING_H */
Index: include/msvcrt/time.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/time.h,v
retrieving revision 1.7
diff -u -r1.7 time.h
--- include/msvcrt/time.h	16 Mar 2004 19:17:11 -0000	1.7
+++ include/msvcrt/time.h	20 Jun 2004 19:39:08 -0000
@@ -23,34 +23,26 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
-#ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
-#define MSVCRT_SIZE_T_DEFINED
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
 #endif
 
-#ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
-#define MSVCRT_TIME_T_DEFINED
+#ifndef _TIME_T_DEFINED
+typedef long time_t;
+#define _TIME_T_DEFINED
 #endif
 
-#ifndef MSVCRT_CLOCK_T_DEFINED
-typedef long MSVCRT(clock_t);
-#define MSVCRT_CLOCK_T_DEFINED
+#ifndef _CLOCK_T_DEFINED
+typedef long clock_t;
+#define _CLOCK_T_DEFINED
 #endif
 
 #ifndef NULL
@@ -65,9 +57,9 @@
 #define CLOCKS_PER_SEC 1000
 #endif
 
-#ifndef MSVCRT_TM_DEFINED
-#define MSVCRT_TM_DEFINED
-struct MSVCRT(tm) {
+#ifndef _TM_DEFINED
+#define _TM_DEFINED
+struct tm {
     int tm_sec;
     int tm_min;
     int tm_hour;
@@ -78,7 +70,7 @@
     int tm_yday;
     int tm_isdst;
 };
-#endif /* MSVCRT_TM_DEFINED */
+#endif /* _TM_DEFINED */
 
 #ifdef __cplusplus
 extern "C" {
@@ -87,30 +79,30 @@
 /* FIXME: Must do something for _daylight, _dstbias, _timezone, _tzname */
 
 
-unsigned    _getsystime(struct MSVCRT(tm)*);
-unsigned    _setsystime(struct MSVCRT(tm)*,unsigned);
+unsigned    _getsystime(struct tm*);
+unsigned    _setsystime(struct 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)*);
-
-#ifndef MSVCRT_WTIME_DEFINED
-#define MSVCRT_WTIME_DEFINED
-MSVCRT(wchar_t)* MSVCRT(_wasctime)(const struct MSVCRT(tm)*);
-MSVCRT(size_t)  MSVCRT(wcsftime)(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,const struct MSVCRT(tm)*);
-MSVCRT(wchar_t)*_wctime(const MSVCRT(time_t)*);
-MSVCRT(wchar_t)*_wstrdate(MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wstrtime(MSVCRT(wchar_t)*);
-#endif /* MSVCRT_WTIME_DEFINED */
+char*       asctime(const struct tm*);
+clock_t clock(void);
+char*       ctime(const time_t*);
+double      difftime(time_t,time_t);
+struct tm* gmtime(const time_t*);
+struct tm* localtime(const time_t*);
+time_t mktime(struct tm*);
+size_t      strftime(char*,size_t,const char*,const struct tm*);
+time_t time(time_t*);
+
+#ifndef _WTIME_DEFINED
+#define _WTIME_DEFINED
+wchar_t* _wasctime(const struct tm*);
+size_t  wcsftime(wchar_t*,size_t,const wchar_t*,const struct tm*);
+wchar_t*_wctime(const time_t*);
+wchar_t*_wstrdate(wchar_t*);
+wchar_t*_wstrtime(wchar_t*);
+#endif /* _WTIME_DEFINED */
 
 #ifdef __cplusplus
 }
Index: include/msvcrt/wchar.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/wchar.h,v
retrieving revision 1.8
diff -u -r1.8 wchar.h
--- include/msvcrt/wchar.h	26 Apr 2004 23:31:39 -0000	1.8
+++ include/msvcrt/wchar.h	20 Jun 2004 19:39:08 -0000
@@ -13,22 +13,14 @@
 
 #include <stdarg.h>
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -41,18 +33,18 @@
 #endif
 
 #define WCHAR_MIN 0
-#define WCHAR_MAX ((MSVCRT(wchar_t))-1)
+#define WCHAR_MAX ((wchar_t)-1)
 
-typedef int MSVCRT(mbstate_t);
+typedef int mbstate_t;
 
-#ifndef MSVCRT_SIZE_T_DEFINED
-typedef unsigned int MSVCRT(size_t);
-#define MSVCRT_SIZE_T_DEFINED
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
 #endif
 
 #ifndef _WCTYPE_T_DEFINED
-typedef unsigned short  MSVCRT(wint_t);
-typedef unsigned short  MSVCRT(wctype_t);
+typedef unsigned short  wint_t;
+typedef unsigned short  wctype_t;
 #define _WCTYPE_T_DEFINED
 #endif
 
@@ -62,44 +54,38 @@
 # endif
 #endif
 
-#ifndef USE_MSVCRT_PREFIX
-# ifndef WEOF
-#  define WEOF        (wint_t)(0xFFFF)
-# endif
-#else
-# ifndef MSVCRT_WEOF
-#  define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
-# endif
-#endif /* USE_MSVCRT_PREFIX */
+#ifndef WEOF
+#define WEOF        (wint_t)(0xFFFF)
+#endif
 
-#ifndef MSVCRT_FSIZE_T_DEFINED
+#ifndef _FSIZE_T_DEFINED
 typedef unsigned long _fsize_t;
-#define MSVCRT_FSIZE_T_DEFINED
+#define _FSIZE_T_DEFINED
 #endif
 
-#ifndef MSVCRT_DEV_T_DEFINED
+#ifndef _DEV_T_DEFINED
 typedef unsigned int   _dev_t;
-#define MSVCRT_DEV_T_DEFINED
+#define _DEV_T_DEFINED
 #endif
 
-#ifndef MSVCRT_INO_T_DEFINED
+#ifndef _INO_T_DEFINED
 typedef unsigned short _ino_t;
-#define MSVCRT_INO_T_DEFINED
+#define _INO_T_DEFINED
 #endif
 
-#ifndef MSVCRT_OFF_T_DEFINED
-typedef int MSVCRT(_off_t);
-#define MSVCRT_OFF_T_DEFINED
+#ifndef _OFF_T_DEFINED
+typedef int _off_t;
+#define _OFF_T_DEFINED
 #endif
 
-#ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
-#define MSVCRT_TIME_T_DEFINED
+#ifndef _TIME_T_DEFINED
+typedef long time_t;
+#define _TIME_T_DEFINED
 #endif
 
-#ifndef MSVCRT_TM_DEFINED
-#define MSVCRT_TM_DEFINED
-struct MSVCRT(tm) {
+#ifndef _TM_DEFINED
+#define _TM_DEFINED
+struct tm {
     int tm_sec;
     int tm_min;
     int tm_hour;
@@ -110,11 +96,11 @@
     int tm_yday;
     int tm_isdst;
 };
-#endif /* MSVCRT_TM_DEFINED */
+#endif /* _TM_DEFINED */
 
-#ifndef MSVCRT_FILE_DEFINED
-#define MSVCRT_FILE_DEFINED
-typedef struct MSVCRT(_iobuf)
+#ifndef _FILE_DEFINED
+#define _FILE_DEFINED
+typedef struct _iobuf
 {
   char* _ptr;
   int   _cnt;
@@ -124,77 +110,77 @@
   int   _charbuf;
   int   _bufsiz;
   char* _tmpfname;
-} MSVCRT(FILE);
-#endif  /* MSVCRT_FILE_DEFINED */
+} FILE;
+#endif  /* _FILE_DEFINED */
 
-#ifndef MSVCRT_WFINDDATA_T_DEFINED
-#define MSVCRT_WFINDDATA_T_DEFINED
+#ifndef _WFINDDATA_T_DEFINED
+#define _WFINDDATA_T_DEFINED
 
-struct MSVCRT(_wfinddata_t) {
+struct _wfinddata_t {
   unsigned attrib;
-  MSVCRT(time_t) time_create;
-  MSVCRT(time_t) time_access;
-  MSVCRT(time_t) time_write;
-  MSVCRT(_fsize_t) size;
-  MSVCRT(wchar_t) name[260];
+  time_t time_create;
+  time_t time_access;
+  time_t time_write;
+  _fsize_t size;
+  wchar_t name[260];
 };
 
-struct MSVCRT(_wfinddatai64_t) {
+struct _wfinddatai64_t {
   unsigned attrib;
-  MSVCRT(time_t) time_create;
-  MSVCRT(time_t) time_access;
-  MSVCRT(time_t) time_write;
+  time_t time_create;
+  time_t time_access;
+  time_t time_write;
   __int64        size;
-  MSVCRT(wchar_t) name[260];
+  wchar_t name[260];
 };
 
-#endif /* MSVCRT_WFINDDATA_T_DEFINED */
+#endif /* _WFINDDATA_T_DEFINED */
 
-#ifndef MSVCRT_STAT_DEFINED
-#define MSVCRT_STAT_DEFINED
+#ifndef _STAT_DEFINED
+#define _STAT_DEFINED
 
-struct MSVCRT(_stat) {
-  MSVCRT(_dev_t) st_dev;
-  MSVCRT(_ino_t) st_ino;
+struct _stat {
+  _dev_t st_dev;
+  _ino_t st_ino;
   unsigned short st_mode;
   short          st_nlink;
   short          st_uid;
   short          st_gid;
-  MSVCRT(_dev_t) st_rdev;
-  MSVCRT(_off_t) st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
+  _dev_t st_rdev;
+  _off_t st_size;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
 };
 
-struct MSVCRT(stat) {
-  MSVCRT(_dev_t) st_dev;
-  MSVCRT(_ino_t) st_ino;
+struct stat {
+  _dev_t st_dev;
+  _ino_t st_ino;
   unsigned short st_mode;
   short          st_nlink;
   short          st_uid;
   short          st_gid;
-  MSVCRT(_dev_t) st_rdev;
-  MSVCRT(_off_t) st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
+  _dev_t st_rdev;
+  _off_t st_size;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
 };
 
-struct MSVCRT(_stati64) {
-  MSVCRT(_dev_t) st_dev;
-  MSVCRT(_ino_t) st_ino;
+struct _stati64 {
+  _dev_t st_dev;
+  _ino_t st_ino;
   unsigned short st_mode;
   short          st_nlink;
   short          st_uid;
   short          st_gid;
-  MSVCRT(_dev_t) st_rdev;
+  _dev_t st_rdev;
   __int64        st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
 };
-#endif /* MSVCRT_STAT_DEFINED */
+#endif /* _STAT_DEFINED */
 
 /* ASCII char classification table - binary compatible */
 #define _UPPER        0x0001  /* C1_UPPER */
@@ -208,199 +194,199 @@
 #define _LEADBYTE     0x8000
 #define _ALPHA       (0x0100|_UPPER|_LOWER)  /* (C1_ALPHA|_UPPER|_LOWER) */
 
-#ifndef MSVCRT_WCTYPE_DEFINED
-#define MSVCRT_WCTYPE_DEFINED
-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));
-MSVCRT(wchar_t) MSVCRT(towlower)(MSVCRT(wchar_t));
-MSVCRT(wchar_t) MSVCRT(towupper)(MSVCRT(wchar_t));
-#endif /* MSVCRT_WCTYPE_DEFINED */
-
-#ifndef MSVCRT_WDIRECT_DEFINED
-#define MSVCRT_WDIRECT_DEFINED
-int              _wchdir(const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)* _wgetcwd(MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)* _wgetdcwd(int,MSVCRT(wchar_t)*,int);
-int              _wmkdir(const MSVCRT(wchar_t)*);
-int              _wrmdir(const MSVCRT(wchar_t)*);
-#endif /* MSVCRT_WDIRECT_DEFINED */
-
-#ifndef MSVCRT_WIO_DEFINED
-#define MSVCRT_WIO_DEFINED
-int         _waccess(const MSVCRT(wchar_t)*,int);
-int         _wchmod(const MSVCRT(wchar_t)*,int);
-int         _wcreat(const MSVCRT(wchar_t)*,int);
-long        _wfindfirst(const MSVCRT(wchar_t)*,struct _wfinddata_t*);
-long        _wfindfirsti64(const MSVCRT(wchar_t)*, struct _wfinddatai64_t*);
+#ifndef _WCTYPE_DEFINED
+#define _WCTYPE_DEFINED
+int is_wctype(wint_t,wctype_t);
+int isleadbyte(int);
+int iswalnum(wint_t);
+int iswalpha(wint_t);
+int iswascii(wint_t);
+int iswcntrl(wint_t);
+int iswctype(wint_t,wctype_t);
+int iswdigit(wint_t);
+int iswgraph(wint_t);
+int iswlower(wint_t);
+int iswprint(wint_t);
+int iswpunct(wint_t);
+int iswspace(wint_t);
+int iswupper(wint_t);
+int iswxdigit(wint_t);
+wchar_t towlower(wchar_t);
+wchar_t towupper(wchar_t);
+#endif /* _WCTYPE_DEFINED */
+
+#ifndef _WDIRECT_DEFINED
+#define _WDIRECT_DEFINED
+int              _wchdir(const wchar_t*);
+wchar_t* _wgetcwd(wchar_t*,int);
+wchar_t* _wgetdcwd(int,wchar_t*,int);
+int              _wmkdir(const wchar_t*);
+int              _wrmdir(const wchar_t*);
+#endif /* _WDIRECT_DEFINED */
+
+#ifndef _WIO_DEFINED
+#define _WIO_DEFINED
+int         _waccess(const wchar_t*,int);
+int         _wchmod(const wchar_t*,int);
+int         _wcreat(const wchar_t*,int);
+long        _wfindfirst(const wchar_t*,struct _wfinddata_t*);
+long        _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
 int         _wfindnext(long,struct _wfinddata_t*);
 int         _wfindnexti64(long, struct _wfinddatai64_t*);
-MSVCRT(wchar_t)*_wmktemp(MSVCRT(wchar_t)*);
-int         _wopen(const MSVCRT(wchar_t)*,int,...);
-int         _wrename(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int         _wsopen(const MSVCRT(wchar_t)*,int,int,...);
-int         _wunlink(const MSVCRT(wchar_t)*);
-#endif /* MSVCRT_WIO_DEFINED */
-
-#ifndef MSVCRT_WLOCALE_DEFINED
-#define MSVCRT_WLOCALE_DEFINED
-MSVCRT(wchar_t)* _wsetlocale(int,const MSVCRT(wchar_t)*);
-#endif /* MSVCRT_WLOCALE_DEFINED */
-
-#ifndef MSVCRT_WPROCESS_DEFINED
-#define MSVCRT_WPROCESS_DEFINED
-int         _wexecl(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexecle(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexeclp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexeclpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wexecv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wexecve(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wexecvp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wexecvpe(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wspawnl(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnle(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnlp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnlpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int         _wspawnv(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wspawnve(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wspawnvp(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *);
-int         _wspawnvpe(int,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)* const *,const MSVCRT(wchar_t)* const *);
-int         _wsystem(const MSVCRT(wchar_t)*);
-#endif /* MSVCRT_WPROCESS_DEFINED */
-
-#ifndef MSVCRT_WSTAT_DEFINED
-#define MSVCRT_WSTAT_DEFINED
-int _wstat(const MSVCRT(wchar_t)*,struct MSVCRT(_stat)*);
-int _wstati64(const MSVCRT(wchar_t)*,struct MSVCRT(_stati64)*);
-#endif /* MSVCRT_WSTAT_DEFINED */
-
-#ifndef MSVCRT_WSTDIO_DEFINED
-#define MSVCRT_WSTDIO_DEFINED
-MSVCRT(wint_t)  _fgetwchar(void);
-MSVCRT(wint_t)  _fputwchar(MSVCRT(wint_t));
-MSVCRT(wchar_t)*_getws(MSVCRT(wchar_t)*);
-int             _putws(const MSVCRT(wchar_t)*);
-int             _snwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,...);
-int             _vsnwprintf(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,va_list);
-MSVCRT(FILE)*   _wfdopen(int,const MSVCRT(wchar_t)*);
-MSVCRT(FILE)*   _wfopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(FILE)*   _wfreopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
-MSVCRT(FILE)*   _wfsopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,int);
-void            _wperror(const MSVCRT(wchar_t)*);
-MSVCRT(FILE)*   _wpopen(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int             _wremove(const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wtempnam(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wtmpnam(MSVCRT(wchar_t)*);
-
-MSVCRT(wint_t)  MSVCRT(fgetwc)(MSVCRT(FILE)*);
-MSVCRT(wchar_t)*MSVCRT(fgetws)(MSVCRT(wchar_t)*,int,MSVCRT(FILE)*);
-MSVCRT(wint_t)  MSVCRT(fputwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
-int             MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
-int             MSVCRT(fwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
-int             MSVCRT(fputws)(const MSVCRT(wchar_t)*,MSVCRT(FILE)*);
-int             MSVCRT(fwscanf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,...);
-MSVCRT(wint_t)  MSVCRT(getwc)(MSVCRT(FILE)*);
-MSVCRT(wint_t)  MSVCRT(getwchar)(void);
-MSVCRT(wchar_t)*MSVCRT(getws)(MSVCRT(wchar_t)*);
-MSVCRT(wint_t)  MSVCRT(putwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
-MSVCRT(wint_t)  MSVCRT(putwchar)(MSVCRT(wint_t));
-int             MSVCRT(putws)(const MSVCRT(wchar_t)*);
-int             MSVCRT(swprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-int             MSVCRT(swscanf)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,...);
-MSVCRT(wint_t)  MSVCRT(ungetwc)(MSVCRT(wint_t),MSVCRT(FILE)*);
-int             MSVCRT(vfwprintf)(MSVCRT(FILE)*,const MSVCRT(wchar_t)*,va_list);
-int             MSVCRT(vswprintf)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,va_list);
-int             MSVCRT(vwprintf)(const MSVCRT(wchar_t)*,va_list);
-int             MSVCRT(wprintf)(const MSVCRT(wchar_t)*,...);
-int             MSVCRT(wscanf)(const MSVCRT(wchar_t)*,...);
-#endif /* MSVCRT_WSTDIO_DEFINED */
-
-#ifndef MSVCRT_WSTDLIB_DEFINED
-#define MSVCRT_WSTDLIB_DEFINED
-MSVCRT(wchar_t)*_itow(int,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_i64tow(__int64,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_ltow(long,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_ui64tow(unsigned __int64,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_ultow(unsigned long,MSVCRT(wchar_t)*,int);
-MSVCRT(wchar_t)*_wfullpath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,size_t);
-MSVCRT(wchar_t)*_wgetenv(const MSVCRT(wchar_t)*);
-void            _wmakepath(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-void            _wperror(const MSVCRT(wchar_t)*);
-int             _wputenv(const MSVCRT(wchar_t)*);
-void            _wsearchenv(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
-void            _wsplitpath(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*,MSVCRT(wchar_t)*);
-int             _wsystem(const MSVCRT(wchar_t)*);
-int             _wtoi(const MSVCRT(wchar_t)*);
-__int64         _wtoi64(const MSVCRT(wchar_t)*);
-long            _wtol(const MSVCRT(wchar_t)*);
-
-MSVCRT(size_t) MSVCRT(mbstowcs)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
-int            MSVCRT(mbtowc)(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t));
-double         MSVCRT(wcstod)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**);
-long           MSVCRT(wcstol)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
-MSVCRT(size_t) MSVCRT(wcstombs)(char*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-unsigned long  MSVCRT(wcstoul)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t)**,int);
-int            MSVCRT(wctomb)(char*,MSVCRT(wchar_t));
-#endif /* MSVCRT_WSTDLIB_DEFINED */
-
-#ifndef MSVCRT_WSTRING_DEFINED
-#define MSVCRT_WSTRING_DEFINED
-MSVCRT(wchar_t)*_wcsdup(const MSVCRT(wchar_t)*);
-int             _wcsicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int             _wcsicoll(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wcslwr(MSVCRT(wchar_t)*);
-int             _wcsnicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*_wcsnset(MSVCRT(wchar_t)*,MSVCRT(wchar_t),MSVCRT(size_t));
-MSVCRT(wchar_t)*_wcsrev(MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wcsset(MSVCRT(wchar_t)*,MSVCRT(wchar_t));
-MSVCRT(wchar_t)*_wcsupr(MSVCRT(wchar_t)*);
-
-MSVCRT(wchar_t)*MSVCRT(wcscat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcschr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t));
-int             MSVCRT(wcscmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-int             MSVCRT(wcscoll)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcscpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(size_t)  MSVCRT(wcscspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(size_t)  MSVCRT(wcslen)(const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcsncat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-int             MSVCRT(wcsncmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*MSVCRT(wcsncpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-MSVCRT(wchar_t)*MSVCRT(wcspbrk)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcsrchr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t) wcFor);
-MSVCRT(size_t)  MSVCRT(wcsspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcsstr)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*MSVCRT(wcstok)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
-MSVCRT(size_t)  MSVCRT(wcsxfrm)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
-#endif /* MSVCRT_WSTRING_DEFINED */
-
-#ifndef MSVCRT_WTIME_DEFINED
-#define MSVCRT_WTIME_DEFINED
-MSVCRT(wchar_t)*_wasctime(const struct MSVCRT(tm)*);
-MSVCRT(size_t)  wcsftime(MSVCRT(wchar_t)*,MSVCRT(size_t),const MSVCRT(wchar_t)*,const struct MSVCRT(tm)*);
-MSVCRT(wchar_t)*_wctime(const MSVCRT(time_t)*);
-MSVCRT(wchar_t)*_wstrdate(MSVCRT(wchar_t)*);
-MSVCRT(wchar_t)*_wstrtime(MSVCRT(wchar_t)*);
-#endif /* MSVCRT_WTIME_DEFINED */
-
-MSVCRT(wchar_t) btowc(int);
-MSVCRT(size_t)  mbrlen(const char *,MSVCRT(size_t),MSVCRT(mbstate_t)*);
-MSVCRT(size_t)  mbrtowc(MSVCRT(wchar_t)*,const char*,MSVCRT(size_t),MSVCRT(mbstate_t)*);
-MSVCRT(size_t)  mbsrtowcs(MSVCRT(wchar_t)*,const char**,MSVCRT(size_t),MSVCRT(mbstate_t)*);
-MSVCRT(size_t)  wcrtomb(char*,MSVCRT(wchar_t),MSVCRT(mbstate_t)*);
-MSVCRT(size_t)  wcsrtombs(char*,const MSVCRT(wchar_t)**,MSVCRT(size_t),MSVCRT(mbstate_t)*);
-int             wctob(MSVCRT(wint_t));
+wchar_t*_wmktemp(wchar_t*);
+int         _wopen(const wchar_t*,int,...);
+int         _wrename(const wchar_t*,const wchar_t*);
+int         _wsopen(const wchar_t*,int,int,...);
+int         _wunlink(const wchar_t*);
+#endif /* _WIO_DEFINED */
+
+#ifndef _WLOCALE_DEFINED
+#define _WLOCALE_DEFINED
+wchar_t* _wsetlocale(int,const wchar_t*);
+#endif /* _WLOCALE_DEFINED */
+
+#ifndef _WPROCESS_DEFINED
+#define _WPROCESS_DEFINED
+int         _wexecl(const wchar_t*,const wchar_t*,...);
+int         _wexecle(const wchar_t*,const wchar_t*,...);
+int         _wexeclp(const wchar_t*,const wchar_t*,...);
+int         _wexeclpe(const wchar_t*,const wchar_t*,...);
+int         _wexecv(const wchar_t*,const wchar_t* const *);
+int         _wexecve(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wexecvp(const wchar_t*,const wchar_t* const *);
+int         _wexecvpe(const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wspawnl(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnle(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnlp(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnlpe(int,const wchar_t*,const wchar_t*,...);
+int         _wspawnv(int,const wchar_t*,const wchar_t* const *);
+int         _wspawnve(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wspawnvp(int,const wchar_t*,const wchar_t* const *);
+int         _wspawnvpe(int,const wchar_t*,const wchar_t* const *,const wchar_t* const *);
+int         _wsystem(const wchar_t*);
+#endif /* _WPROCESS_DEFINED */
+
+#ifndef _WSTAT_DEFINED
+#define _WSTAT_DEFINED
+int _wstat(const wchar_t*,struct _stat*);
+int _wstati64(const wchar_t*,struct _stati64*);
+#endif /* _WSTAT_DEFINED */
+
+#ifndef _WSTDIO_DEFINED
+#define _WSTDIO_DEFINED
+wint_t  _fgetwchar(void);
+wint_t  _fputwchar(wint_t);
+wchar_t*_getws(wchar_t*);
+int             _putws(const wchar_t*);
+int             _snwprintf(wchar_t*,size_t,const wchar_t*,...);
+int             _vsnwprintf(wchar_t*,size_t,const wchar_t*,va_list);
+FILE*   _wfdopen(int,const wchar_t*);
+FILE*   _wfopen(const wchar_t*,const wchar_t*);
+FILE*   _wfreopen(const wchar_t*,const wchar_t*,FILE*);
+FILE*   _wfsopen(const wchar_t*,const wchar_t*,int);
+void            _wperror(const wchar_t*);
+FILE*   _wpopen(const wchar_t*,const wchar_t*);
+int             _wremove(const wchar_t*);
+wchar_t*_wtempnam(const wchar_t*,const wchar_t*);
+wchar_t*_wtmpnam(wchar_t*);
+
+wint_t  fgetwc(FILE*);
+wchar_t*fgetws(wchar_t*,int,FILE*);
+wint_t  fputwc(wint_t,FILE*);
+int             fputws(const wchar_t*,FILE*);
+int             fwprintf(FILE*,const wchar_t*,...);
+int             fputws(const wchar_t*,FILE*);
+int             fwscanf(FILE*,const wchar_t*,...);
+wint_t  getwc(FILE*);
+wint_t  getwchar(void);
+wchar_t*getws(wchar_t*);
+wint_t  putwc(wint_t,FILE*);
+wint_t  putwchar(wint_t);
+int             putws(const wchar_t*);
+int             swprintf(wchar_t*,const wchar_t*,...);
+int             swscanf(const wchar_t*,const wchar_t*,...);
+wint_t  ungetwc(wint_t,FILE*);
+int             vfwprintf(FILE*,const wchar_t*,va_list);
+int             vswprintf(wchar_t*,const wchar_t*,va_list);
+int             vwprintf(const wchar_t*,va_list);
+int             wprintf(const wchar_t*,...);
+int             wscanf(const wchar_t*,...);
+#endif /* _WSTDIO_DEFINED */
+
+#ifndef _WSTDLIB_DEFINED
+#define _WSTDLIB_DEFINED
+wchar_t*_itow(int,wchar_t*,int);
+wchar_t*_i64tow(__int64,wchar_t*,int);
+wchar_t*_ltow(long,wchar_t*,int);
+wchar_t*_ui64tow(unsigned __int64,wchar_t*,int);
+wchar_t*_ultow(unsigned long,wchar_t*,int);
+wchar_t*_wfullpath(wchar_t*,const wchar_t*,size_t);
+wchar_t*_wgetenv(const wchar_t*);
+void            _wmakepath(wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*,const wchar_t*);
+void            _wperror(const wchar_t*);
+int             _wputenv(const wchar_t*);
+void            _wsearchenv(const wchar_t*,const wchar_t*,wchar_t*);
+void            _wsplitpath(const wchar_t*,wchar_t*,wchar_t*,wchar_t*,wchar_t*);
+int             _wsystem(const wchar_t*);
+int             _wtoi(const wchar_t*);
+__int64         _wtoi64(const wchar_t*);
+long            _wtol(const wchar_t*);
+
+size_t mbstowcs(wchar_t*,const char*,size_t);
+int            mbtowc(wchar_t*,const char*,size_t);
+double         wcstod(const wchar_t*,wchar_t**);
+long           wcstol(const wchar_t*,wchar_t**,int);
+size_t wcstombs(char*,const wchar_t*,size_t);
+unsigned long  wcstoul(const wchar_t*,wchar_t**,int);
+int            wctomb(char*,wchar_t);
+#endif /* _WSTDLIB_DEFINED */
+
+#ifndef _WSTRING_DEFINED
+#define _WSTRING_DEFINED
+wchar_t*_wcsdup(const wchar_t*);
+int             _wcsicmp(const wchar_t*,const wchar_t*);
+int             _wcsicoll(const wchar_t*,const wchar_t*);
+wchar_t*_wcslwr(wchar_t*);
+int             _wcsnicmp(const wchar_t*,const wchar_t*,size_t);
+wchar_t*_wcsnset(wchar_t*,wchar_t,size_t);
+wchar_t*_wcsrev(wchar_t*);
+wchar_t*_wcsset(wchar_t*,wchar_t);
+wchar_t*_wcsupr(wchar_t*);
+
+wchar_t*wcscat(wchar_t*,const wchar_t*);
+wchar_t*wcschr(const wchar_t*,wchar_t);
+int             wcscmp(const wchar_t*,const wchar_t*);
+int             wcscoll(const wchar_t*,const wchar_t*);
+wchar_t*wcscpy(wchar_t*,const wchar_t*);
+size_t  wcscspn(const wchar_t*,const wchar_t*);
+size_t  wcslen(const wchar_t*);
+wchar_t*wcsncat(wchar_t*,const wchar_t*,size_t);
+int             wcsncmp(const wchar_t*,const wchar_t*,size_t);
+wchar_t*wcsncpy(wchar_t*,const wchar_t*,size_t);
+wchar_t*wcspbrk(const wchar_t*,const wchar_t*);
+wchar_t*wcsrchr(const wchar_t*,wchar_t wcFor);
+size_t  wcsspn(const wchar_t*,const wchar_t*);
+wchar_t*wcsstr(const wchar_t*,const wchar_t*);
+wchar_t*wcstok(wchar_t*,const wchar_t*);
+size_t  wcsxfrm(wchar_t*,const wchar_t*,size_t);
+#endif /* _WSTRING_DEFINED */
+
+#ifndef _WTIME_DEFINED
+#define _WTIME_DEFINED
+wchar_t*_wasctime(const struct tm*);
+size_t  wcsftime(wchar_t*,size_t,const wchar_t*,const struct tm*);
+wchar_t*_wctime(const time_t*);
+wchar_t*_wstrdate(wchar_t*);
+wchar_t*_wstrtime(wchar_t*);
+#endif /* _WTIME_DEFINED */
+
+wchar_t btowc(int);
+size_t  mbrlen(const char *,size_t,mbstate_t*);
+size_t  mbrtowc(wchar_t*,const char*,size_t,mbstate_t*);
+size_t  mbsrtowcs(wchar_t*,const char**,size_t,mbstate_t*);
+size_t  wcrtomb(char*,wchar_t,mbstate_t*);
+size_t  wcsrtombs(char*,const wchar_t**,size_t,mbstate_t*);
+int             wctob(wint_t);
 
 #ifdef __cplusplus
 }
Index: include/msvcrt/wctype.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/wctype.h,v
retrieving revision 1.7
diff -u -r1.7 wctype.h
--- include/msvcrt/wctype.h	26 Apr 2004 23:31:39 -0000	1.7
+++ include/msvcrt/wctype.h	20 Jun 2004 19:39:08 -0000
@@ -23,18 +23,10 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -50,19 +42,13 @@
 #define _LEADBYTE     0x8000
 #define _ALPHA       (0x0100|_UPPER|_LOWER)  /* (C1_ALPHA|_UPPER|_LOWER) */
 
-#ifndef USE_MSVCRT_PREFIX
-# ifndef WEOF
-#  define WEOF        (wint_t)(0xFFFF)
-# endif
-#else
-# ifndef MSVCRT_WEOF
-#  define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
-# endif
-#endif /* USE_MSVCRT_PREFIX */
+#ifndef WEOF
+#define WEOF        (wint_t)(0xFFFF)
+#endif
 
 #ifndef _WCTYPE_T_DEFINED
-typedef unsigned short  MSVCRT(wint_t);
-typedef unsigned short  MSVCRT(wctype_t);
+typedef unsigned short  wint_t;
+typedef unsigned short  wctype_t;
 #define _WCTYPE_T_DEFINED
 #endif
 
@@ -73,26 +59,26 @@
 extern "C" {
 #endif
 
-#ifndef MSVCRT_WCTYPE_DEFINED
-#define MSVCRT_WCTYPE_DEFINED
-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));
-MSVCRT(wchar_t) MSVCRT(towlower)(MSVCRT(wchar_t));
-MSVCRT(wchar_t) MSVCRT(towupper)(MSVCRT(wchar_t));
-#endif /* MSVCRT_WCTYPE_DEFINED */
+#ifndef _WCTYPE_DEFINED
+#define _WCTYPE_DEFINED
+int is_wctype(wint_t,wctype_t);
+int isleadbyte(int);
+int iswalnum(wint_t);
+int iswalpha(wint_t);
+int iswascii(wint_t);
+int iswcntrl(wint_t);
+int iswctype(wint_t,wctype_t);
+int iswdigit(wint_t);
+int iswgraph(wint_t);
+int iswlower(wint_t);
+int iswprint(wint_t);
+int iswpunct(wint_t);
+int iswspace(wint_t);
+int iswupper(wint_t);
+int iswxdigit(wint_t);
+wchar_t towlower(wchar_t);
+wchar_t towupper(wchar_t);
+#endif /* _WCTYPE_DEFINED */
 
 #ifdef __cplusplus
 }
Index: include/msvcrt/sys/stat.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/sys/stat.h,v
retrieving revision 1.12
diff -u -r1.12 stat.h
--- include/msvcrt/sys/stat.h	16 Mar 2004 19:17:11 -0000	1.12
+++ include/msvcrt/sys/stat.h	20 Jun 2004 19:41:22 -0000
@@ -13,18 +13,10 @@
 
 #include <sys/types.h>
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
@@ -34,24 +26,24 @@
 # endif
 #endif
 
-#ifndef MSVCRT_DEV_T_DEFINED
-typedef unsigned int MSVCRT(_dev_t);
-#define MSVCRT_DEV_T_DEFINED
+#ifndef _DEV_T_DEFINED
+typedef unsigned int _dev_t;
+#define _DEV_T_DEFINED
 #endif
 
-#ifndef MSVCRT_INO_T_DEFINED
-typedef unsigned short MSVCRT(_ino_t);
-#define MSVCRT_INO_T_DEFINED
+#ifndef _INO_T_DEFINED
+typedef unsigned short _ino_t;
+#define _INO_T_DEFINED
 #endif
 
-#ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
-#define MSVCRT_TIME_T_DEFINED
+#ifndef _TIME_T_DEFINED
+typedef long time_t;
+#define _TIME_T_DEFINED
 #endif
 
-#ifndef MSVCRT_OFF_T_DEFINED
-typedef int MSVCRT(_off_t);
-#define MSVCRT_OFF_T_DEFINED
+#ifndef _OFF_T_DEFINED
+typedef int _off_t;
+#define _OFF_T_DEFINED
 #endif
 
 #define _S_IEXEC  0x0040
@@ -68,74 +60,73 @@
 #undef st_ctime
 #undef st_mtime
 
-#ifndef MSVCRT_STAT_DEFINED
-#define MSVCRT_STAT_DEFINED
+#ifndef _STAT_DEFINED
+#define _STAT_DEFINED
 
-struct MSVCRT(_stat) {
-  MSVCRT(_dev_t) st_dev;
-  MSVCRT(_ino_t) st_ino;
+struct _stat {
+  _dev_t st_dev;
+  _ino_t st_ino;
   unsigned short st_mode;
   short          st_nlink;
   short          st_uid;
   short          st_gid;
-  MSVCRT(_dev_t) st_rdev;
-  MSVCRT(_off_t) st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
+  _dev_t st_rdev;
+  _off_t st_size;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
 };
 
-struct MSVCRT(stat) {
-  MSVCRT(_dev_t) st_dev;
-  MSVCRT(_ino_t) st_ino;
+struct stat {
+  _dev_t st_dev;
+  _ino_t st_ino;
   unsigned short st_mode;
   short          st_nlink;
   short          st_uid;
   short          st_gid;
-  MSVCRT(_dev_t) st_rdev;
-  MSVCRT(_off_t) st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
+  _dev_t st_rdev;
+  _off_t st_size;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
 };
 
-struct MSVCRT(_stati64) {
-  MSVCRT(_dev_t) st_dev;
-  MSVCRT(_ino_t) st_ino;
+struct _stati64 {
+  _dev_t st_dev;
+  _ino_t st_ino;
   unsigned short st_mode;
   short          st_nlink;
   short          st_uid;
   short          st_gid;
-  MSVCRT(_dev_t) st_rdev;
+  _dev_t st_rdev;
   __int64        st_size;
-  MSVCRT(time_t) st_atime;
-  MSVCRT(time_t) st_mtime;
-  MSVCRT(time_t) st_ctime;
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
 };
-#endif /* MSVCRT_STAT_DEFINED */
+#endif /* _STAT_DEFINED */
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-int MSVCRT(_fstat)(int,struct MSVCRT(_stat)*);
-int MSVCRT(_stat)(const char*,struct MSVCRT(_stat)*);
-int MSVCRT(_fstati64)(int,struct MSVCRT(_stati64)*);
-int MSVCRT(_stati64)(const char*,struct MSVCRT(_stati64)*);
+int _fstat(int,struct _stat*);
+int _stat(const char*,struct _stat*);
+int _fstati64(int,struct _stati64*);
+int _stati64(const char*,struct _stati64*);
 int _umask(int);
 
-#ifndef MSVCRT_WSTAT_DEFINED
-#define MSVCRT_WSTAT_DEFINED
-int MSVCRT(_wstat)(const MSVCRT(wchar_t)*,struct MSVCRT(_stat)*);
-int MSVCRT(_wstati64)(const MSVCRT(wchar_t)*,struct MSVCRT(_stati64)*);
-#endif /* MSVCRT_WSTAT_DEFINED */
+#ifndef _WSTAT_DEFINED
+#define _WSTAT_DEFINED
+int _wstat(const wchar_t*,struct _stat*);
+int _wstati64(const wchar_t*,struct _stati64*);
+#endif /* _WSTAT_DEFINED */
 
 #ifdef __cplusplus
 }
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
 #define S_IFMT   _S_IFMT
 #define S_IFDIR  _S_IFDIR
 #define S_IFCHR  _S_IFCHR
@@ -151,10 +142,9 @@
 
 static inline int fstat(int fd, struct stat* ptr) { return _fstat(fd, (struct _stat*)ptr); }
 static inline int stat(const char* path, struct stat* ptr) { return _stat(path, (struct _stat*)ptr); }
-#ifndef MSVCRT_UMASK_DEFINED
+#ifndef _UMASK_DEFINED
 static inline int umask(int fd) { return _umask(fd); }
-#define MSVCRT_UMASK_DEFINED
+#define _UMASK_DEFINED
 #endif
-#endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_SYS_STAT_H */
Index: include/msvcrt/sys/timeb.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/sys/timeb.h,v
retrieving revision 1.6
diff -u -r1.6 timeb.h
--- include/msvcrt/sys/timeb.h	18 Jul 2003 22:57:15 -0000	1.6
+++ include/msvcrt/sys/timeb.h	20 Jun 2004 19:41:31 -0000
@@ -23,29 +23,21 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
+#ifndef _TIME_T_DEFINED
+typedef long time_t;
+#define _TIME_T_DEFINED
 #endif
 
-#ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
-#define MSVCRT_TIME_T_DEFINED
-#endif
-
-#ifndef MSVCRT_TIMEB_DEFINED
-#define MSVCRT_TIMEB_DEFINED
+#ifndef _TIMEB_DEFINED
+#define _TIMEB_DEFINED
 struct _timeb
 {
-    MSVCRT(time_t) time;
+    time_t time;
     unsigned short millitm;
     short          timezone;
     short          dstflag;
 };
-#endif /* MSVCRT_TIMEB_DEFINED */
+#endif /* _TIMEB_DEFINED */
 
 
 #ifdef __cplusplus
@@ -59,10 +51,8 @@
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
 #define timeb _timeb
 
 static inline void ftime(struct _timeb* ptr) { return _ftime(ptr); }
-#endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_SYS_TIMEB_H */
Index: include/msvcrt/sys/types.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/sys/types.h,v
retrieving revision 1.9
diff -u -r1.9 types.h
--- include/msvcrt/sys/types.h	18 Jul 2003 22:57:15 -0000	1.9
+++ include/msvcrt/sys/types.h	20 Jun 2004 19:41:45 -0000
@@ -23,52 +23,42 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifndef MSVCRT_DEV_T_DEFINED
+#ifndef _DEV_T_DEFINED
 typedef unsigned int   _dev_t;
-#define MSVCRT_DEV_T_DEFINED
+#define _DEV_T_DEFINED
 #endif
 
-#ifndef MSVCRT_INO_T_DEFINED
+#ifndef _INO_T_DEFINED
 typedef unsigned short _ino_t;
-#define MSVCRT_INO_T_DEFINED
+#define _INO_T_DEFINED
 #endif
 
-#ifndef MSVCRT_MODE_T_DEFINED
+#ifndef _MODE_T_DEFINED
 typedef unsigned short _mode_t;
-#define MSVCRT_MODE_T_DEFINED
+#define _MODE_T_DEFINED
 #endif
 
-#ifndef MSVCRT_OFF_T_DEFINED
-typedef int MSVCRT(_off_t);
-#define MSVCRT_OFF_T_DEFINED
+#ifndef _OFF_T_DEFINED
+typedef int _off_t;
+#define _OFF_T_DEFINED
 #endif
 
-#ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
-#define MSVCRT_TIME_T_DEFINED
+#ifndef _TIME_T_DEFINED
+typedef long time_t;
+#define _TIME_T_DEFINED
 #endif
 
-#ifndef USE_MSVCRT_PREFIX
-#ifndef MSVCRT_BSD_TYPES_DEFINED
+#ifndef _BSD_TYPES_DEFINED
 typedef unsigned char u_char;
 typedef unsigned short u_short;
 typedef unsigned int  u_int;
 typedef unsigned long u_long;
-#define MSVCRT_BSD_TYPES_DEFINED
+#define _BSD_TYPES_DEFINED
 #endif
 
 #define dev_t _dev_t
 #define ino_t _ino_t
 #define mode_t _mode_t
 #define off_t _off_t
-#endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_SYS_TYPES_H */
Index: include/msvcrt/sys/utime.h
===================================================================
RCS file: /var/cvs/wine/include/msvcrt/sys/utime.h,v
retrieving revision 1.6
diff -u -r1.6 utime.h
--- include/msvcrt/sys/utime.h	18 Jul 2003 22:57:15 -0000	1.6
+++ include/msvcrt/sys/utime.h	20 Jun 2004 19:41:55 -0000
@@ -23,34 +23,26 @@
 #define __WINE_USE_MSVCRT
 #endif
 
-#ifndef MSVCRT
-# ifdef USE_MSVCRT_PREFIX
-#  define MSVCRT(x)    MSVCRT_##x
-# else
-#  define MSVCRT(x)    x
-# endif
-#endif
-
-#ifndef MSVCRT_WCHAR_T_DEFINED
-#define MSVCRT_WCHAR_T_DEFINED
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
 #ifndef __cplusplus
-typedef unsigned short MSVCRT(wchar_t);
+typedef unsigned short wchar_t;
 #endif
 #endif
 
-#ifndef MSVCRT_TIME_T_DEFINED
-typedef long MSVCRT(time_t);
-#define MSVCRT_TIME_T_DEFINED
+#ifndef _TIME_T_DEFINED
+typedef long time_t;
+#define _TIME_T_DEFINED
 #endif
 
-#ifndef MSVCRT_UTIMBUF_DEFINED
-#define MSVCRT_UTIMBUF_DEFINED
+#ifndef _UTIMBUF_DEFINED
+#define _UTIMBUF_DEFINED
 struct _utimbuf
 {
-    MSVCRT(time_t) actime;
-    MSVCRT(time_t) modtime;
+    time_t actime;
+    time_t modtime;
 };
-#endif /* MSVCRT_UTIMBUF_DEFINED */
+#endif /* _UTIMBUF_DEFINED */
 
 #ifdef __cplusplus
 extern "C" {
@@ -59,17 +51,15 @@
 int         _futime(int,struct _utimbuf*);
 int         _utime(const char*,struct _utimbuf*);
 
-int         _wutime(const MSVCRT(wchar_t)*,struct _utimbuf*);
+int         _wutime(const wchar_t*,struct _utimbuf*);
 
 #ifdef __cplusplus
 }
 #endif
 
 
-#ifndef USE_MSVCRT_PREFIX
 #define utimbuf _utimbuf
 
 static inline int utime(const char* path, struct _utimbuf* buf) { return _utime(path, buf); }
-#endif /* USE_MSVCRT_PREFIX */
 
 #endif /* __WINE_SYS_UTIME_H */
Index: dlls/msvcrt/Makefile.in
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/Makefile.in,v
retrieving revision 1.15
diff -u -r1.15 Makefile.in
--- dlls/msvcrt/Makefile.in	13 Jan 2004 05:45:05 -0000	1.15
+++ dlls/msvcrt/Makefile.in	20 Jun 2004 15:33:12 -0000
@@ -1,4 +1,4 @@
-EXTRADEFS = -DUSE_MSVCRT_PREFIX -D_MT
+EXTRADEFS = -D_MT
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = ../..
 SRCDIR    = @srcdir@
Index: dlls/msvcrt/console.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/console.c,v
retrieving revision 1.11
diff -u -r1.11 console.c
--- dlls/msvcrt/console.c	31 Oct 2003 04:17:45 -0000	1.11
+++ dlls/msvcrt/console.c	19 Jun 2004 06:50:08 -0000
@@ -20,14 +20,12 @@
  * Note: init and free don't need MT locking since they are called at DLL
  * (de)attachment time, which is syncronised for us
  */
+
+#include <stdio.h>
+
 #include "msvcrt.h"
 #include "wincon.h"
-
-#include "msvcrt/conio.h"
-#include "msvcrt/malloc.h"
-#include "msvcrt/stdio.h"
 #include "mtdll.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -72,9 +70,9 @@
 }
 
 /*********************************************************************
- *		_cputs (MSVCRT.@)
+ *		MSVCRT__cputs (MSVCRT.@)
  */
-int _cputs(const char* str)
+int MSVCRT__cputs(const char* str)
 {
   DWORD count;
   int retval = MSVCRT_EOF;
@@ -90,7 +88,7 @@
 /*********************************************************************
  *		_getch (MSVCRT.@)
  */
-int _getch(void)
+int MSVCRT__getch(void)
 {
   int retval = MSVCRT_EOF;
 
@@ -153,7 +151,7 @@
 {
   int retval;
   LOCK_CONSOLE;
-  retval = _getch();
+  retval = MSVCRT__getch();
   if (retval != MSVCRT_EOF)
     retval = _putch(retval);
   UNLOCK_CONSOLE;
@@ -182,9 +180,9 @@
 }
 
 /*********************************************************************
- *		_ungetch (MSVCRT.@)
+ *		MSVCRT__ungetch (MSVCRT.@)
  */
-int _ungetch(int c)
+int MSVCRT__ungetch(int c)
 {
   int retval = MSVCRT_EOF;
   LOCK_CONSOLE;
@@ -233,9 +231,9 @@
 
 
 /*********************************************************************
- *		_cprintf (MSVCRT.@)
+ *		MSVCRT__cprintf (MSVCRT.@)
  */
-int _cprintf(const char* format, ...)
+int MSVCRT__cprintf(const char* format, ...)
 {
   char buf[2048], *mem = buf;
   int written, resize = sizeof(buf), retval;
@@ -247,7 +245,7 @@
    * Return the number of bytes that would have been written
    * The code below handles both cases
    */
-  while ((written = _snprintf( mem, resize, format, valist )) == -1 ||
+  while ((written = snprintf( mem, resize, format, valist )) == -1 ||
           written > resize)
   {
     resize = (written == -1 ? resize * 2 : written + 1);
@@ -259,7 +257,7 @@
   }
   va_end(valist);
   LOCK_CONSOLE;
-  retval = _cputs( mem );
+  retval = MSVCRT__cputs( mem );
   UNLOCK_CONSOLE;
   if (mem != buf)
     MSVCRT_free (mem);
Index: dlls/msvcrt/cpp.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/cpp.c,v
retrieving revision 1.17
diff -u -r1.17 cpp.c
--- dlls/msvcrt/cpp.c	9 Feb 2004 22:07:43 -0000	1.17
+++ dlls/msvcrt/cpp.c	19 Jun 2004 06:41:55 -0000
@@ -31,9 +31,6 @@
 #include "wine/exception.h"
 #include "excpt.h"
 #include "wine/debug.h"
-#include "msvcrt/malloc.h"
-#include "msvcrt/stdlib.h"
-
 #include "msvcrt.h"
 #include "cppexcept.h"
 #include "mtdll.h"
@@ -211,12 +208,12 @@
         int i, *ptr = (int *)_this - 1;
 
         for (i = *ptr - 1; i >= 0; i--) MSVCRT_exception_dtor(_this + i);
-        MSVCRT_operator_delete(ptr);
+        _operator_delete(ptr);
     }
     else
     {
         MSVCRT_exception_dtor(_this);
-        if (flags & 1) MSVCRT_operator_delete(_this);
+        if (flags & 1) _operator_delete(_this);
     }
     return _this;
 }
@@ -229,7 +226,7 @@
 {
     TRACE("(%p %x)\n", _this, flags);
     MSVCRT_exception_dtor(_this);
-    if (flags & 1) MSVCRT_operator_delete(_this);
+    if (flags & 1) _operator_delete(_this);
     return _this;
 }
 
@@ -301,12 +298,12 @@
         int i, *ptr = (int *)_this - 1;
 
         for (i = *ptr - 1; i >= 0; i--) MSVCRT_bad_typeid_dtor(_this + i);
-        MSVCRT_operator_delete(ptr);
+        _operator_delete(ptr);
     }
     else
     {
         MSVCRT_bad_typeid_dtor(_this);
-        if (flags & 1) MSVCRT_operator_delete(_this);
+        if (flags & 1) _operator_delete(_this);
     }
     return _this;
 }
@@ -319,7 +316,7 @@
 {
     TRACE("(%p %x)\n", _this, flags);
     MSVCRT_bad_typeid_dtor(_this);
-    if (flags & 1) MSVCRT_operator_delete(_this);
+    if (flags & 1) _operator_delete(_this);
     return _this;
 }
 
@@ -384,12 +381,12 @@
         int i, *ptr = (int *)_this - 1;
 
         for (i = *ptr - 1; i >= 0; i--) MSVCRT___non_rtti_object_dtor(_this + i);
-        MSVCRT_operator_delete(ptr);
+        _operator_delete(ptr);
     }
     else
     {
         MSVCRT___non_rtti_object_dtor(_this);
-        if (flags & 1) MSVCRT_operator_delete(_this);
+        if (flags & 1) _operator_delete(_this);
     }
     return _this;
 }
@@ -402,7 +399,7 @@
 {
   TRACE("(%p %x)\n", _this, flags);
   MSVCRT___non_rtti_object_dtor(_this);
-  if (flags & 1) MSVCRT_operator_delete(_this);
+  if (flags & 1) _operator_delete(_this);
   return _this;
 }
 
@@ -464,12 +461,12 @@
         int i, *ptr = (int *)_this - 1;
 
         for (i = *ptr - 1; i >= 0; i--) MSVCRT_bad_cast_dtor(_this + i);
-        MSVCRT_operator_delete(ptr);
+        _operator_delete(ptr);
     }
     else
     {
         MSVCRT_bad_cast_dtor(_this);
-        if (flags & 1) MSVCRT_operator_delete(_this);
+        if (flags & 1) _operator_delete(_this);
     }
     return _this;
 }
@@ -482,7 +479,7 @@
 {
   TRACE("(%p %x)\n", _this, flags);
   MSVCRT_bad_cast_dtor(_this);
-  if (flags & 1) MSVCRT_operator_delete(_this);
+  if (flags & 1) _operator_delete(_this);
   return _this;
 }
 
@@ -539,9 +536,9 @@
   if (!_this->name)
   {
     /* Create and set the demangled name */
-    char* name = MSVCRT___unDName(0, _this->mangled, 0,
-                                  (MSVCRT_malloc_func)MSVCRT_malloc,
-                                  (MSVCRT_free_func)MSVCRT_free, 0x2800);
+    char* name = __unDName(0, _this->mangled, 0,
+                           (malloc_func_t)MSVCRT_malloc,
+                           (free_func_t)MSVCRT_free, 0x2800);
 
     if (name)
     {
@@ -589,12 +586,12 @@
         int i, *ptr = (int *)_this - 1;
 
         for (i = *ptr - 1; i >= 0; i--) MSVCRT_type_info_dtor(_this + i);
-        MSVCRT_operator_delete(ptr);
+        _operator_delete(ptr);
     }
     else
     {
         MSVCRT_type_info_dtor(_this);
-        if (flags & 1) MSVCRT_operator_delete(_this);
+        if (flags & 1) _operator_delete(_this);
     }
     return _this;
 }
@@ -953,10 +950,10 @@
  * RETURNS
  *  The previously installed handler function, if any.
  */
-terminate_function MSVCRT_set_terminate(terminate_function func)
+MSVCRT_terminate_function MSVCRT_set_terminate(MSVCRT_terminate_function func)
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
-    terminate_function previous = data->terminate_handler;
+    thread_data_t *data = msvcrt_get_thread_data();
+    MSVCRT_terminate_function previous = data->terminate_handler;
     TRACE("(%p) returning %p\n",func,previous);
     data->terminate_handler = func;
     return previous;
@@ -973,10 +970,10 @@
  * RETURNS
  *  The previously installed handler function, if any.
  */
-unexpected_function MSVCRT_set_unexpected(unexpected_function func)
+MSVCRT_unexpected_function MSVCRT_set_unexpected(MSVCRT_unexpected_function func)
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
-    unexpected_function previous = data->unexpected_handler;
+    thread_data_t *data = msvcrt_get_thread_data();
+    MSVCRT_unexpected_function previous = data->unexpected_handler;
     TRACE("(%p) returning %p\n",func,previous);
     data->unexpected_handler = func;
     return previous;
@@ -985,10 +982,10 @@
 /******************************************************************
  *              ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0 at Z@Z  (MSVCRT.@)
  */
-_se_translator_function MSVCRT__set_se_translator(_se_translator_function func)
+MSVCRT__se_translator_function MSVCRT__set_se_translator(MSVCRT__se_translator_function func)
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
-    _se_translator_function previous = data->se_translator;
+    thread_data_t *data = msvcrt_get_thread_data();
+    MSVCRT__se_translator_function previous = data->se_translator;
     TRACE("(%p) returning %p\n",func,previous);
     data->se_translator = func;
     return previous;
@@ -1009,7 +1006,7 @@
  */
 void MSVCRT_terminate(void)
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
+    thread_data_t *data = msvcrt_get_thread_data();
     if (data->terminate_handler) data->terminate_handler();
     MSVCRT_abort();
 }
@@ -1019,7 +1016,7 @@
  */
 void MSVCRT_unexpected(void)
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
+    thread_data_t *data = msvcrt_get_thread_data();
     if (data->unexpected_handler) data->unexpected_handler();
     MSVCRT_terminate();
 }
Index: dlls/msvcrt/cppexcept.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/cppexcept.c,v
retrieving revision 1.9
diff -u -r1.9 cppexcept.c
--- dlls/msvcrt/cppexcept.c	4 Dec 2003 05:51:01 -0000	1.9
+++ dlls/msvcrt/cppexcept.c	19 Jun 2004 06:41:55 -0000
@@ -269,7 +269,7 @@
     void *addr, *object = (void *)rec->ExceptionInformation[1];
     struct catch_func_nested_frame nested_frame;
     int trylevel = frame->trylevel;
-    MSVCRT_thread_data *thread_data = msvcrt_get_thread_data();
+    thread_data_t *thread_data = msvcrt_get_thread_data();
 
     for (i = 0; i < descr->tryblock_count; i++)
     {
Index: dlls/msvcrt/ctype.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/ctype.c,v
retrieving revision 1.7
diff -u -r1.7 ctype.c
--- dlls/msvcrt/ctype.c	19 Dec 2002 04:21:30 -0000	1.7
+++ dlls/msvcrt/ctype.c	19 Jun 2004 06:41:55 -0000
@@ -18,26 +18,23 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include "msvcrt.h"
-
-#include "msvcrt/ctype.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
 /* Some abbreviations to make the following table readable */
-#define _C_ _CONTROL
-#define _S_ _SPACE
-#define _P_ _PUNCT
-#define _D_ _DIGIT
-#define _H_ _HEX
-#define _U_ _UPPER
-#define _L_ _LOWER
+#define _C_ MSVCRT__CONTROL
+#define _S_ MSVCRT__SPACE
+#define _P_ MSVCRT__PUNCT
+#define _D_ MSVCRT__DIGIT
+#define _H_ MSVCRT__HEX
+#define _U_ MSVCRT__UPPER
+#define _L_ MSVCRT__LOWER
 
 WORD MSVCRT__ctype [257] = {
   0, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _S_|_C_, _S_|_C_,
   _S_|_C_, _S_|_C_, _S_|_C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_,
-  _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _S_|_BLANK,
+  _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _C_, _S_|MSVCRT__BLANK,
   _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _P_,
   _P_, _D_|_H_, _D_|_H_, _D_|_H_, _D_|_H_, _D_|_H_, _D_|_H_, _D_|_H_,
   _D_|_H_, _D_|_H_, _D_|_H_, _P_, _P_, _P_, _P_, _P_, _P_, _P_, _U_|_H_,
@@ -90,7 +87,7 @@
     WORD typeInfo;
     char convert[3], *pconv = convert;
 
-    if (MSVCRT__pctype[(UINT)c >> 8] & _LEADBYTE)
+    if (MSVCRT__pctype[(UINT)c >> 8] & MSVCRT__LEADBYTE)
       *pconv++ = (UINT)c >> 8;
     *pconv++ = c & 0xff;
     *pconv = 0;
@@ -107,7 +104,7 @@
  */
 int MSVCRT_isalnum(int c)
 {
-  return _isctype( c, _ALPHA | _DIGIT );
+  return _isctype( c, MSVCRT__ALPHA | MSVCRT__DIGIT );
 }
 
 /*********************************************************************
@@ -115,7 +112,7 @@
  */
 int MSVCRT_isalpha(int c)
 {
-  return _isctype( c, _ALPHA );
+  return _isctype( c, MSVCRT__ALPHA );
 }
 
 /*********************************************************************
@@ -123,7 +120,7 @@
  */
 int MSVCRT_iscntrl(int c)
 {
-  return _isctype( c, _CONTROL );
+  return _isctype( c, MSVCRT__CONTROL );
 }
 
 /*********************************************************************
@@ -131,7 +128,7 @@
  */
 int MSVCRT_isdigit(int c)
 {
-  return _isctype( c, _DIGIT );
+  return _isctype( c, MSVCRT__DIGIT );
 }
 
 /*********************************************************************
@@ -139,7 +136,7 @@
  */
 int MSVCRT_isgraph(int c)
 {
-  return _isctype( c, _ALPHA | _DIGIT | _PUNCT );
+  return _isctype( c, MSVCRT__ALPHA | MSVCRT__DIGIT | MSVCRT__PUNCT );
 }
 
 /*********************************************************************
@@ -147,7 +144,7 @@
  */
 int MSVCRT_isleadbyte(int c)
 {
-  return _isctype( c, _LEADBYTE );
+  return _isctype( c, MSVCRT__LEADBYTE );
 }
 
 /*********************************************************************
@@ -155,7 +152,7 @@
  */
 int MSVCRT_islower(int c)
 {
-  return _isctype( c, _LOWER );
+  return _isctype( c, MSVCRT__LOWER );
 }
 
 /*********************************************************************
@@ -163,7 +160,7 @@
  */
 int MSVCRT_isprint(int c)
 {
-  return _isctype( c, _ALPHA | _DIGIT | _BLANK | _PUNCT );
+  return _isctype( c, MSVCRT__ALPHA | MSVCRT__DIGIT | MSVCRT__BLANK | MSVCRT__PUNCT );
 }
 
 /*********************************************************************
@@ -171,7 +168,7 @@
  */
 int MSVCRT_ispunct(int c)
 {
-  return _isctype( c, _PUNCT );
+  return _isctype( c, MSVCRT__PUNCT );
 }
 
 /*********************************************************************
@@ -179,7 +176,7 @@
  */
 int MSVCRT_isspace(int c)
 {
-  return _isctype( c, _SPACE );
+  return _isctype( c, MSVCRT__SPACE );
 }
 
 /*********************************************************************
@@ -187,7 +184,7 @@
  */
 int MSVCRT_isupper(int c)
 {
-  return _isctype( c, _UPPER );
+  return _isctype( c, MSVCRT__UPPER );
 }
 
 /*********************************************************************
@@ -195,7 +192,7 @@
  */
 int MSVCRT_isxdigit(int c)
 {
-  return _isctype( c, _HEX );
+  return _isctype( c, MSVCRT__HEX );
 }
 
 /*********************************************************************
Index: dlls/msvcrt/data.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/data.c,v
retrieving revision 1.23
diff -u -r1.23 data.c
--- dlls/msvcrt/data.c	19 May 2004 03:22:56 -0000	1.23
+++ dlls/msvcrt/data.c	19 Jun 2004 18:29:59 -0000
@@ -23,11 +23,6 @@
 
 #include <math.h>
 #include "msvcrt.h"
-
-#include "msvcrt/fcntl.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-
 #include "wine/library.h"
 #include "wine/unicode.h"
 #include "wine/debug.h"
@@ -57,8 +52,8 @@
 MSVCRT_wchar_t **MSVCRT___wargv;
 char *MSVCRT__acmdln;
 MSVCRT_wchar_t *MSVCRT__wcmdln;
-char **MSVCRT__environ = 0;
-MSVCRT_wchar_t **MSVCRT__wenviron = 0;
+char **_environ = 0;
+MSVCRT_wchar_t **_wenviron = 0;
 char **MSVCRT___initenv = 0;
 MSVCRT_wchar_t **MSVCRT___winitenv = 0;
 int MSVCRT_timezone;
@@ -67,7 +62,7 @@
 WCHAR* MSVCRT__wpgmptr = 0;
 
 /* Get a snapshot of the current environment
- * and construct the __p__environ array
+ * and construct the MSVCRT___p__environ array
  *
  * The pointer returned from GetEnvironmentStrings may get invalid when
  * some other module cause a reallocation of the env-variable block
@@ -162,9 +157,9 @@
 WCHAR** __p__wpgmptr(void) { return &MSVCRT__wpgmptr; }
 
 /***********************************************************************
- *		__p__fmode (MSVCRT.@)
+ *		MSVCRT___p__fmode (MSVCRT.@)
  */
-unsigned int* __p__fmode(void) { return &MSVCRT__fmode; }
+unsigned int* MSVCRT___p__fmode(void) { return &MSVCRT__fmode; }
 
 /***********************************************************************
  *		__p__osver (MSVCRT.@)
@@ -207,23 +202,23 @@
 MSVCRT_wchar_t*** __p___wargv(void) { return &MSVCRT___wargv; }
 
 /*********************************************************************
- *		__p__environ (MSVCRT.@)
+ *		MSVCRT___p__environ (MSVCRT.@)
  */
-char*** __p__environ(void)
+char*** MSVCRT___p__environ(void)
 {
-  if (!MSVCRT__environ)
-    MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(NULL);
-  return &MSVCRT__environ;
+  if (!_environ)
+    _environ = msvcrt_SnapshotOfEnvironmentA(NULL);
+  return &_environ;
 }
 
 /*********************************************************************
- *		__p__wenviron (MSVCRT.@)
+ *		MSVCRT___p__wenviron (MSVCRT.@)
  */
-MSVCRT_wchar_t*** __p__wenviron(void)
+MSVCRT_wchar_t*** MSVCRT___p__wenviron(void)
 {
-  if (!MSVCRT__wenviron)
-    MSVCRT__wenviron = msvcrt_SnapshotOfEnvironmentW(NULL);
-  return &MSVCRT__wenviron;
+  if (!_wenviron)
+    _wenviron = msvcrt_SnapshotOfEnvironmentW(NULL);
+  return &_wenviron;
 }
 
 /*********************************************************************
@@ -261,7 +256,7 @@
 {
   DWORD version;
 
-  MSVCRT__acmdln = _strdup( GetCommandLineA() );
+  MSVCRT__acmdln = MSVCRT__strdup( GetCommandLineA() );
   MSVCRT__wcmdln = wstrdupa(MSVCRT__acmdln);
   MSVCRT___argc = __wine_main_argc;
   MSVCRT___argv = __wine_main_argv;
@@ -286,7 +281,7 @@
   MSVCRT___setlc_active = 0;
   MSVCRT___unguarded_readlc_active = 0;
   MSVCRT_timezone = 0;
-  MSVCRT__fmode = _O_TEXT;
+  MSVCRT__fmode = MSVCRT__O_TEXT;
   
   MSVCRT___initenv= msvcrt_SnapshotOfEnvironmentA(NULL);
   MSVCRT___winitenv= msvcrt_SnapshotOfEnvironmentW(NULL);
@@ -317,8 +312,8 @@
   /* FIXME: more things to free */
   if (MSVCRT___initenv) HeapFree(GetProcessHeap(), 0, MSVCRT___initenv);
   if (MSVCRT___winitenv) HeapFree(GetProcessHeap(), 0, MSVCRT___winitenv);
-  if (MSVCRT__environ) HeapFree(GetProcessHeap(), 0, MSVCRT__environ);
-  if (MSVCRT__wenviron) HeapFree(GetProcessHeap(), 0, MSVCRT__wenviron);
+  if (_environ) HeapFree(GetProcessHeap(), 0, _environ);
+  if (_wenviron) HeapFree(GetProcessHeap(), 0, _wenviron);
   if (MSVCRT__pgmptr) HeapFree(GetProcessHeap(), 0, MSVCRT__pgmptr);
   if (MSVCRT__wpgmptr) HeapFree(GetProcessHeap(), 0, MSVCRT__wpgmptr);
 }
@@ -334,7 +329,7 @@
   *argv = MSVCRT___argv;
   *envp = MSVCRT___initenv;
   if (new_mode)
-    MSVCRT__set_new_mode( *new_mode );
+    _set_new_mode( *new_mode );
 }
 
 /*********************************************************************
@@ -348,7 +343,7 @@
   *wargv = MSVCRT___wargv;
   *wenvp = MSVCRT___winitenv;
   if (new_mode)
-    MSVCRT__set_new_mode( *new_mode );
+    _set_new_mode( *new_mode );
 }
 
 /*********************************************************************
Index: dlls/msvcrt/dir.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/dir.c,v
retrieving revision 1.28
diff -u -r1.28 dir.c
--- dlls/msvcrt/dir.c	17 May 2004 21:08:31 -0000	1.28
+++ dlls/msvcrt/dir.c	19 Jun 2004 06:41:55 -0000
@@ -33,14 +33,6 @@
 #include "winternl.h"
 #include "wine/unicode.h"
 #include "msvcrt.h"
-#include "msvcrt/errno.h"
-
-#include "wine/unicode.h"
-#include "msvcrt/io.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-#include "msvcrt/dos.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -144,7 +136,7 @@
 {
   if (!SetCurrentDirectoryA(newdir))
   {
-    MSVCRT__set_errno(newdir?GetLastError():0);
+    msvcrt_set_errno(newdir?GetLastError():0);
     return -1;
   }
   return 0;
@@ -159,7 +151,7 @@
 {
   if (!SetCurrentDirectoryW(newdir))
   {
-    MSVCRT__set_errno(newdir?GetLastError():0);
+    msvcrt_set_errno(newdir?GetLastError():0);
     return -1;
   }
   return 0;
@@ -187,7 +179,7 @@
   buffer[0] += newdrive - 1;
   if (!SetCurrentDirectoryW( buffer ))
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     if (newdrive <= 0)
       *MSVCRT__errno() = MSVCRT_EACCES;
     return -1;
@@ -215,7 +207,7 @@
   TRACE(":handle %ld\n",hand);
   if (!FindClose((HANDLE)hand))
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   return 0;
@@ -246,7 +238,7 @@
   hfind  = FindFirstFileA(fspec, &find_data);
   if (hfind == INVALID_HANDLE_VALUE)
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   msvcrt_fttofd(&find_data,ft);
@@ -267,7 +259,7 @@
   hfind  = FindFirstFileW(fspec, &find_data);
   if (hfind == INVALID_HANDLE_VALUE)
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   msvcrt_wfttofd(&find_data,ft);
@@ -288,7 +280,7 @@
   hfind  = FindFirstFileA(fspec, &find_data);
   if (hfind == INVALID_HANDLE_VALUE)
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   msvcrt_fttofdi64(&find_data,ft);
@@ -309,7 +301,7 @@
   hfind  = FindFirstFileW(fspec, &find_data);
   if (hfind == INVALID_HANDLE_VALUE)
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   msvcrt_wfttofdi64(&find_data,ft);
@@ -429,7 +421,7 @@
   if (!buf)
   {
     if (size < 0)
-      return _strdup(dir);
+      return MSVCRT__strdup(dir);
     return msvcrt_strndup(dir,size);
   }
   if (dir_len >= size)
@@ -457,7 +449,7 @@
   if (!buf)
   {
     if (size < 0)
-      return _wcsdup(dir);
+      return MSVCRT__wcsdup(dir);
     return msvcrt_wstrndup(dir,size);
   }
   if (dir_len >= size)
@@ -470,7 +462,7 @@
 }
 
 /*********************************************************************
- *		_getdrive (MSVCRT.@)
+ *		MSVCRT__getdrive (MSVCRT.@)
  *
  * Get the current drive number.
  *
@@ -481,7 +473,7 @@
  *  Success: The drive letter number from 1 to 26 ("A:" to "Z:").
  *  Failure: 0.
  */
-int _getdrive(void)
+int MSVCRT__getdrive(void)
 {
     WCHAR buffer[MAX_PATH];
     if (GetCurrentDirectoryW( MAX_PATH, buffer ) &&
@@ -511,7 +503,7 @@
 
   TRACE(":drive %d(%c), size %d\n",drive, drive + 'A' - 1, size);
 
-  if (!drive || drive == _getdrive())
+  if (!drive || drive == MSVCRT__getdrive())
     return _getcwd(buf,size); /* current */
   else
   {
@@ -535,7 +527,7 @@
 
     TRACE(":returning '%s'\n", dir);
     if (!buf)
-      return _strdup(dir); /* allocate */
+      return MSVCRT__strdup(dir); /* allocate */
 
     strcpy(buf,dir);
   }
@@ -553,7 +545,7 @@
 
   TRACE(":drive %d(%c), size %d\n",drive, drive + 'A' - 1, size);
 
-  if (!drive || drive == _getdrive())
+  if (!drive || drive == MSVCRT__getdrive())
     return _wgetcwd(buf,size); /* current */
   else
   {
@@ -577,7 +569,7 @@
 
     TRACE(":returning %s\n", debugstr_w(dir));
     if (!buf)
-      return _wcsdup(dir); /* allocate */
+      return MSVCRT__wcsdup(dir); /* allocate */
     strcpyW(buf,dir);
   }
   return buf;
@@ -619,7 +611,7 @@
     return 0;
   }
   err = GetLastError();
-  MSVCRT__set_errno(err);
+  msvcrt_set_errno(err);
   return err;
 }
 
@@ -642,7 +634,7 @@
 {
   if (CreateDirectoryA(newdir,NULL))
     return 0;
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -655,7 +647,7 @@
 {
   if (CreateDirectoryW(newdir,NULL))
     return 0;
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -678,7 +670,7 @@
 {
   if (RemoveDirectoryA(dir))
     return 0;
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -691,7 +683,7 @@
 {
   if (RemoveDirectoryW(dir))
     return 0;
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -908,7 +900,7 @@
     return NULL; /* FIXME: errno? */
 
   if (!absPath)
-    return _wcsdup(res);
+    return MSVCRT__wcsdup(res);
   strcpyW(absPath,res);
   return absPath;
 }
@@ -1078,7 +1070,7 @@
     return NULL; /* FIXME: errno? */
 
   if (!absPath)
-    return _strdup(res);
+    return MSVCRT__strdup(res);
   strcpy(absPath,res);
   return absPath;
 }
@@ -1191,7 +1183,7 @@
 }
 
 /*********************************************************************
- *		_searchenv (MSVCRT.@)
+ *		MSVCRT__searchenv (MSVCRT.@)
  *
  * Search for a file in a list of paths from an envronment variable.
  *
@@ -1204,7 +1196,7 @@
  *  Nothing. If the file is not found, buf will contain an empty string
  *  and errno is set.
  */
-void _searchenv(const char* file, const char* env, char *buf)
+void MSVCRT__searchenv(const char* file, const char* env, char *buf)
 {
   char*envVal, *penv;
   char curPath[MAX_PATH];
@@ -1216,7 +1208,7 @@
   {
     GetFullPathNameA( file, MAX_PATH, buf, NULL );
     /* Sigh. This error is *always* set, regardless of success */
-    MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
+    msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
     return;
   }
 
@@ -1224,7 +1216,7 @@
   envVal = MSVCRT_getenv(env);
   if (!envVal)
   {
-    MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
+    msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
     return;
   }
 
@@ -1238,7 +1230,7 @@
     while(*end && *end != ';') end++; /* Find end of next path */
     if (penv == end || !*penv)
     {
-      MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
+      msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
       return;
     }
     strncpy(curPath, penv, end - penv);
@@ -1255,7 +1247,7 @@
     if (GetFileAttributesA( curPath ) != INVALID_FILE_ATTRIBUTES)
     {
       strcpy(buf, curPath);
-      MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
+      msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
       return; /* Found */
     }
     penv = *end ? end + 1 : end;
Index: dlls/msvcrt/environ.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/environ.c,v
retrieving revision 1.11
diff -u -r1.11 environ.c
--- dlls/msvcrt/environ.c	24 Sep 2003 18:57:28 -0000	1.11
+++ dlls/msvcrt/environ.c	19 Jun 2004 06:41:55 -0000
@@ -22,10 +22,6 @@
  */
 #include "wine/unicode.h"
 #include "msvcrt.h"
-
-#include "msvcrt/stdlib.h"
-
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -38,7 +34,7 @@
     char **environ;
     unsigned int length=strlen(name);
 
-    for (environ = *__p__environ(); *environ; environ++)
+    for (environ = *MSVCRT___p__environ(); *environ; environ++)
     {
         char *str = *environ;
         char *pos = strchr(str,'=');
@@ -59,7 +55,7 @@
     MSVCRT_wchar_t **environ;
     unsigned int length=strlenW(name);
 
-    for (environ = *__p__wenviron(); *environ; environ++)
+    for (environ = *MSVCRT___p__wenviron(); *environ; environ++)
     {
         MSVCRT_wchar_t *str = *environ;
         MSVCRT_wchar_t *pos = strchrW(str,'=');
@@ -96,11 +92,11 @@
  *dst = '\0';
 
  ret = !SetEnvironmentVariableA(name, value[0] ? value : NULL);
- /* Update the __p__environ array only when already initialized */
- if (MSVCRT__environ)
-   MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(MSVCRT__environ);
- if (MSVCRT__wenviron)
-   MSVCRT__wenviron = msvcrt_SnapshotOfEnvironmentW(MSVCRT__wenviron);
+ /* Update the MSVCRT___p__environ array only when already initialized */
+ if (_environ)
+   _environ = msvcrt_SnapshotOfEnvironmentA(_environ);
+ if (_wenviron)
+   _wenviron = msvcrt_SnapshotOfEnvironmentW(_wenviron);
  return ret;
 }
 
@@ -128,10 +124,10 @@
  *dst = 0;
 
  ret = !SetEnvironmentVariableW(name, value[0] ? value : NULL);
- /* Update the __p__environ array only when already initialized */
- if (MSVCRT__environ)
-   MSVCRT__environ = msvcrt_SnapshotOfEnvironmentA(MSVCRT__environ);
- if (MSVCRT__wenviron)
-   MSVCRT__wenviron = msvcrt_SnapshotOfEnvironmentW(MSVCRT__wenviron);
+ /* Update the MSVCRT___p__environ array only when already initialized */
+ if (_environ)
+   _environ = msvcrt_SnapshotOfEnvironmentA(_environ);
+ if (_wenviron)
+   _wenviron = msvcrt_SnapshotOfEnvironmentW(_wenviron);
  return ret;
 }
Index: dlls/msvcrt/errno.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/errno.c,v
retrieving revision 1.12
diff -u -r1.12 errno.c
--- dlls/msvcrt/errno.c	16 Mar 2004 19:17:11 -0000	1.12
+++ dlls/msvcrt/errno.c	19 Jun 2004 06:41:55 -0000
@@ -18,24 +18,17 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "msvcrt.h"
-#include "msvcrt/errno.h"
-
 #include <stdio.h>
 #include <string.h>
 
-#include "msvcrt/conio.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-
-
+#include "msvcrt.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
 
 /* INTERNAL: Set the crt and dos errno's from the OS error given. */
-void MSVCRT__set_errno(int err)
+void msvcrt_set_errno(int err)
 {
   int *errno = MSVCRT__errno();
   unsigned long *doserrno = MSVCRT___doserrno();
@@ -133,7 +126,7 @@
  */
 void MSVCRT_perror(const char* str)
 {
-  _cprintf("%s: %s\n",str,MSVCRT_strerror(msvcrt_get_thread_data()->thread_errno));
+  MSVCRT__cprintf("%s: %s\n",str,MSVCRT_strerror(msvcrt_get_thread_data()->thread_errno));
 }
 
 /******************************************************************************
@@ -154,10 +147,10 @@
  */
 int _set_error_mode(int mode)
 {
-  static int current_mode = _OUT_TO_DEFAULT;
+  static int current_mode = MSVCRT__OUT_TO_DEFAULT;
 
   const int old = current_mode;
-  if ( _REPORT_ERRMODE != mode ) {
+  if ( MSVCRT__REPORT_ERRMODE != mode ) {
     current_mode = mode;
     FIXME("dummy implementation (old mode: %d, new mode: %d)\n",
           old, mode);
Index: dlls/msvcrt/except.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/except.c,v
retrieving revision 1.29
diff -u -r1.29 except.c
--- dlls/msvcrt/except.c	4 Dec 2003 05:51:01 -0000	1.29
+++ dlls/msvcrt/except.c	19 Jun 2004 06:41:55 -0000
@@ -36,11 +36,7 @@
 #include "winternl.h"
 #include "wine/exception.h"
 #include "msvcrt.h"
-
-#include "msvcrt/setjmp.h"
 #include "excpt.h"
-
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -281,7 +277,7 @@
  *		_setjmp (MSVCRT.@)
  */
 DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp, _MSVCRT__setjmp, 4, 0 );
-void _MSVCRT__setjmp(_JUMP_BUFFER *jmp, CONTEXT86* context)
+void _MSVCRT__setjmp(struct MSVCRT___JUMP_BUFFER *jmp, CONTEXT86* context)
 {
     TRACE("(%p)\n",jmp);
     jmp->Ebp = context->Ebp;
@@ -303,7 +299,7 @@
  *		_setjmp3 (MSVCRT.@)
  */
 DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp3, _MSVCRT__setjmp3, 8, 0 );
-void _MSVCRT__setjmp3(_JUMP_BUFFER *jmp, int nb_args, CONTEXT86* context)
+void _MSVCRT__setjmp3(struct MSVCRT___JUMP_BUFFER *jmp, int nb_args, CONTEXT86* context)
 {
     TRACE("(%p,%d)\n",jmp,nb_args);
     jmp->Ebp = context->Ebp;
@@ -340,7 +336,7 @@
  *		longjmp (MSVCRT.@)
  */
 DEFINE_REGS_ENTRYPOINT( MSVCRT_longjmp, _MSVCRT_longjmp, 8, 0 );
-void _MSVCRT_longjmp(_JUMP_BUFFER *jmp, int retval, CONTEXT86* context)
+void _MSVCRT_longjmp(struct MSVCRT___JUMP_BUFFER *jmp, int retval, CONTEXT86* context)
 {
     unsigned long cur_frame = 0;
 
@@ -383,7 +379,7 @@
 /*********************************************************************
  *		_seh_longjmp_unwind (MSVCRT.@)
  */
-void __stdcall _seh_longjmp_unwind(_JUMP_BUFFER *jmp)
+void __stdcall _seh_longjmp_unwind(struct MSVCRT___JUMP_BUFFER *jmp)
 {
     _local_unwind2( (MSVCRT_EXCEPTION_FRAME *)jmp->Registration, jmp->TryLevel );
 }
Index: dlls/msvcrt/exit.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/exit.c,v
retrieving revision 1.12
diff -u -r1.12 exit.c
--- dlls/msvcrt/exit.c	16 Mar 2004 19:17:11 -0000	1.12
+++ dlls/msvcrt/exit.c	19 Jun 2004 06:41:55 -0000
@@ -19,12 +19,8 @@
  */
 #include <stdio.h>
 #include "msvcrt.h"
-
-#include "msvcrt/conio.h"
-#include "msvcrt/stdlib.h"
 #include "mtdll.h"
 #include "winuser.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -132,7 +128,7 @@
 /*********************************************************************
  *		_amsg_exit (MSVCRT.@)
  */
-void MSVCRT__amsg_exit(int errnum)
+void _amsg_exit(int errnum)
 {
   TRACE("(%d)\n", errnum);
   /* FIXME: text for the error number. */
@@ -143,7 +139,7 @@
     DoMessageBox("Runtime error!", text);
   }
   else
-    _cprintf("\nruntime error R60%d\n",errnum);
+    MSVCRT__cprintf("\nruntime error R60%d\n",errnum);
   _aexit_rtn(255);
 }
 
@@ -158,7 +154,7 @@
     DoMessageBox("Runtime error!", "abnormal program termination");
   }
   else
-    _cputs("\nabnormal program termination\n");
+    MSVCRT__cputs("\nabnormal program termination\n");
   MSVCRT__exit(3);
 }
 
@@ -175,7 +171,7 @@
     DoMessageBox("Assertion failed!", text);
   }
   else
-    _cprintf("Assertion failed: %s, file %s, line %d\n\n",str, file, line);
+    MSVCRT__cprintf("Assertion failed: %s, file %s, line %d\n\n",str, file, line);
   MSVCRT__exit(3);
 }
 
@@ -259,5 +255,5 @@
 void _purecall(void)
 {
   TRACE("(void)\n");
-  MSVCRT__amsg_exit( 25 );
+  _amsg_exit( 25 );
 }
Index: dlls/msvcrt/file.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/file.c,v
retrieving revision 1.68
diff -u -r1.68 file.c
--- dlls/msvcrt/file.c	27 May 2004 20:01:34 -0000	1.68
+++ dlls/msvcrt/file.c	19 Jun 2004 18:30:15 -0000
@@ -31,36 +31,24 @@
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
+#include <sys/types.h>
 
 #include "windef.h"
 #include "winbase.h"
 #include "winreg.h"
 #include "winternl.h"
 #include "msvcrt.h"
-#include "msvcrt/errno.h"
 
 #include "wine/unicode.h"
-#include "msvcrt/fcntl.h"
-#include "msvcrt/io.h"
-#include "msvcrt/sys/locking.h"
-#include "msvcrt/stdio.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-#include "msvcrt/sys/stat.h"
-#include "msvcrt/sys/utime.h"
-#include "msvcrt/time.h"
-#include "msvcrt/share.h"
-#include "msvcrt/wctype.h"
-#include "msvcrt/direct.h"
 
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
 /* for stat mode, permissions apply to all,owner and group */
-#define MSVCRT_S_IREAD  (_S_IREAD  | (_S_IREAD  >> 3) | (_S_IREAD  >> 6))
-#define MSVCRT_S_IWRITE (_S_IWRITE | (_S_IWRITE >> 3) | (_S_IWRITE >> 6))
-#define MSVCRT_S_IEXEC  (_S_IEXEC  | (_S_IEXEC  >> 3) | (_S_IEXEC  >> 6))
+#define ALL_S_IREAD  (MSVCRT__S_IREAD  | (MSVCRT__S_IREAD  >> 3) | (MSVCRT__S_IREAD  >> 6))
+#define ALL_S_IWRITE (MSVCRT__S_IWRITE | (MSVCRT__S_IWRITE >> 3) | (MSVCRT__S_IWRITE >> 6))
+#define ALL_S_IEXEC  (MSVCRT__S_IEXEC  | (MSVCRT__S_IEXEC  >> 3) | (MSVCRT__S_IEXEC  >> 6))
 
 /* _access() bit flags FIXME: incomplete */
 #define MSVCRT_W_OK      0x02
@@ -181,9 +169,9 @@
   }
   MSVCRT_fdesc[fd].handle = hand;
   MSVCRT_fdesc[fd].xflag = WX_OPEN;
-  if (flag & _O_NOINHERIT)      MSVCRT_fdesc[fd].xflag |= WX_DONTINHERIT;
-  if (flag & _O_APPEND)         MSVCRT_fdesc[fd].xflag |= WX_APPEND;
-  if (flag & _O_TEXT)           MSVCRT_fdesc[fd].xflag |= WX_TEXT;
+  if (flag & MSVCRT__O_NOINHERIT)      MSVCRT_fdesc[fd].xflag |= WX_DONTINHERIT;
+  if (flag & MSVCRT__O_APPEND)         MSVCRT_fdesc[fd].xflag |= WX_APPEND;
+  if (flag & MSVCRT__O_TEXT)           MSVCRT_fdesc[fd].xflag |= WX_TEXT;
 
   /* locate next free slot */
   if (fd == MSVCRT_fdend)
@@ -284,7 +272,7 @@
 {
   if(file->_bufsiz) {
         int cnt=file->_ptr-file->_base;
-        if(cnt>0 && _write(file->_file, file->_base, cnt) != cnt) {
+        if(cnt>0 && MSVCRT__write(file->_file, file->_base, cnt) != cnt) {
             file->_flag |= MSVCRT__IOERR;
             return MSVCRT_EOF;
         }
@@ -352,12 +340,12 @@
 
   if (!filename || attr == INVALID_FILE_ATTRIBUTES)
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & MSVCRT_W_OK))
   {
-    MSVCRT__set_errno(ERROR_ACCESS_DENIED);
+    msvcrt_set_errno(ERROR_ACCESS_DENIED);
     return -1;
   }
   return 0;
@@ -374,12 +362,12 @@
 
   if (!filename || attr == INVALID_FILE_ATTRIBUTES)
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   if ((attr & FILE_ATTRIBUTE_READONLY) && (mode & MSVCRT_W_OK))
   {
-    MSVCRT__set_errno(ERROR_ACCESS_DENIED);
+    msvcrt_set_errno(ERROR_ACCESS_DENIED);
     return -1;
   }
   return 0;
@@ -394,13 +382,13 @@
 
   if (oldFlags != INVALID_FILE_ATTRIBUTES)
   {
-    DWORD newFlags = (flags & _S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
+    DWORD newFlags = (flags & MSVCRT__S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
       oldFlags | FILE_ATTRIBUTE_READONLY;
 
     if (newFlags == oldFlags || SetFileAttributesA(path, newFlags))
       return 0;
   }
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -413,13 +401,13 @@
 
   if (oldFlags != INVALID_FILE_ATTRIBUTES)
   {
-    DWORD newFlags = (flags & _S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
+    DWORD newFlags = (flags & MSVCRT__S_IWRITE)? oldFlags & ~FILE_ATTRIBUTE_READONLY:
       oldFlags | FILE_ATTRIBUTE_READONLY;
 
     if (newFlags == oldFlags || SetFileAttributesW(path, newFlags))
       return 0;
   }
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -459,7 +447,7 @@
   if(DeleteFileA(path))
     return 0;
   TRACE("failed (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -472,7 +460,7 @@
   if(DeleteFileW(path))
     return 0;
   TRACE("failed (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -533,7 +521,7 @@
   if (!CloseHandle(hand))
   {
     WARN(":failed-last error (%ld)\n",GetLastError());
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   msvcrt_free_fd(fd);
@@ -562,7 +550,7 @@
       return 0;
     }
     TRACE(":failed-last error (%ld)\n",GetLastError());
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
   TRACE(":ok\n");
@@ -654,7 +642,7 @@
     return ((__int64)hoffset << 32) | ret;
   }
   TRACE(":error-last error (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -688,11 +676,11 @@
   }
 
   TRACE(":fd (%d) by 0x%08lx mode %s\n",
-        fd,nbytes,(mode==_LK_UNLCK)?"_LK_UNLCK":
-        (mode==_LK_LOCK)?"_LK_LOCK":
-        (mode==_LK_NBLCK)?"_LK_NBLCK":
-        (mode==_LK_RLCK)?"_LK_RLCK":
-        (mode==_LK_NBRLCK)?"_LK_NBRLCK":
+        fd,nbytes,(mode==MSVCRT__LK_UNLCK)?"_LK_UNLCK":
+        (mode==MSVCRT__LK_LOCK)?"_LK_LOCK":
+        (mode==MSVCRT__LK_NBLCK)?"_LK_NBLCK":
+        (mode==MSVCRT__LK_RLCK)?"_LK_RLCK":
+        (mode==MSVCRT__LK_NBRLCK)?"_LK_NBRLCK":
                           "UNKNOWN");
 
   if ((cur_locn = SetFilePointer(hand, 0L, NULL, SEEK_CUR)) == INVALID_SET_FILE_POINTER)
@@ -701,7 +689,7 @@
     *MSVCRT__errno() = MSVCRT_EINVAL; /* FIXME */
     return -1;
   }
-  if (mode == _LK_LOCK || mode == _LK_RLCK)
+  if (mode == MSVCRT__LK_LOCK || mode == MSVCRT__LK_RLCK)
   {
     int nretry = 10;
     ret = 1; /* just to satisfy gcc */
@@ -709,10 +697,10 @@
     {
       ret = LockFile(hand, cur_locn, 0L, nbytes, 0L);
       if (ret) break;
-      _sleep (1);
+      Sleep(1);
     }
   }
-  else if (mode == _LK_UNLCK)
+  else if (mode == MSVCRT__LK_UNLCK)
     ret = UnlockFile(hand, cur_locn, 0L, nbytes, 0L);
   else
     ret = LockFile(hand, cur_locn, 0L, nbytes, 0L);
@@ -768,15 +756,15 @@
   switch(*mode++)
   {
   case 'R': case 'r':
-    *open_flags = plus ? _O_RDWR : _O_RDONLY;
+    *open_flags = plus ? MSVCRT__O_RDWR : MSVCRT__O_RDONLY;
     *stream_flags = plus ? MSVCRT__IORW : MSVCRT__IOREAD;
     break;
   case 'W': case 'w':
-    *open_flags = _O_CREAT | _O_TRUNC | (plus  ? _O_RDWR : _O_WRONLY);
+    *open_flags = MSVCRT__O_CREAT | MSVCRT__O_TRUNC | (plus  ? MSVCRT__O_RDWR : MSVCRT__O_WRONLY);
     *stream_flags = plus ? MSVCRT__IORW : MSVCRT__IOWRT;
     break;
   case 'A': case 'a':
-    *open_flags = _O_CREAT | _O_APPEND | (plus  ? _O_RDWR : _O_WRONLY);
+    *open_flags = MSVCRT__O_CREAT | MSVCRT__O_APPEND | (plus  ? MSVCRT__O_RDWR : MSVCRT__O_WRONLY);
     *stream_flags = plus ? MSVCRT__IORW : MSVCRT__IOWRT;
     break;
   default:
@@ -787,12 +775,12 @@
     switch (*mode++)
     {
     case 'B': case 'b':
-      *open_flags |=  _O_BINARY;
-      *open_flags &= ~_O_TEXT;
+      *open_flags |=  MSVCRT__O_BINARY;
+      *open_flags &= ~MSVCRT__O_TEXT;
       break;
     case 'T': case 't':
-      *open_flags |=  _O_TEXT;
-      *open_flags &= ~_O_BINARY;
+      *open_flags |=  MSVCRT__O_TEXT;
+      *open_flags &= ~MSVCRT__O_BINARY;
       break;
     case '+':
       break;
@@ -916,7 +904,7 @@
   if (!buf)
   {
     WARN(":failed-NULL buf\n");
-    MSVCRT__set_errno(ERROR_INVALID_PARAMETER);
+    msvcrt_set_errno(ERROR_INVALID_PARAMETER);
     return -1;
   }
 
@@ -925,7 +913,7 @@
   if (!GetFileInformationByHandle(hand, &hfi))
   {
     WARN(":failed-last error (%ld)\n",GetLastError());
-    MSVCRT__set_errno(ERROR_INVALID_PARAMETER);
+    msvcrt_set_errno(ERROR_INVALID_PARAMETER);
     return -1;
   }
   FIXME(":dwFileAttributes = %ld, mode set to 0\n",hfi.dwFileAttributes);
@@ -954,7 +942,7 @@
 /*********************************************************************
  *		_futime (MSVCRT.@)
  */
-int _futime(int fd, struct _utimbuf *t)
+int MSVCRT__futime(int fd, struct MSVCRT__utimbuf *t)
 {
   HANDLE hand = msvcrt_fdtoh(fd);
   FILETIME at, wt;
@@ -977,7 +965,7 @@
 
   if (!SetFileTime(hand, NULL, &at, &wt))
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1 ;
   }
   return 0;
@@ -1108,71 +1096,71 @@
   TRACE(":file (%s) oflags: 0x%04x shflags: 0x%04x\n",
         path, oflags, shflags);
 
-  switch(oflags & (_O_RDONLY | _O_WRONLY | _O_RDWR))
+  switch(oflags & (MSVCRT__O_RDONLY | MSVCRT__O_WRONLY | MSVCRT__O_RDWR))
   {
-  case _O_RDONLY:
+  case MSVCRT__O_RDONLY:
     access |= GENERIC_READ;
     ioflag |= MSVCRT__IOREAD;
     break;
-  case _O_WRONLY:
+  case MSVCRT__O_WRONLY:
     access |= GENERIC_WRITE;
     ioflag |= MSVCRT__IOWRT;
     break;
-  case _O_RDWR:
+  case MSVCRT__O_RDWR:
     access |= GENERIC_WRITE | GENERIC_READ;
     ioflag |= MSVCRT__IORW;
     break;
   }
 
-  if (oflags & _O_CREAT)
+  if (oflags & MSVCRT__O_CREAT)
   {
     va_start(ap, shflags);
       pmode = va_arg(ap, int);
     va_end(ap);
 
-    if(pmode & ~(_S_IREAD | _S_IWRITE))
+    if(pmode & ~(MSVCRT__S_IREAD | MSVCRT__S_IWRITE))
       FIXME(": pmode 0x%04x ignored\n", pmode);
     else
       WARN(": pmode 0x%04x ignored\n", pmode);
 
-    if (oflags & _O_EXCL)
+    if (oflags & MSVCRT__O_EXCL)
       creation = CREATE_NEW;
-    else if (oflags & _O_TRUNC)
+    else if (oflags & MSVCRT__O_TRUNC)
       creation = CREATE_ALWAYS;
     else
       creation = OPEN_ALWAYS;
   }
-  else  /* no _O_CREAT */
+  else  /* no MSVCRT__O_CREAT */
   {
-    if (oflags & _O_TRUNC)
+    if (oflags & MSVCRT__O_TRUNC)
       creation = TRUNCATE_EXISTING;
     else
       creation = OPEN_EXISTING;
   }
-  if (oflags & _O_APPEND)
-    ioflag |= _O_APPEND;
+  if (oflags & MSVCRT__O_APPEND)
+    ioflag |= MSVCRT__O_APPEND;
 
-  if (oflags & _O_BINARY)
-    ioflag |= _O_BINARY;
-  else if (oflags & _O_TEXT)
-    ioflag |= _O_TEXT;
-  else if (*__p__fmode() & _O_BINARY)
-    ioflag |= _O_BINARY;
+  if (oflags & MSVCRT__O_BINARY)
+    ioflag |= MSVCRT__O_BINARY;
+  else if (oflags & MSVCRT__O_TEXT)
+    ioflag |= MSVCRT__O_TEXT;
+  else if (*MSVCRT___p__fmode() & MSVCRT__O_BINARY)
+    ioflag |= MSVCRT__O_BINARY;
   else
-    ioflag |= _O_TEXT; /* default to TEXT*/
+    ioflag |= MSVCRT__O_TEXT; /* default to TEXT*/
   
   switch( shflags )
   {
-    case _SH_DENYRW:
+    case MSVCRT__SH_DENYRW:
       sharing = 0L;
       break;
-    case _SH_DENYWR:
+    case MSVCRT__SH_DENYWR:
       sharing = FILE_SHARE_READ;
       break;
-    case _SH_DENYRD:
+    case MSVCRT__SH_DENYRD:
       sharing = FILE_SHARE_WRITE;
       break;
-    case _SH_DENYNO:
+    case MSVCRT__SH_DENYNO:
       sharing = FILE_SHARE_READ | FILE_SHARE_WRITE;
       break;
     default:
@@ -1181,26 +1169,26 @@
   }
   attrib = FILE_ATTRIBUTE_NORMAL;
 
-  if (oflags & _O_TEMPORARY)
+  if (oflags & MSVCRT__O_TEMPORARY)
   {
       attrib |= FILE_FLAG_DELETE_ON_CLOSE;
       access |= DELETE;
       sharing |= FILE_SHARE_DELETE;
   }
 
-  if (oflags & ~(_O_BINARY|_O_TEXT|_O_APPEND|_O_TRUNC|_O_EXCL
-                |_O_CREAT|_O_RDWR|_O_WRONLY|_O_TEMPORARY|_O_NOINHERIT))
+  if (oflags & ~(MSVCRT__O_BINARY|MSVCRT__O_TEXT|MSVCRT__O_APPEND|MSVCRT__O_TRUNC|MSVCRT__O_EXCL
+                |MSVCRT__O_CREAT|MSVCRT__O_RDWR|MSVCRT__O_WRONLY|MSVCRT__O_TEMPORARY|MSVCRT__O_NOINHERIT))
     ERR(":unsupported oflags 0x%04x\n",oflags);
 
   sa.nLength              = sizeof( SECURITY_ATTRIBUTES );
   sa.lpSecurityDescriptor = NULL;
-  sa.bInheritHandle       = (oflags & _O_NOINHERIT) ? FALSE : TRUE;
+  sa.bInheritHandle       = (oflags & MSVCRT__O_NOINHERIT) ? FALSE : TRUE;
 
   hand = CreateFileA(path, access, sharing, &sa, creation, attrib, 0);
 
   if (hand == INVALID_HANDLE_VALUE)  {
     WARN(":failed-last error (%ld)\n",GetLastError());
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
 
@@ -1210,7 +1198,7 @@
 
   if (fd > 0)
   {
-    if (oflags & _O_APPEND)
+    if (oflags & MSVCRT__O_APPEND)
       _lseek(fd, 0, FILE_END);
   }
 
@@ -1238,7 +1226,7 @@
     return retval;
   }
 
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -1249,16 +1237,16 @@
 {
   va_list ap;
 
-  if (flags & _O_CREAT)
+  if (flags & MSVCRT__O_CREAT)
   {
     int pmode;
     va_start(ap, flags);
     pmode = va_arg(ap, int);
     va_end(ap);
-    return MSVCRT__sopen( path, flags, _SH_DENYNO, pmode );
+    return MSVCRT__sopen( path, flags, MSVCRT__SH_DENYNO, pmode );
   }
   else
-    return MSVCRT__sopen( path, flags, _SH_DENYNO);
+    return MSVCRT__sopen( path, flags, MSVCRT__SH_DENYNO);
 }
 
 /*********************************************************************
@@ -1282,7 +1270,7 @@
     return retval;
   }
 
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -1291,7 +1279,7 @@
  */
 int _creat(const char *path, int flags)
 {
-  int usedFlags = (flags & _O_TEXT)| _O_CREAT| _O_WRONLY| _O_TRUNC;
+  int usedFlags = (flags & MSVCRT__O_TEXT)| MSVCRT__O_CREAT| MSVCRT__O_WRONLY| MSVCRT__O_TRUNC;
   return _open(path, usedFlags);
 }
 
@@ -1300,7 +1288,7 @@
  */
 int _wcreat(const MSVCRT_wchar_t *path, int flags)
 {
-  int usedFlags = (flags & _O_TEXT)| _O_CREAT| _O_WRONLY| _O_TRUNC;
+  int usedFlags = (flags & MSVCRT__O_TEXT)| MSVCRT__O_CREAT| MSVCRT__O_WRONLY| MSVCRT__O_TRUNC;
   return _wopen(path, usedFlags);
 }
 
@@ -1311,16 +1299,16 @@
 {
   int fd;
 
-  /* _O_RDONLY (0) always matches, so set the read flag
+  /* MSVCRT__O_RDONLY (0) always matches, so set the read flag
    * MFC's CStdioFile clears O_RDONLY (0)! if it wants to write to the
-   * file, so set the write flag. It also only sets _O_TEXT if it wants
-   * text - it never sets _O_BINARY.
+   * file, so set the write flag. It also only sets MSVCRT__O_TEXT if it wants
+   * text - it never sets MSVCRT__O_BINARY.
    */
   /* FIXME: handle more flags */
-  if (!(flags & (_O_BINARY | _O_TEXT)) && (*__p__fmode() & _O_BINARY))
-      flags |= _O_BINARY;
+  if (!(flags & (MSVCRT__O_BINARY | MSVCRT__O_TEXT)) && (*MSVCRT___p__fmode() & MSVCRT__O_BINARY))
+      flags |= MSVCRT__O_BINARY;
   else
-      flags |= _O_TEXT;
+      flags |= MSVCRT__O_TEXT;
 
   fd = msvcrt_alloc_fd((HANDLE)hand,flags);
   TRACE(":handle (%ld) fd (%d) flags 0x%08x\n",hand,fd,flags);
@@ -1433,10 +1421,10 @@
  */
 int _setmode(int fd,int mode)
 {
-  int ret = MSVCRT_fdesc[fd].xflag & WX_TEXT ? _O_TEXT : _O_BINARY;
-  if (mode & (~(_O_TEXT|_O_BINARY)))
+  int ret = MSVCRT_fdesc[fd].xflag & WX_TEXT ? MSVCRT__O_TEXT : MSVCRT__O_BINARY;
+  if (mode & (~(MSVCRT__O_TEXT|MSVCRT__O_BINARY)))
     FIXME("fd (%d) mode (0x%08x) unknown\n",fd,mode);
-  if ((mode & _O_TEXT) == _O_TEXT)
+  if ((mode & MSVCRT__O_TEXT) == MSVCRT__O_TEXT)
       MSVCRT_fdesc[fd].xflag |= WX_TEXT;
   else
       MSVCRT_fdesc[fd].xflag &= ~WX_TEXT;
@@ -1450,7 +1438,7 @@
 {
   DWORD dw;
   WIN32_FILE_ATTRIBUTE_DATA hfi;
-  unsigned short mode = MSVCRT_S_IREAD;
+  unsigned short mode = ALL_S_IREAD;
   int plen;
 
   TRACE(":file (%s) buf(%p)\n",path,buf);
@@ -1458,7 +1446,7 @@
   if (!GetFileAttributesExA(path, GetFileExInfoStandard, &hfi))
   {
       TRACE("failed (%ld)\n",GetLastError());
-      MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
+      msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
       return -1;
   }
 
@@ -1472,29 +1460,29 @@
   if (isalpha(*path)&& (*(path+1)==':'))
     buf->st_dev = buf->st_rdev = toupper(*path) - 'A'; /* drive num */
   else
-    buf->st_dev = buf->st_rdev = _getdrive() - 1;
+    buf->st_dev = buf->st_rdev = MSVCRT__getdrive() - 1;
 
   plen = strlen(path);
 
   /* Dir, or regular file? */
   if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
       (path[plen-1] == '\\'))
-    mode |= (_S_IFDIR | MSVCRT_S_IEXEC);
+    mode |= (MSVCRT__S_IFDIR | ALL_S_IEXEC);
   else
   {
-    mode |= _S_IFREG;
+    mode |= MSVCRT__S_IFREG;
     /* executable? */
     if (plen > 6 && path[plen-4] == '.')  /* shortest exe: "\x.exe" */
     {
       unsigned int ext = tolower(path[plen-1]) | (tolower(path[plen-2]) << 8) |
                                  (tolower(path[plen-3]) << 16);
       if (ext == EXE || ext == BAT || ext == CMD || ext == COM)
-          mode |= MSVCRT_S_IEXEC;
+          mode |= ALL_S_IEXEC;
     }
   }
 
   if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
-    mode |= MSVCRT_S_IWRITE;
+    mode |= ALL_S_IWRITE;
 
   buf->st_mode  = mode;
   buf->st_nlink = 1;
@@ -1529,7 +1517,7 @@
 {
   DWORD dw;
   WIN32_FILE_ATTRIBUTE_DATA hfi;
-  unsigned short mode = MSVCRT_S_IREAD;
+  unsigned short mode = ALL_S_IREAD;
   int plen;
 
   TRACE(":file (%s) buf(%p)\n",debugstr_w(path),buf);
@@ -1537,7 +1525,7 @@
   if (!GetFileAttributesExW(path, GetFileExInfoStandard, &hfi))
   {
       TRACE("failed (%ld)\n",GetLastError());
-      MSVCRT__set_errno(ERROR_FILE_NOT_FOUND);
+      msvcrt_set_errno(ERROR_FILE_NOT_FOUND);
       return -1;
   }
 
@@ -1547,29 +1535,29 @@
   if (MSVCRT_iswalpha(*path))
     buf->st_dev = buf->st_rdev = toupperW(*path - 'A'); /* drive num */
   else
-    buf->st_dev = buf->st_rdev = _getdrive() - 1;
+    buf->st_dev = buf->st_rdev = MSVCRT__getdrive() - 1;
 
   plen = strlenW(path);
 
   /* Dir, or regular file? */
   if ((hfi.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
       (path[plen-1] == '\\'))
-    mode |= (_S_IFDIR | MSVCRT_S_IEXEC);
+    mode |= (MSVCRT__S_IFDIR | ALL_S_IEXEC);
   else
   {
-    mode |= _S_IFREG;
+    mode |= MSVCRT__S_IFREG;
     /* executable? */
     if (plen > 6 && path[plen-4] == '.')  /* shortest exe: "\x.exe" */
     {
       ULONGLONG ext = tolowerW(path[plen-1]) | (tolowerW(path[plen-2]) << 16) |
                                ((ULONGLONG)tolowerW(path[plen-3]) << 32);
       if (ext == WCEXE || ext == WCBAT || ext == WCCMD || ext == WCCOM)
-        mode |= MSVCRT_S_IEXEC;
+        mode |= ALL_S_IEXEC;
     }
   }
 
   if (!(hfi.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
-    mode |= MSVCRT_S_IWRITE;
+    mode |= ALL_S_IWRITE;
 
   buf->st_mode  = mode;
   buf->st_nlink = 1;
@@ -1625,7 +1613,7 @@
   {
     TRACE("got name (%s)\n",tmpbuf);
     DeleteFileA(tmpbuf);
-    return _strdup(tmpbuf);
+    return MSVCRT__strdup(tmpbuf);
   }
   TRACE("failed (%ld)\n",GetLastError());
   return NULL;
@@ -1643,7 +1631,7 @@
   {
     TRACE("got name (%s)\n",debugstr_w(tmpbuf));
     DeleteFileW(tmpbuf);
-    return _wcsdup(tmpbuf);
+    return MSVCRT__wcsdup(tmpbuf);
   }
   TRACE("failed (%ld)\n",GetLastError());
   return NULL;
@@ -1663,13 +1651,13 @@
 /*********************************************************************
  *		_utime (MSVCRT.@)
  */
-int _utime(const char* path, struct _utimbuf *t)
+int _utime(const char* path, struct MSVCRT__utimbuf *t)
 {
-  int fd = _open(path, _O_WRONLY | _O_BINARY);
+  int fd = _open(path, MSVCRT__O_WRONLY | MSVCRT__O_BINARY);
 
   if (fd > 0)
   {
-    int retVal = _futime(fd, t);
+    int retVal = MSVCRT__futime(fd, t);
     _close(fd);
     return retVal;
   }
@@ -1679,13 +1667,13 @@
 /*********************************************************************
  *		_wutime (MSVCRT.@)
  */
-int _wutime(const MSVCRT_wchar_t* path, struct _utimbuf *t)
+int _wutime(const MSVCRT_wchar_t* path, struct MSVCRT__utimbuf *t)
 {
-  int fd = _wopen(path, _O_WRONLY | _O_BINARY);
+  int fd = _wopen(path, MSVCRT__O_WRONLY | MSVCRT__O_BINARY);
 
   if (fd > 0)
   {
-    int retVal = _futime(fd, t);
+    int retVal = MSVCRT__futime(fd, t);
     _close(fd);
     return retVal;
   }
@@ -1695,7 +1683,7 @@
 /*********************************************************************
  *		_write (MSVCRT.@)
  */
-int _write(int fd, const void* buf, unsigned int count)
+int MSVCRT__write(int fd, const void* buf, unsigned int count)
 {
   DWORD num_written;
   HANDLE hand = msvcrt_fdtoh(fd);
@@ -1784,7 +1772,7 @@
 int MSVCRT__putw(int val, MSVCRT_FILE* file)
 {
   int len;
-  len = _write(file->_file, &val, sizeof(val));
+  len = MSVCRT__write(file->_file, &val, sizeof(val));
   if (len == sizeof(val)) return val;
   file->_flag |= MSVCRT__IOERR;
   return MSVCRT_EOF;
@@ -1921,7 +1909,7 @@
 /*********************************************************************
  *		fgetwc (MSVCRT.@)
  *
- * In _O_TEXT mode, multibyte characters are read from the file, dropping
+ * In MSVCRT__O_TEXT mode, multibyte characters are read from the file, dropping
  * the CR from CR/LF combinations
  */
 MSVCRT_wint_t MSVCRT_fgetwc(MSVCRT_FILE* file)
@@ -1940,7 +1928,7 @@
       return wc;
     }
   c = MSVCRT_fgetc(file);
-  if ((*__p___mb_cur_max() > 1) && MSVCRT_isleadbyte(c))
+  if ((*MSVCRT___p___mb_cur_max() > 1) && MSVCRT_isleadbyte(c))
     {
       FIXME("Treat Multibyte characters\n");
     }
@@ -2029,7 +2017,7 @@
 	/* Flush buffer */
   	int res=msvcrt_flush_buffer(file);
 	if(!res) {
-		int pwritten = _write(file->_file, ptr, wrcnt);
+		int pwritten = MSVCRT__write(file->_file, ptr, wrcnt);
   		if (pwritten <= 0)
                 {
                     file->_flag |= MSVCRT__IOERR;
@@ -2074,7 +2062,7 @@
   if (msvcrt_get_flags(mode, &open_flags, &stream_flags) == -1)
       return NULL;
 
-  fd = _open(path, open_flags, _S_IREAD | _S_IWRITE);
+  fd = _open(path, open_flags, MSVCRT__S_IREAD | MSVCRT__S_IWRITE);
 
   if (fd < 0)
     return NULL;
@@ -2114,7 +2102,7 @@
     return retval;
   }
 
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return NULL;
 }
 
@@ -2176,7 +2164,7 @@
   } else {
 	unsigned char cc=c;
         int len;
-  	len = _write(file->_file, &cc, 1);
+  	len = MSVCRT__write(file->_file, &cc, 1);
         if (len == 1) return c;
         file->_flag |= MSVCRT__IOERR;
         return MSVCRT_EOF;
@@ -2250,7 +2238,7 @@
   if (msvcrt_get_flags(mode, &open_flags, &stream_flags) == -1)
       return NULL;
 
-  fd = _open(path, open_flags, _S_IREAD | _S_IWRITE);
+  fd = _open(path, open_flags, MSVCRT__S_IREAD | MSVCRT__S_IWRITE);
 
   if (fd < 0)
     return NULL;
@@ -2258,7 +2246,7 @@
   {
       file->_flag = 0;
       WARN(":failed-last error (%ld)\n",GetLastError());
-      MSVCRT__set_errno(GetLastError());
+      msvcrt_set_errno(GetLastError());
       return NULL;
   }
   return file;
@@ -2432,7 +2420,7 @@
   if (DeleteFileA(path))
     return 0;
   TRACE(":failed (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -2445,7 +2433,7 @@
   if (DeleteFileW(path))
     return 0;
   TRACE(":failed (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -2458,7 +2446,7 @@
   if (MoveFileExA(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
     return 0;
   TRACE(":failed (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -2471,7 +2459,7 @@
   if (MoveFileExW(oldpath, newpath, MOVEFILE_COPY_ALLOWED))
     return 0;
   TRACE(":failed (%ld)\n",GetLastError());
-  MSVCRT__set_errno(GetLastError());
+  msvcrt_set_errno(GetLastError());
   return -1;
 }
 
@@ -2539,15 +2527,15 @@
   int fd;
   MSVCRT_FILE* file = NULL;
 
-  fd = _open(filename, _O_CREAT | _O_BINARY | _O_RDWR | _O_TEMPORARY);
+  fd = _open(filename, MSVCRT__O_CREAT | MSVCRT__O_BINARY | MSVCRT__O_RDWR | MSVCRT__O_TEMPORARY);
   if (fd != -1 && (file = msvcrt_alloc_fp()))
   {
-    if (msvcrt_init_fp(file, fd, _O_RDWR) == -1)
+    if (msvcrt_init_fp(file, fd, MSVCRT__O_RDWR) == -1)
     {
         file->_flag = 0;
         file = NULL;
     }
-    else file->_tmpfname = _strdup(filename);
+    else file->_tmpfname = MSVCRT__strdup(filename);
   }
   return file;
 }
@@ -2590,7 +2578,7 @@
   MSVCRT_wchar_t buf[2048], *mem = buf;
   int written, resize = sizeof(buf) / sizeof(MSVCRT_wchar_t), retval;
   /* See vfprintf comments */
-  while ((written = _vsnwprintf(mem, resize, format, valist)) == -1 ||
+  while ((written = MSVCRT__vsnwprintf(mem, resize, format, valist)) == -1 ||
           written > resize)
   {
     resize = (written == -1 ? resize * 2 : written + sizeof(MSVCRT_wchar_t));
Index: dlls/msvcrt/heap.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/heap.c,v
retrieving revision 1.14
diff -u -r1.14 heap.c
--- dlls/msvcrt/heap.c	20 Nov 2003 23:41:13 -0000	1.14
+++ dlls/msvcrt/heap.c	19 Jun 2004 06:41:55 -0000
@@ -22,12 +22,7 @@
  */
 
 #include "msvcrt.h"
-#include "msvcrt/errno.h"
-
-#include "msvcrt/malloc.h"
-#include "msvcrt/stdlib.h"
 #include "mtdll.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -46,7 +41,7 @@
 /*********************************************************************
  *		??2 at YAPAXI@Z (MSVCRT.@)
  */
-void* MSVCRT_operator_new(unsigned long size)
+void* _operator_new(unsigned long size)
 {
   void *retval = HeapAlloc(GetProcessHeap(), 0, size);
   TRACE("(%ld) returning %p\n", size, retval);
@@ -60,7 +55,7 @@
 /*********************************************************************
  *		??3 at YAXPAX@Z (MSVCRT.@)
  */
-void MSVCRT_operator_delete(void *mem)
+void _operator_delete(void *mem)
 {
   TRACE("(%p)\n", mem);
   HeapFree(GetProcessHeap(), 0, mem);
@@ -110,7 +105,7 @@
 /*********************************************************************
  *		?_set_new_mode@@YAHH at Z (MSVCRT.@)
  */
-int MSVCRT__set_new_mode(int mode)
+int _set_new_mode(int mode)
 {
   int old_mode;
   LOCK_HEAP;
@@ -145,10 +140,10 @@
 {
   if (!HeapValidate( GetProcessHeap(), 0, NULL))
   {
-    MSVCRT__set_errno(GetLastError());
-    return _HEAPBADNODE;
+    msvcrt_set_errno(GetLastError());
+    return MSVCRT__HEAPBADNODE;
   }
-  return _HEAPOK;
+  return MSVCRT__HEAPOK;
 }
 
 /*********************************************************************
@@ -159,7 +154,7 @@
   if (!HeapCompact( GetProcessHeap(), 0 ))
   {
     if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
-      MSVCRT__set_errno(GetLastError());
+      msvcrt_set_errno(GetLastError());
     return -1;
   }
   return 0;
@@ -168,21 +163,21 @@
 /*********************************************************************
  *		_heapwalk (MSVCRT.@)
  */
-int _heapwalk(_HEAPINFO* next)
+int _heapwalk(struct MSVCRT__heapinfo* next)
 {
   PROCESS_HEAP_ENTRY phe;
 
   LOCK_HEAP;
   phe.lpData = next->_pentry;
   phe.cbData = next->_size;
-  phe.wFlags = next->_useflag == _USEDENTRY ? PROCESS_HEAP_ENTRY_BUSY : 0;
+  phe.wFlags = next->_useflag == MSVCRT__USEDENTRY ? PROCESS_HEAP_ENTRY_BUSY : 0;
 
   if (phe.lpData && phe.wFlags & PROCESS_HEAP_ENTRY_BUSY &&
       !HeapValidate( GetProcessHeap(), 0, phe.lpData ))
   {
     UNLOCK_HEAP;
-    MSVCRT__set_errno(GetLastError());
-    return _HEAPBADNODE;
+    msvcrt_set_errno(GetLastError());
+    return MSVCRT__HEAPBADNODE;
   }
 
   do
@@ -191,19 +186,19 @@
     {
       UNLOCK_HEAP;
       if (GetLastError() == ERROR_NO_MORE_ITEMS)
-         return _HEAPEND;
-      MSVCRT__set_errno(GetLastError());
+         return MSVCRT__HEAPEND;
+      msvcrt_set_errno(GetLastError());
       if (!phe.lpData)
-        return _HEAPBADBEGIN;
-      return _HEAPBADNODE;
+        return MSVCRT__HEAPBADBEGIN;
+      return MSVCRT__HEAPBADNODE;
     }
   } while (phe.wFlags & (PROCESS_HEAP_REGION|PROCESS_HEAP_UNCOMMITTED_RANGE));
 
   UNLOCK_HEAP;
   next->_pentry = phe.lpData;
   next->_size = phe.cbData;
-  next->_useflag = phe.wFlags & PROCESS_HEAP_ENTRY_BUSY ? _USEDENTRY : _FREEENTRY;
-  return _HEAPOK;
+  next->_useflag = phe.wFlags & PROCESS_HEAP_ENTRY_BUSY ? MSVCRT__USEDENTRY : MSVCRT__FREEENTRY;
+  return MSVCRT__HEAPOK;
 }
 
 /*********************************************************************
@@ -212,17 +207,17 @@
 int _heapset(unsigned int value)
 {
   int retval;
-  _HEAPINFO heap;
+  struct MSVCRT__heapinfo heap;
 
-  memset( &heap, 0, sizeof(_HEAPINFO) );
+  memset( &heap, 0, sizeof(heap) );
   LOCK_HEAP;
-  while ((retval = _heapwalk(&heap)) == _HEAPOK)
+  while ((retval = _heapwalk(&heap)) == MSVCRT__HEAPOK)
   {
-    if (heap._useflag == _FREEENTRY)
+    if (heap._useflag == MSVCRT__FREEENTRY)
       memset(heap._pentry, value, heap._size);
   }
   UNLOCK_HEAP;
-  return retval == _HEAPEND? _HEAPOK : retval;
+  return retval == MSVCRT__HEAPEND? MSVCRT__HEAPOK : retval;
 }
 
 /*********************************************************************
@@ -272,7 +267,7 @@
 {
   void *ret = HeapAlloc(GetProcessHeap(),0,size);
   if (!ret)
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
   return ret;
 }
 
Index: dlls/msvcrt/locale.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/locale.c,v
retrieving revision 1.22
diff -u -r1.22 locale.c
--- dlls/msvcrt/locale.c	13 Jan 2004 05:45:05 -0000	1.22
+++ dlls/msvcrt/locale.c	19 Jun 2004 06:41:55 -0000
@@ -30,7 +30,6 @@
 #include "winuser.h"
 
 #include "msvcrt.h"
-#include "msvcrt/locale.h"
 #include "mtdll.h"
 
 #include "wine/debug.h"
@@ -44,7 +43,7 @@
 #define MAX_LOCALE_LENGTH 256
 char MSVCRT_current_lc_all[MAX_LOCALE_LENGTH];
 LCID MSVCRT_current_lc_all_lcid;
-int MSVCRT_current_lc_all_cp;
+int msvcrt_current_lc_all_cp;
 
 /* MT */
 #define LOCK_LOCALE   _mlock(_SETLOCALE_LOCK);
@@ -275,7 +274,7 @@
     unsigned char *traverse = (unsigned char *)cp.LeadByte;
 
     memset(MSVCRT_current_ctype, 0, sizeof(MSVCRT__ctype));
-    MSVCRT_current_lc_all_cp = codepage;
+    msvcrt_current_lc_all_cp = codepage;
 
     /* Switch ctype macros to MBCS if needed */
     MSVCRT___mb_cur_max = cp.MaxCharSize;
@@ -342,7 +341,7 @@
   {
     MSVCRT_current_lc_all[0] = 'C';
     MSVCRT_current_lc_all[1] = '\0';
-    MSVCRT_current_lc_all_cp = GetACP();
+    msvcrt_current_lc_all_cp = GetACP();
 
     switch (category) {
     case MSVCRT_LC_ALL:
@@ -520,10 +519,10 @@
 void _setmbcp(int cp)
 {
   LOCK_LOCALE;
-  if (MSVCRT_current_lc_all_cp != cp)
+  if (msvcrt_current_lc_all_cp != cp)
   {
     /* FIXME: set ctype behaviour for this cp */
-    MSVCRT_current_lc_all_cp = cp;
+    msvcrt_current_lc_all_cp = cp;
   }
   UNLOCK_LOCALE;
 }
@@ -533,7 +532,7 @@
  */
 int _getmbcp(void)
 {
-  return MSVCRT_current_lc_all_cp;
+  return msvcrt_current_lc_all_cp;
 }
 
 /*********************************************************************
Index: dlls/msvcrt/main.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/main.c,v
retrieving revision 1.17
diff -u -r1.17 main.c
--- dlls/msvcrt/main.c	13 Jan 2004 22:56:59 -0000	1.17
+++ dlls/msvcrt/main.c	19 Jun 2004 06:41:55 -0000
@@ -19,15 +19,12 @@
  */
 #include "msvcrt.h"
 
-#include "msvcrt/locale.h"
-#include "msvcrt/stdio.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
 /* Index to TLS */
-DWORD MSVCRT_tls_index;
+DWORD msvcrt_tls_index;
 
 static inline BOOL msvcrt_init_tls(void);
 static inline BOOL msvcrt_free_tls(void);
@@ -38,12 +35,12 @@
  */
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 {
-  MSVCRT_thread_data *tls;
+  thread_data_t *tls;
 
   TRACE("(%p, %s, %p) pid(%lx), tid(%lx), tls(%ld)\n",
         hinstDLL, msvcrt_get_reason(fdwReason), lpvReserved,
         GetCurrentProcessId(), GetCurrentThreadId(),
-        (long)MSVCRT_tls_index);
+        (long)msvcrt_tls_index);
 
   switch (fdwReason)
   {
@@ -70,7 +67,7 @@
     break;
   case DLL_THREAD_DETACH:
     /* Free TLS */
-    tls = TlsGetValue(MSVCRT_tls_index);
+    tls = TlsGetValue(msvcrt_tls_index);
     if (tls) HeapFree(GetProcessHeap(), 0, tls);
     TRACE("finished thread free\n");
     break;
@@ -80,9 +77,9 @@
 
 static inline BOOL msvcrt_init_tls(void)
 {
-  MSVCRT_tls_index = TlsAlloc();
+  msvcrt_tls_index = TlsAlloc();
 
-  if (MSVCRT_tls_index == TLS_OUT_OF_INDEXES)
+  if (msvcrt_tls_index == TLS_OUT_OF_INDEXES)
   {
     ERR("TlsAlloc() failed!\n");
     return FALSE;
@@ -92,7 +89,7 @@
 
 static inline BOOL msvcrt_free_tls(void)
 {
-  if (!TlsFree(MSVCRT_tls_index))
+  if (!TlsFree(msvcrt_tls_index))
   {
     ERR("TlsFree() failed!\n");
     return FALSE;
@@ -140,11 +137,9 @@
  *  Success: A string pointing to the unmangled name, allocated with memget.
  *  Failure: NULL.
  */
-char* MSVCRT___unDNameEx(char * OutStr, const char* mangled, int OutStrLen,
-                       MSVCRT_malloc_func memget,
-                       MSVCRT_free_func memfree,
-                       void * unknown,
-                       unsigned short int flags)
+char* __unDNameEx(char * OutStr, const char* mangled, int OutStrLen,
+                  malloc_func_t memget, free_func_t memfree,
+                  void * unknown, unsigned short int flags)
 {
   FIXME("(%p,%s,%d,%p,%p,%p,%x) stub!\n",
           OutStr, mangled, OutStrLen, memget, memfree, unknown, flags);
@@ -177,11 +172,9 @@
 /*********************************************************************
  *		__unDName (MSVCRT.@)
  */
-char* MSVCRT___unDName(char * OutStr, const char* mangled, int OutStrLen,
-                       MSVCRT_malloc_func memget,
-                       MSVCRT_free_func memfree,
-                       unsigned short int flags)
+char* __unDName(char * OutStr, const char* mangled, int OutStrLen,
+                malloc_func_t memget, free_func_t memfree,
+                unsigned short int flags)
 {
-   return MSVCRT___unDNameEx( OutStr, mangled, OutStrLen, memget, memfree,
-           NULL, flags);
+   return __unDNameEx( OutStr, mangled, OutStrLen, memget, memfree, 0, flags);
 }
Index: dlls/msvcrt/math.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/math.c,v
retrieving revision 1.23
diff -u -r1.23 math.c
--- dlls/msvcrt/math.c	12 May 2004 23:22:36 -0000	1.23
+++ dlls/msvcrt/math.c	20 Jun 2004 15:27:27 -0000
@@ -28,10 +28,6 @@
 #endif
 
 #include "msvcrt.h"
-#include "msvcrt/errno.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/math.h"
-#include "msvcrt/float.h"
 
 #include "wine/debug.h"
 
@@ -262,50 +258,50 @@
   switch (fpclass( num ))
   {
 #ifdef FP_SNAN
-  case FP_SNAN:  return _FPCLASS_SNAN;
+  case FP_SNAN:  return MSVCRT__FPCLASS_SNAN;
 #endif
 #ifdef FP_QNAN
-  case FP_QNAN:  return _FPCLASS_QNAN;
+  case FP_QNAN:  return MSVCRT__FPCLASS_QNAN;
 #endif
 #ifdef FP_NINF
-  case FP_NINF:  return _FPCLASS_NINF;
+  case FP_NINF:  return MSVCRT__FPCLASS_NINF;
 #endif
 #ifdef FP_PINF
-  case FP_PINF:  return _FPCLASS_PINF;
+  case FP_PINF:  return MSVCRT__FPCLASS_PINF;
 #endif
 #ifdef FP_NDENORM
-  case FP_NDENORM: return _FPCLASS_ND;
+  case FP_NDENORM: return MSVCRT__FPCLASS_ND;
 #endif
 #ifdef FP_PDENORM
-  case FP_PDENORM: return _FPCLASS_PD;
+  case FP_PDENORM: return MSVCRT__FPCLASS_PD;
 #endif
 #ifdef FP_NZERO
-  case FP_NZERO: return _FPCLASS_NZ;
+  case FP_NZERO: return MSVCRT__FPCLASS_NZ;
 #endif
 #ifdef FP_PZERO
-  case FP_PZERO: return _FPCLASS_PZ;
+  case FP_PZERO: return MSVCRT__FPCLASS_PZ;
 #endif
 #ifdef FP_NNORM
-  case FP_NNORM: return _FPCLASS_NN;
+  case FP_NNORM: return MSVCRT__FPCLASS_NN;
 #endif
 #ifdef FP_PNORM
-  case FP_PNORM: return _FPCLASS_PN;
+  case FP_PNORM: return MSVCRT__FPCLASS_PN;
 #endif
   }
-  return _FPCLASS_PN;
+  return MSVCRT__FPCLASS_PN;
 #elif defined (fpclassify)
   switch (fpclassify( num ))
   {
-  case FP_NAN: return _FPCLASS_QNAN;
-  case FP_INFINITE: return signbit(num) ? _FPCLASS_NINF : _FPCLASS_PINF;
-  case FP_SUBNORMAL: return signbit(num) ?_FPCLASS_ND : _FPCLASS_PD;
-  case FP_ZERO: return signbit(num) ? _FPCLASS_NZ : _FPCLASS_PZ;
+  case FP_NAN: return MSVCRT__FPCLASS_QNAN;
+  case FP_INFINITE: return signbit(num) ? MSVCRT__FPCLASS_NINF : MSVCRT__FPCLASS_PINF;
+  case FP_SUBNORMAL: return signbit(num) ?MSVCRT__FPCLASS_ND : MSVCRT__FPCLASS_PD;
+  case FP_ZERO: return signbit(num) ? MSVCRT__FPCLASS_NZ : MSVCRT__FPCLASS_PZ;
   }
-  return signbit(num) ? _FPCLASS_NN : _FPCLASS_PN;
+  return signbit(num) ? MSVCRT__FPCLASS_NN : MSVCRT__FPCLASS_PN;
 #else
   if (!finite(num))
-    return _FPCLASS_QNAN;
-  return num == 0.0 ? _FPCLASS_PZ : (num < 0 ? _FPCLASS_NN : _FPCLASS_PN);
+    return MSVCRT__FPCLASS_QNAN;
+  return num == 0.0 ? MSVCRT__FPCLASS_PZ : (num < 0 ? MSVCRT__FPCLASS_NN : MSVCRT__FPCLASS_PN);
 #endif
 }
 
@@ -400,12 +396,12 @@
   unsigned int fpword;
 
   __asm__ __volatile__( "fstsw %0" : "=m" (fpword) : );
-  if (fpword & 0x1)  retVal |= _SW_INVALID;
-  if (fpword & 0x2)  retVal |= _SW_DENORMAL;
-  if (fpword & 0x4)  retVal |= _SW_ZERODIVIDE;
-  if (fpword & 0x8)  retVal |= _SW_OVERFLOW;
-  if (fpword & 0x10) retVal |= _SW_UNDERFLOW;
-  if (fpword & 0x20) retVal |= _SW_INEXACT;
+  if (fpword & 0x1)  retVal |= MSVCRT__SW_INVALID;
+  if (fpword & 0x2)  retVal |= MSVCRT__SW_DENORMAL;
+  if (fpword & 0x4)  retVal |= MSVCRT__SW_ZERODIVIDE;
+  if (fpword & 0x8)  retVal |= MSVCRT__SW_OVERFLOW;
+  if (fpword & 0x10) retVal |= MSVCRT__SW_UNDERFLOW;
+  if (fpword & 0x20) retVal |= MSVCRT__SW_INEXACT;
 #else
   FIXME(":Not implemented!\n");
 #endif
@@ -482,46 +478,46 @@
   TRACE("Control word before : %08x\n", fpword);
 
   /* Convert into mask constants */
-  if (fpword & 0x1)  flags |= _EM_INVALID;
-  if (fpword & 0x2)  flags |= _EM_DENORMAL;
-  if (fpword & 0x4)  flags |= _EM_ZERODIVIDE;
-  if (fpword & 0x8)  flags |= _EM_OVERFLOW;
-  if (fpword & 0x10) flags |= _EM_UNDERFLOW;
-  if (fpword & 0x20) flags |= _EM_INEXACT;
+  if (fpword & 0x1)  flags |= MSVCRT__EM_INVALID;
+  if (fpword & 0x2)  flags |= MSVCRT__EM_DENORMAL;
+  if (fpword & 0x4)  flags |= MSVCRT__EM_ZERODIVIDE;
+  if (fpword & 0x8)  flags |= MSVCRT__EM_OVERFLOW;
+  if (fpword & 0x10) flags |= MSVCRT__EM_UNDERFLOW;
+  if (fpword & 0x20) flags |= MSVCRT__EM_INEXACT;
   switch(fpword & 0xC00) {
-  case 0xC00: flags |= _RC_UP|_RC_DOWN; break;
-  case 0x800: flags |= _RC_UP; break;
-  case 0x400: flags |= _RC_DOWN; break;
+  case 0xC00: flags |= MSVCRT__RC_UP|MSVCRT__RC_DOWN; break;
+  case 0x800: flags |= MSVCRT__RC_UP; break;
+  case 0x400: flags |= MSVCRT__RC_DOWN; break;
   }
   switch(fpword & 0x300) {
-  case 0x0:   flags |= _PC_24; break;
-  case 0x200: flags |= _PC_53; break;
-  case 0x300: flags |= _PC_64; break;
+  case 0x0:   flags |= MSVCRT__PC_24; break;
+  case 0x200: flags |= MSVCRT__PC_53; break;
+  case 0x300: flags |= MSVCRT__PC_64; break;
   }
-  if (fpword & 0x1000) flags |= _IC_AFFINE;
+  if (fpword & 0x1000) flags |= MSVCRT__IC_AFFINE;
 
   /* Mask with parameters */
   flags = (flags & ~mask) | (newval & mask);
 
   /* Convert (masked) value back to fp word */
   fpword = 0;
-  if (flags & _EM_INVALID)    fpword |= 0x1;
-  if (flags & _EM_DENORMAL)   fpword |= 0x2;
-  if (flags & _EM_ZERODIVIDE) fpword |= 0x4;
-  if (flags & _EM_OVERFLOW)   fpword |= 0x8;
-  if (flags & _EM_UNDERFLOW)  fpword |= 0x10;
-  if (flags & _EM_INEXACT)    fpword |= 0x20;
-  switch(flags & (_RC_UP | _RC_DOWN)) {
-  case _RC_UP|_RC_DOWN: fpword |= 0xC00; break;
-  case _RC_UP:          fpword |= 0x800; break;
-  case _RC_DOWN:        fpword |= 0x400; break;
+  if (flags & MSVCRT__EM_INVALID)    fpword |= 0x1;
+  if (flags & MSVCRT__EM_DENORMAL)   fpword |= 0x2;
+  if (flags & MSVCRT__EM_ZERODIVIDE) fpword |= 0x4;
+  if (flags & MSVCRT__EM_OVERFLOW)   fpword |= 0x8;
+  if (flags & MSVCRT__EM_UNDERFLOW)  fpword |= 0x10;
+  if (flags & MSVCRT__EM_INEXACT)    fpword |= 0x20;
+  switch(flags & (MSVCRT__RC_UP | MSVCRT__RC_DOWN)) {
+  case MSVCRT__RC_UP|MSVCRT__RC_DOWN: fpword |= 0xC00; break;
+  case MSVCRT__RC_UP:          fpword |= 0x800; break;
+  case MSVCRT__RC_DOWN:        fpword |= 0x400; break;
   }
-  switch (flags & (_PC_24 | _PC_53)) {
-  case _PC_64: fpword |= 0x300; break;
-  case _PC_53: fpword |= 0x200; break;
-  case _PC_24: fpword |= 0x0; break;
+  switch (flags & (MSVCRT__PC_24 | MSVCRT__PC_53)) {
+  case MSVCRT__PC_64: fpword |= 0x300; break;
+  case MSVCRT__PC_53: fpword |= 0x200; break;
+  case MSVCRT__PC_24: fpword |= 0x0; break;
   }
-  if (flags & _IC_AFFINE) fpword |= 0x1000;
+  if (flags & MSVCRT__IC_AFFINE) fpword |= 0x1000;
 
   TRACE("Control word after  : %08x\n", fpword);
 
@@ -541,7 +537,7 @@
 unsigned int _controlfp(unsigned int newval, unsigned int mask)
 {
 #ifdef __i386__
-  return _control87( newval, mask & ~_EM_DENORMAL );
+  return _control87( newval, mask & ~MSVCRT__EM_DENORMAL );
 #else
   FIXME(":Not Implemented!\n");
   return 0;
@@ -598,7 +594,7 @@
   double retval;
   if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
   retval  = y0(num);
-  if (_fpclass(retval) == _FPCLASS_NINF)
+  if (_fpclass(retval) == MSVCRT__FPCLASS_NINF)
   {
     *MSVCRT__errno() = MSVCRT_EDOM;
     retval = sqrt(-1);
@@ -614,7 +610,7 @@
   double retval;
   if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
   retval  = y1(num);
-  if (_fpclass(retval) == _FPCLASS_NINF)
+  if (_fpclass(retval) == MSVCRT__FPCLASS_NINF)
   {
     *MSVCRT__errno() = MSVCRT_EDOM;
     retval = sqrt(-1);
@@ -630,7 +626,7 @@
   double retval;
   if (!finite(num)) *MSVCRT__errno() = MSVCRT_EDOM;
   retval  = yn(order,num);
-  if (_fpclass(retval) == _FPCLASS_NINF)
+  if (_fpclass(retval) == MSVCRT__FPCLASS_NINF)
   {
     *MSVCRT__errno() = MSVCRT_EDOM;
     retval = sqrt(-1);
@@ -654,7 +650,7 @@
  */
 char *_ecvt( double number, int ndigits, int *decpt, int *sign )
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
+    thread_data_t *data = msvcrt_get_thread_data();
     char *dec;
 
     if (!data->efcvt_buffer)
@@ -672,7 +668,7 @@
  */
 char *_fcvt( double number, int ndigits, int *decpt, int *sign )
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
+    thread_data_t *data = msvcrt_get_thread_data();
     char *dec;
 
     if (!data->efcvt_buffer)
Index: dlls/msvcrt/mbcs.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/mbcs.c,v
retrieving revision 1.27
diff -u -r1.27 mbcs.c
--- dlls/msvcrt/mbcs.c	17 Apr 2003 02:15:03 -0000	1.27
+++ dlls/msvcrt/mbcs.c	19 Jun 2004 06:41:55 -0000
@@ -24,13 +24,6 @@
  */
 
 #include "msvcrt.h"
-
-#include "msvcrt/mbctype.h"
-#include "msvcrt/mbstring.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-#include "msvcrt/wctype.h"
-
 #include "wine/unicode.h"
 #include "wine/debug.h"
 
@@ -53,7 +46,7 @@
     mbch[1] = ch & 0xff;
     n_chars = 2;
   }
-  if (!MultiByteToWideChar(MSVCRT_current_lc_all_cp, 0, mbch, n_chars, &chW, 1))
+  if (!MultiByteToWideChar(msvcrt_current_lc_all_cp, 0, mbch, n_chars, &chW, 1))
   {
     WARN("MultiByteToWideChar failed on %x\n", ch);
     return 0;
@@ -70,9 +63,9 @@
 }
 
 /*********************************************************************
- *		__p___mb_cur_max(MSVCRT.@)
+ *		MSVCRT___p___mb_cur_max(MSVCRT.@)
  */
-int* __p___mb_cur_max(void)
+int* MSVCRT___p___mb_cur_max(void)
 {
   return &MSVCRT___mb_cur_max;
 }
@@ -119,7 +112,7 @@
 unsigned char* _mbsdec(const unsigned char* start, const unsigned char* cur)
 {
   if(MSVCRT___mb_cur_max > 1)
-    return (char *)(_ismbstrail(start,cur-1) ? cur - 2 : cur -1);
+    return (char *)(MSVCRT__ismbstrail(start,cur-1) ? cur - 2 : cur -1);
 
   return (char *)cur - 1; /* ASCII CP or SB char */
 }
@@ -555,7 +548,7 @@
  */
 unsigned char* _mbstok(unsigned char *str, const unsigned char *delim)
 {
-    MSVCRT_thread_data *data = msvcrt_get_thread_data();
+    thread_data_t *data = msvcrt_get_thread_data();
     char *ret;
 
     if(MSVCRT___mb_cur_max > 1)
@@ -626,7 +619,7 @@
 int _ismbbkana(unsigned int c)
 {
   /* FIXME: use lc_ctype when supported, not lc_all */
-  if(MSVCRT_current_lc_all_cp == 932)
+  if(msvcrt_current_lc_all_cp == 932)
   {
     /* Japanese/Katakana, CP 932 */
     return (c >= 0xa1 && c <= 0xdf);
@@ -736,7 +729,7 @@
 int _ismbchira(unsigned int c)
 {
   /* FIXME: use lc_ctype when supported, not lc_all */
-  if(MSVCRT_current_lc_all_cp == 932)
+  if(msvcrt_current_lc_all_cp == 932)
   {
     /* Japanese/Hiragana, CP 932 */
     return (c >= 0x829f && c <= 0x82f1);
@@ -750,7 +743,7 @@
 int _ismbckata(unsigned int c)
 {
   /* FIXME: use lc_ctype when supported, not lc_all */
-  if(MSVCRT_current_lc_all_cp == 932)
+  if(msvcrt_current_lc_all_cp == 932)
   {
     if(c < 256)
       return _ismbbkana(c);
@@ -799,9 +792,9 @@
 }
 
 /*********************************************************************
- *		_ismbstrail(MSVCRT.@)
+ *		MSVCRT__ismbstrail(MSVCRT.@)
  */
-int _ismbstrail(const unsigned char* start, const unsigned char* str)
+int MSVCRT__ismbstrail(const unsigned char* start, const unsigned char* str)
 {
   /* Must not be a lead, and must be preceeded by one */
   return !_ismbslead(start, str) && MSVCRT_isleadbyte(str[-1]);
@@ -815,7 +808,7 @@
   unsigned char* ret = str;
 
   if(MSVCRT___mb_cur_max == 1 || c < 256)
-    return _strset(str, c); /* ASCII CP or SB char */
+    return MSVCRT__strset(str, c); /* ASCII CP or SB char */
 
   c &= 0xffff; /* Strip high bits */
 
@@ -841,7 +834,7 @@
 	return ret;
 
     if(MSVCRT___mb_cur_max == 1 || c < 256)
-	return _strnset(str, c, len); /* ASCII CP or SB char */
+	return MSVCRT__strnset(str, c, len); /* ASCII CP or SB char */
 
     c &= 0xffff; /* Strip high bits */
 
@@ -871,7 +864,7 @@
     return ret;
 
   if(MSVCRT___mb_cur_max == 1 || c < 256)
-    return _strnset(str, c, len); /* ASCII CP or SB char */
+    return MSVCRT__strnset(str, c, len); /* ASCII CP or SB char */
 
   c &= 0xffff; /* Strip high bits */
 
Index: dlls/msvcrt/misc.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/misc.c,v
retrieving revision 1.11
diff -u -r1.11 misc.c
--- dlls/msvcrt/misc.c	17 May 2004 21:08:31 -0000	1.11
+++ dlls/msvcrt/misc.c	19 Jun 2004 06:41:55 -0000
@@ -24,8 +24,6 @@
 #include <stdlib.h>
 
 #include "msvcrt.h"
-#include "msvcrt/stdlib.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
Index: dlls/msvcrt/msvcrt.h
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/msvcrt.h,v
retrieving revision 1.25
diff -u -r1.25 msvcrt.h
--- dlls/msvcrt/msvcrt.h	16 Mar 2004 19:17:11 -0000	1.25
+++ dlls/msvcrt/msvcrt.h	20 Jun 2004 19:52:45 -0000
@@ -1,5 +1,6 @@
 /*
  * Copyright 2001 Jon Griffiths
+ * Copyright 2004 Dimitrie O. Paun
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -14,6 +15,22 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * NOTES
+ *   Naming conventions
+ *	- Symbols are prefixed with MSVCRT_ IF AND ONLY IF
+ *        they are exposed in the public headers.
+ *      - Internal symbolx are usually prefixed by msvcrt_.
+ *      - Exported symbols that are not present in the public
+ *        headers are usually kept the same as the original.
+ *   Other conventions
+ *      - To avoid conflicts with the standard C library,
+ *        no msvcrt headers are included in the implementation.
+ *      - Instead, symbols are duplicated here, prefixed with 
+ *        MSVCRT_, as explained above.
+ *      - To avoid inconsistencies, a test for each symbol is
+ *        added into tests/headers.c. Please always add a
+ *        corresponding test when you add a new symbol!
  */
 
 #ifndef __WINE_MSVCRT_H
@@ -28,38 +45,58 @@
 #include "winerror.h"
 #include "winnls.h"
 
-#include "msvcrt/string.h"
-#include "msvcrt/eh.h"
+typedef unsigned short MSVCRT_wchar_t;
+typedef unsigned short MSVCRT_wint_t;
+typedef unsigned short MSVCRT_wctype_t;
+typedef unsigned short MSVCRT__ino_t;
+typedef unsigned long  MSVCRT__fsize_t;
+typedef unsigned int   MSVCRT_size_t;
+typedef unsigned int   MSVCRT__dev_t;
+typedef int  MSVCRT__off_t;
+typedef long MSVCRT_clock_t;
+typedef long MSVCRT_time_t;
+typedef long MSVCRT_fpos_t;
+
+typedef void (*MSVCRT_terminate_handler)();
+typedef void (*MSVCRT_terminate_function)();
+typedef void (*MSVCRT_unexpected_handler)();
+typedef void (*MSVCRT_unexpected_function)();
+typedef void (*MSVCRT__se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info);
+typedef void (*MSVCRT__beginthread_start_routine_t)(void *);
+typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *);
+typedef int (*MSVCRT__onexit_t)(void);
+
 
 /* TLS data */
-extern DWORD MSVCRT_tls_index;
+extern DWORD msvcrt_tls_index;
 
-typedef struct __MSVCRT_thread_data
-{
-    int                      thread_errno;
-    unsigned long            thread_doserrno;
-    char                    *mbstok_next;        /* next ptr for mbstok() */
-    char                    *efcvt_buffer;       /* buffer for ecvt/fcvt */
-    int                      fpecode;
-    terminate_function       terminate_handler;
-    unexpected_function      unexpected_handler;
-    _se_translator_function  se_translator;
-    EXCEPTION_RECORD        *exc_record;
-} MSVCRT_thread_data;
+struct __thread_data {
+    int                             thread_errno;
+    unsigned long                   thread_doserrno;
+    char                           *mbstok_next;        /* next ptr for mbstok() */
+    char                           *efcvt_buffer;       /* buffer for ecvt/fcvt */
+    int                             fpecode;
+    MSVCRT_terminate_function       terminate_handler;
+    MSVCRT_unexpected_function      unexpected_handler;
+    MSVCRT__se_translator_function  se_translator;
+    EXCEPTION_RECORD               *exc_record;
+};
 
-extern MSVCRT_thread_data *msvcrt_get_thread_data(void);
+typedef struct __thread_data thread_data_t;
 
-extern int MSVCRT_current_lc_all_cp;
+extern thread_data_t *msvcrt_get_thread_data(void);
 
-void _purecall(void);
-void   MSVCRT__set_errno(int);
+extern int msvcrt_current_lc_all_cp;
+
+void   msvcrt_set_errno(int);
 char*  msvcrt_strndup(const char*,unsigned int);
 MSVCRT_wchar_t *msvcrt_wstrndup(const MSVCRT_wchar_t*, unsigned int);
 
-void MSVCRT__amsg_exit(int errnum);
+void   _purecall(void);
+void   _amsg_exit(int errnum);
 
-extern char **MSVCRT__environ;
-extern MSVCRT_wchar_t **MSVCRT__wenviron;
+extern char **_environ;
+extern MSVCRT_wchar_t **_wenviron;
 
 extern char ** msvcrt_SnapshotOfEnvironmentA(char **);
 extern MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **);
@@ -67,16 +104,16 @@
 /* FIXME: This should be declared in new.h but it's not an extern "C" so
  * it would not be much use anyway. Even for Winelib applications.
  */
-int    MSVCRT__set_new_mode(int mode);
+int    _set_new_mode(int mode);
 
-void* MSVCRT_operator_new(unsigned long size);
-void MSVCRT_operator_delete(void*);
+void* _operator_new(unsigned long size);
+void  _operator_delete(void*);
 
-typedef void* (*MSVCRT_malloc_func)(MSVCRT_size_t);
-typedef void (*MSVCRT_free_func)(void*);
+typedef void* (*malloc_func_t)(MSVCRT_size_t);
+typedef void  (*free_func_t)(void*);
 
-extern char* MSVCRT___unDName(char *,const char*,int,MSVCRT_malloc_func,MSVCRT_free_func,unsigned short int);
-extern char* MSVCRT___unDNameEx(char *,const char*,int,MSVCRT_malloc_func,MSVCRT_free_func,void *,unsigned short int);
+extern char* __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int);
+extern char* __unDNameEx(char *,const char*,int,malloc_func_t,free_func_t,void *,unsigned short int);
 
 /* Setup and teardown multi threaded locks */
 extern void msvcrt_init_mt_locks(void);
@@ -123,4 +160,426 @@
 #define _RT_CRNL        252
 #define _RT_BANNER      255
 
+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;
+};
+
+struct MSVCRT__timeb {
+    MSVCRT_time_t  time;
+    unsigned short millitm;
+    short          timezone;
+    short          dstflag;
+};
+
+struct MSVCRT__iobuf {
+  char* _ptr;
+  int   _cnt;
+  char* _base;
+  int   _flag;
+  int   _file;
+  int   _charbuf;
+  int   _bufsiz;
+  char* _tmpfname;
+};
+
+typedef struct MSVCRT__iobuf MSVCRT_FILE;
+
+struct MSVCRT_lconv {
+    char* decimal_point;
+    char* thousands_sep;
+    char* grouping;
+    char* int_curr_symbol;
+    char* currency_symbol;
+    char* mon_decimal_point;
+    char* mon_thousands_sep;
+    char* mon_grouping;
+    char* positive_sign;
+    char* negative_sign;
+    char int_frac_digits;
+    char frac_digits;
+    char p_cs_precedes;
+    char p_sep_by_space;
+    char n_cs_precedes;
+    char n_sep_by_space;
+    char p_sign_posn;
+    char n_sign_posn;
+};
+
+struct MSVCRT__exception {
+  int     type;
+  char*   name;
+  double  arg1;
+  double  arg2;
+  double  retval;
+};
+
+struct MSVCRT__complex {
+  double x;      /* Real part */
+  double y;      /* Imaginary part */
+};
+
+struct MSVCRT__heapinfo {
+  int*           _pentry;
+  MSVCRT_size_t  _size;
+  int            _useflag;
+};
+
+#ifdef __i386__
+struct MSVCRT___JUMP_BUFFER {
+    unsigned long Ebp;
+    unsigned long Ebx;
+    unsigned long Edi;
+    unsigned long Esi;
+    unsigned long Esp;
+    unsigned long Eip;
+    unsigned long Registration;
+    unsigned long TryLevel;
+    /* Start of new struct members */
+    unsigned long Cookie;
+    unsigned long UnwindFunc;
+    unsigned long UnwindData[6];
+};
+#endif /* __i386__ */
+
+struct MSVCRT__diskfree_t {
+  unsigned int total_clusters;
+  unsigned int avail_clusters;
+  unsigned int sectors_per_cluster;
+  unsigned int bytes_per_sector;
+};
+
+struct MSVCRT__finddata_t {
+  unsigned attrib;
+  MSVCRT_time_t   time_create;
+  MSVCRT_time_t   time_access;
+  MSVCRT_time_t   time_write;
+  MSVCRT__fsize_t size;
+  char            name[260];
+};
+
+struct MSVCRT__finddatai64_t {
+  unsigned attrib;
+  MSVCRT_time_t  time_create;
+  MSVCRT_time_t  time_access;
+  MSVCRT_time_t  time_write;
+  __int64        size;
+  char           name[260];
+};
+
+struct MSVCRT__wfinddata_t {
+  unsigned attrib;
+  MSVCRT_time_t   time_create;
+  MSVCRT_time_t   time_access;
+  MSVCRT_time_t   time_write;
+  MSVCRT__fsize_t size;
+  MSVCRT_wchar_t  name[260];
+};
+
+struct MSVCRT__wfinddatai64_t {
+  unsigned attrib;
+  MSVCRT_time_t   time_create;
+  MSVCRT_time_t   time_access;
+  MSVCRT_time_t   time_write;
+  __int64         size;
+  MSVCRT_wchar_t  name[260];
+};
+
+struct MSVCRT__utimbuf
+{
+    MSVCRT_time_t actime;
+    MSVCRT_time_t modtime;
+};
+
+/* for FreeBSD */
+#undef st_atime
+#undef st_ctime
+#undef st_mtime
+
+struct MSVCRT__stat {
+  MSVCRT__dev_t  st_dev;
+  MSVCRT__ino_t  st_ino;
+  unsigned short st_mode;
+  short          st_nlink;
+  short          st_uid;
+  short          st_gid;
+  MSVCRT__dev_t  st_rdev;
+  MSVCRT__off_t  st_size;
+  MSVCRT_time_t  st_atime;
+  MSVCRT_time_t  st_mtime;
+  MSVCRT_time_t  st_ctime;
+};
+
+struct MSVCRT_stat {
+  MSVCRT__dev_t  st_dev;
+  MSVCRT__ino_t  st_ino;
+  unsigned short st_mode;
+  short          st_nlink;
+  short          st_uid;
+  short          st_gid;
+  MSVCRT__dev_t  st_rdev;
+  MSVCRT__off_t  st_size;
+  MSVCRT_time_t  st_atime;
+  MSVCRT_time_t  st_mtime;
+  MSVCRT_time_t  st_ctime;
+};
+
+struct MSVCRT__stati64 {
+  MSVCRT__dev_t  st_dev;
+  MSVCRT__ino_t  st_ino;
+  unsigned short st_mode;
+  short          st_nlink;
+  short          st_uid;
+  short          st_gid;
+  MSVCRT__dev_t  st_rdev;
+  __int64        st_size;
+  MSVCRT_time_t  st_atime;
+  MSVCRT_time_t  st_mtime;
+  MSVCRT_time_t  st_ctime;
+};
+
+#define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
+#define MSVCRT_EOF       (-1)
+#define MSVCRT_TMP_MAX   0x7fff
+#define MSVCRT_BUFSIZ    512
+
+#define MSVCRT_STDIN_FILENO  0
+#define MSVCRT_STDOUT_FILENO 1
+#define MSVCRT_STDERR_FILENO 2
+
+/* 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_stdin       (MSVCRT__iob+MSVCRT_STDIN_FILENO)
+#define MSVCRT_stdout      (MSVCRT__iob+MSVCRT_STDOUT_FILENO)
+#define MSVCRT_stderr      (MSVCRT__iob+MSVCRT_STDERR_FILENO)
+
+#define MSVCRT__P_WAIT    0
+#define MSVCRT__P_NOWAIT  1
+#define MSVCRT__P_OVERLAY 2
+#define MSVCRT__P_NOWAITO 3
+#define MSVCRT__P_DETACH  4
+
+#define MSVCRT_EPERM   1
+#define MSVCRT_ENOENT  2
+#define MSVCRT_ESRCH   3
+#define MSVCRT_EINTR   4
+#define MSVCRT_EIO     5
+#define MSVCRT_ENXIO   6
+#define MSVCRT_E2BIG   7
+#define MSVCRT_ENOEXEC 8
+#define MSVCRT_EBADF   9
+#define MSVCRT_ECHILD  10
+#define MSVCRT_EAGAIN  11
+#define MSVCRT_ENOMEM  12
+#define MSVCRT_EACCES  13
+#define MSVCRT_EFAULT  14
+#define MSVCRT_EBUSY   16
+#define MSVCRT_EEXIST  17
+#define MSVCRT_EXDEV   18
+#define MSVCRT_ENODEV  19
+#define MSVCRT_ENOTDIR 20
+#define MSVCRT_EISDIR  21
+#define MSVCRT_EINVAL  22
+#define MSVCRT_ENFILE  23
+#define MSVCRT_EMFILE  24
+#define MSVCRT_ENOTTY  25
+#define MSVCRT_EFBIG   27
+#define MSVCRT_ENOSPC  28
+#define MSVCRT_ESPIPE  29
+#define MSVCRT_EROFS   30
+#define MSVCRT_EMLINK  31
+#define MSVCRT_EPIPE   32
+#define MSVCRT_EDOM    33
+#define MSVCRT_ERANGE  34
+#define MSVCRT_EDEADLK 36
+#define MSVCRT_EDEADLOCK MSVCRT_EDEADLK
+#define MSVCRT_ENAMETOOLONG 38
+#define MSVCRT_ENOLCK  39
+#define MSVCRT_ENOSYS  40
+#define MSVCRT_ENOTEMPTY 41
+
+#define MSVCRT_LC_ALL          0
+#define MSVCRT_LC_COLLATE      1
+#define MSVCRT_LC_CTYPE        2
+#define MSVCRT_LC_MONETARY     3
+#define MSVCRT_LC_NUMERIC      4
+#define MSVCRT_LC_TIME         5
+#define MSVCRT_LC_MIN          MSVCRT_LC_ALL
+#define MSVCRT_LC_MAX          MSVCRT_LC_TIME
+
+#define MSVCRT__HEAPEMPTY      -1
+#define MSVCRT__HEAPOK         -2
+#define MSVCRT__HEAPBADBEGIN   -3
+#define MSVCRT__HEAPBADNODE    -4
+#define MSVCRT__HEAPEND        -5
+#define MSVCRT__HEAPBADPTR     -6
+
+#define MSVCRT__FREEENTRY      0
+#define MSVCRT__USEDENTRY      1
+
+#define MSVCRT__OUT_TO_DEFAULT 0
+#define MSVCRT__REPORT_ERRMODE 3
+
+/* ASCII char classification table - binary compatible */
+#define MSVCRT__UPPER    0x0001  /* C1_UPPER */
+#define MSVCRT__LOWER    0x0002  /* C1_LOWER */
+#define MSVCRT__DIGIT    0x0004  /* C1_DIGIT */
+#define MSVCRT__SPACE    0x0008  /* C1_SPACE */
+#define MSVCRT__PUNCT    0x0010  /* C1_PUNCT */
+#define MSVCRT__CONTROL  0x0020  /* C1_CNTRL */
+#define MSVCRT__BLANK    0x0040  /* C1_BLANK */
+#define MSVCRT__HEX      0x0080  /* C1_XDIGIT */
+#define MSVCRT__LEADBYTE 0x8000
+#define MSVCRT__ALPHA   (0x0100|MSVCRT__UPPER|MSVCRT__LOWER)  /* (C1_ALPHA|_UPPER|_LOWER) */
+
+#define MSVCRT__IOREAD   0x0001
+#define MSVCRT__IOWRT    0x0002
+#define MSVCRT__IOMYBUF  0x0008
+#define MSVCRT__IOEOF    0x0010
+#define MSVCRT__IOERR    0x0020
+#define MSVCRT__IOSTRG   0x0040
+#define MSVCRT__IORW     0x0080
+
+#define MSVCRT__S_IEXEC  0x0040
+#define MSVCRT__S_IWRITE 0x0080
+#define MSVCRT__S_IREAD  0x0100
+#define MSVCRT__S_IFIFO  0x1000
+#define MSVCRT__S_IFCHR  0x2000
+#define MSVCRT__S_IFDIR  0x4000
+#define MSVCRT__S_IFREG  0x8000
+#define MSVCRT__S_IFMT   0xF000
+
+#define MSVCRT__LK_UNLCK  0
+#define MSVCRT__LK_LOCK   1
+#define MSVCRT__LK_NBLCK  2
+#define MSVCRT__LK_RLCK   3
+#define MSVCRT__LK_NBRLCK 4
+
+#define	MSVCRT__SH_COMPAT	0x00	/* Compatibility */
+#define	MSVCRT__SH_DENYRW	0x10	/* Deny read/write */
+#define	MSVCRT__SH_DENYWR	0x20	/* Deny write */
+#define	MSVCRT__SH_DENYRD	0x30	/* Deny read */
+#define	MSVCRT__SH_DENYNO	0x40	/* Deny nothing */
+
+#define MSVCRT__O_RDONLY        0
+#define MSVCRT__O_WRONLY        1
+#define MSVCRT__O_RDWR          2
+#define MSVCRT__O_ACCMODE       (MSVCRT__O_RDONLY|MSVCRT__O_WRONLY|MSVCRT__O_RDWR)
+#define MSVCRT__O_APPEND        0x0008
+#define MSVCRT__O_RANDOM        0x0010
+#define MSVCRT__O_SEQUENTIAL    0x0020
+#define MSVCRT__O_TEMPORARY     0x0040
+#define MSVCRT__O_NOINHERIT     0x0080
+#define MSVCRT__O_CREAT         0x0100
+#define MSVCRT__O_TRUNC         0x0200
+#define MSVCRT__O_EXCL          0x0400
+#define MSVCRT__O_SHORT_LIVED   0x1000
+#define MSVCRT__O_TEXT          0x4000
+#define MSVCRT__O_BINARY        0x8000
+#define MSVCRT__O_RAW           MSVCRT__O_BINARY
+
+/* _statusfp bit flags */
+#define MSVCRT__SW_INEXACT      0x00000001 /* inexact (precision) */
+#define MSVCRT__SW_UNDERFLOW    0x00000002 /* underflow */
+#define MSVCRT__SW_OVERFLOW     0x00000004 /* overflow */
+#define MSVCRT__SW_ZERODIVIDE   0x00000008 /* zero divide */
+#define MSVCRT__SW_INVALID      0x00000010 /* invalid */
+
+#define MSVCRT__SW_UNEMULATED     0x00000040  /* unemulated instruction */
+#define MSVCRT__SW_SQRTNEG        0x00000080  /* square root of a neg number */
+#define MSVCRT__SW_STACKOVERFLOW  0x00000200  /* FP stack overflow */
+#define MSVCRT__SW_STACKUNDERFLOW 0x00000400  /* FP stack underflow */
+
+#define MSVCRT__SW_DENORMAL     0x00080000 /* denormal status bit */
+
+/* fpclass constants */
+#define MSVCRT__FPCLASS_SNAN 0x0001  /* Signaling "Not a Number" */
+#define MSVCRT__FPCLASS_QNAN 0x0002  /* Quiet "Not a Number" */
+#define MSVCRT__FPCLASS_NINF 0x0004  /* Negative Infinity */
+#define MSVCRT__FPCLASS_NN   0x0008  /* Negative Normal */
+#define MSVCRT__FPCLASS_ND   0x0010  /* Negative Denormal */
+#define MSVCRT__FPCLASS_NZ   0x0020  /* Negative Zero */
+#define MSVCRT__FPCLASS_PZ   0x0040  /* Positive Zero */
+#define MSVCRT__FPCLASS_PD   0x0080  /* Positive Denormal */
+#define MSVCRT__FPCLASS_PN   0x0100  /* Positive Normal */
+#define MSVCRT__FPCLASS_PINF 0x0200  /* Positive Infinity */
+
+#define MSVCRT__EM_INVALID    0x00000010
+#define MSVCRT__EM_DENORMAL   0x00080000
+#define MSVCRT__EM_ZERODIVIDE 0x00000008
+#define MSVCRT__EM_OVERFLOW   0x00000004
+#define MSVCRT__EM_UNDERFLOW  0x00000002
+#define MSVCRT__EM_INEXACT    0x00000001
+#define MSVCRT__IC_AFFINE     0x00040000
+#define MSVCRT__IC_PROJECTIVE 0x00000000
+#define MSVCRT__RC_CHOP       0x00000300
+#define MSVCRT__RC_UP         0x00000200
+#define MSVCRT__RC_DOWN       0x00000100
+#define MSVCRT__RC_NEAR       0x00000000
+#define MSVCRT__PC_24         0x00020000
+#define MSVCRT__PC_53         0x00010000
+#define MSVCRT__PC_64         0x00000000
+
+void           MSVCRT_free(void*);
+void*          MSVCRT_malloc(MSVCRT_size_t);
+void*          MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t);
+void*          MSVCRT_realloc(void*,MSVCRT_size_t);
+
+int            MSVCRT_iswalpha(MSVCRT_wint_t);
+int            MSVCRT_iswspace(MSVCRT_wint_t);
+int            MSVCRT_iswdigit(MSVCRT_wint_t);
+int            MSVCRT_isleadbyte(int);
+
+int            MSVCRT__write(int,const void*,unsigned int);
+int            MSVCRT_fgetc(MSVCRT_FILE*);
+int            MSVCRT_ungetc(int,MSVCRT_FILE*);
+MSVCRT_wint_t  MSVCRT_fgetwc(MSVCRT_FILE*);
+MSVCRT_wint_t  MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*);
+int            MSVCRT__getch(void);
+void           MSVCRT__exit(int);
+void           MSVCRT_abort();
+unsigned long* MSVCRT___doserrno(void);
+int*           MSVCRT__errno(void);
+char*          MSVCRT_getenv(const char*);
+char*          MSVCRT_setlocale(int,const char*);
+int            MSVCRT_fclose(MSVCRT_FILE*);
+void           MSVCRT_terminate();
+int            MSVCRT__futime(int,struct MSVCRT__utimbuf*);
+MSVCRT_FILE*   MSVCRT__p__iob(void);
+MSVCRT_time_t  MSVCRT_time(MSVCRT_time_t*);
+int            MSVCRT__vsnwprintf(MSVCRT_wchar_t*,MSVCRT_size_t,const MSVCRT_wchar_t*,va_list);
+int            MSVCRT__ismbstrail(const unsigned char* start, const unsigned char* str);
+int            MSVCRT__spawnve(int,const char*,const char* const *,const char* const *);
+void           MSVCRT__searchenv(const char*,const char*,char*);
+int            MSVCRT__getdrive(void);
+char*          MSVCRT__strdup(const char*);
+char*          MSVCRT__strnset(char*,int,MSVCRT_size_t);
+char*          MSVCRT__strset(char*,int);
+int            MSVCRT__ungetch(int);
+int            MSVCRT__cputs(const char*);
+int            MSVCRT__cprintf(const char*,...);
+char***        MSVCRT___p__environ(void);
+int*           MSVCRT___p___mb_cur_max(void);
+unsigned int*  MSVCRT___p__fmode(void);
+MSVCRT_wchar_t*   MSVCRT__wcsdup(const MSVCRT_wchar_t*);
+MSVCRT_wchar_t*** MSVCRT___p__wenviron(void);
+
+/*  FIXME: Functions that we forward to. They shouldn't be defined
+ *  here, but for now they're not declared in the standard headers. 
+ */
+void           _splitpath(const char*,char*,char*,char*,char*);
+char*          _strlwr(char*);
+char*          _strupr(char*);
+
 #endif /* __WINE_MSVCRT_H */
Index: dlls/msvcrt/msvcrt.spec
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/msvcrt.spec,v
retrieving revision 1.91
diff -u -r1.91 msvcrt.spec
--- dlls/msvcrt/msvcrt.spec	2 Jun 2004 00:35:09 -0000	1.91
+++ dlls/msvcrt/msvcrt.spec	19 Jun 2004 06:45:17 -0000
@@ -15,10 +15,10 @@
 @ cdecl -i386 -norelay ??1bad_typeid@@UAE at XZ() __thiscall_MSVCRT_bad_typeid_dtor
 @ cdecl -i386 -norelay ??1exception@@UAE at XZ() __thiscall_MSVCRT_exception_dtor
 @ cdecl -i386 -norelay ??1type_info@@UAE at XZ() __thiscall_MSVCRT_type_info_dtor
-@ cdecl ??2 at YAPAXI@Z(long) MSVCRT_operator_new
-@ cdecl ??_U at YAPAXI@Z(long) MSVCRT_operator_new
-@ cdecl ??3 at YAXPAX@Z(ptr) MSVCRT_operator_delete
-@ cdecl ??_V at YAXPAX@Z(ptr) MSVCRT_operator_delete
+@ cdecl ??2 at YAPAXI@Z(long) _operator_new
+@ cdecl ??_U at YAPAXI@Z(long) _operator_new
+@ cdecl ??3 at YAXPAX@Z(ptr) _operator_delete
+@ cdecl ??_V at YAXPAX@Z(ptr) _operator_delete
 @ cdecl -i386 -norelay ??4__non_rtti_object@@QAEAAV0 at ABV0@@Z(ptr) __thiscall_MSVCRT___non_rtti_object_opequals
 @ cdecl -i386 -norelay ??4bad_cast@@QAEAAV0 at ABV0@@Z(ptr) __thiscall_MSVCRT_bad_cast_opequals
 @ cdecl -i386 -norelay ??4bad_typeid@@QAEAAV0 at ABV0@@Z(ptr) __thiscall_MSVCRT_bad_typeid_opequals
@@ -40,7 +40,7 @@
 @ cdecl ?_query_new_handler@@YAP6AHI at ZXZ() MSVCRT__query_new_handler
 @ cdecl ?_query_new_mode@@YAHXZ() MSVCRT__query_new_mode
 @ cdecl ?_set_new_handler@@YAP6AHI at ZP6AHI@Z at Z(ptr) MSVCRT__set_new_handler
-@ cdecl ?_set_new_mode@@YAHH at Z(long) MSVCRT__set_new_mode
+@ cdecl ?_set_new_mode@@YAHH at Z(long) _set_new_mode
 @ cdecl ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0 at Z@Z(ptr) MSVCRT__set_se_translator
 @ cdecl -i386 -norelay ?before at type_info@@QBEHABV1@@Z(ptr) __thiscall_MSVCRT_type_info_before
 @ cdecl -i386 -norelay ?name at type_info@@QBEPBDXZ() __thiscall_MSVCRT_type_info_name
@@ -103,7 +103,7 @@
 @ cdecl __p___argc()
 @ cdecl __p___argv()
 @ cdecl __p___initenv()
-@ cdecl __p___mb_cur_max()
+@ cdecl MSVCRT___p___mb_cur_max()
 @ cdecl __p___wargv()
 @ cdecl __p___winitenv()
 @ cdecl __p__acmdln()
@@ -111,9 +111,9 @@
 @ cdecl __p__commode()
 @ cdecl __p__daylight() MSVCRT___p__daylight
 @ stub __p__dstbias #()
-@ cdecl __p__environ()
+@ cdecl MSVCRT___p__environ()
 @ stub __p__fileinfo #()
-@ cdecl __p__fmode()
+@ cdecl MSVCRT___p__fmode()
 @ cdecl __p__iob()
 @ stub __p__mbcasemap #()
 @ cdecl __p__mbctype()
@@ -124,7 +124,7 @@
 @ cdecl __p__timezone()
 @ stub __p__tzname #()
 @ cdecl __p__wcmdln()
-@ cdecl __p__wenviron()
+@ cdecl MSVCRT___p__wenviron()
 @ cdecl __p__winmajor()
 @ cdecl __p__winminor()
 @ cdecl __p__winver()
@@ -137,8 +137,8 @@
 @ cdecl __threadhandle() kernel32.GetCurrentThread
 @ cdecl __threadid() kernel32.GetCurrentThreadId
 @ cdecl __toascii(long) MSVCRT___toascii
-@ cdecl __unDName(ptr str long ptr ptr long) MSVCRT___unDName
-@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) MSVCRT___unDNameEx
+@ cdecl __unDName(ptr str long ptr ptr long)
+@ cdecl __unDNameEx(ptr str long ptr ptr ptr long)
 @ extern __unguarded_readlc_active MSVCRT___unguarded_readlc_active
 @ extern __wargv MSVCRT___wargv
 @ cdecl __wgetmainargs(ptr ptr ptr long ptr)
@@ -161,7 +161,7 @@
 @ cdecl _adj_fptan()
 @ cdecl _adjust_fdiv()
 @ extern _aexit_rtn
-@ cdecl _amsg_exit(long) MSVCRT__amsg_exit
+@ cdecl _amsg_exit(long)
 @ cdecl _assert(str str long) MSVCRT__assert
 @ stub _atodbl #(ptr str)
 @ cdecl -ret64 _atoi64(str) ntdll._atoi64
@@ -187,8 +187,8 @@
 @ cdecl _control87(long long)
 @ cdecl _controlfp(long long)
 @ cdecl _copysign( double double )
-@ varargs _cprintf(str)
-@ cdecl _cputs(str)
+@ varargs MSVCRT__cprintf(str)
+@ cdecl MSVCRT__cputs(str)
 @ cdecl _creat(str long)
 @ varargs _cscanf(str)
 @ extern _ctype MSVCRT__ctype
@@ -200,7 +200,7 @@
 @ cdecl _ecvt(double long ptr ptr)
 @ cdecl _endthread ()
 @ cdecl _endthreadex(long)
-@ extern _environ MSVCRT__environ
+@ extern _environ
 @ cdecl _eof(long)
 @ cdecl _errno() MSVCRT__errno
 @ cdecl _except_handler2(ptr ptr ptr ptr)
@@ -245,18 +245,18 @@
 @ cdecl _ftime(ptr)
 @ cdecl -ret64 _ftol() ntdll._ftol
 @ cdecl _fullpath(ptr str long)
-@ cdecl _futime(long ptr)
+@ cdecl _futime(long ptr) MSVCRT__futime
 @ cdecl _gcvt(double long str)
 @ cdecl _get_osfhandle(long)
 @ stub _get_sbh_threshold #()
-@ cdecl _getch()
+@ cdecl _getch() MSVCRT__getch
 @ cdecl _getche()
 @ cdecl _getcwd(str long)
 @ cdecl _getdcwd(long str long)
 @ cdecl _getdiskfree(long ptr) MSVCRT__getdiskfree
 @ cdecl _getdllprocaddr(long str long)
-@ cdecl _getdrive()
-@ cdecl _getdrives() kernel32.GetLogicalDrives
+@ cdecl MSVCRT__getdrive()
+@ cdecl MSVCRT__getdrives() kernel32.GetLogicalDrives
 @ stub _getmaxstdio #()
 @ cdecl _getmbcp()
 @ cdecl _getpid() kernel32.GetCurrentProcessId
@@ -308,7 +308,7 @@
 @ cdecl _ismbcsymbol(long)
 @ cdecl _ismbcupper(long)
 @ cdecl _ismbslead(ptr ptr)
-@ cdecl _ismbstrail(ptr ptr)
+@ cdecl MSVCRT__ismbstrail(ptr ptr)
 @ cdecl _isnan( double )
 @ cdecl _itoa(long ptr long) ntdll._itoa
 @ cdecl _itow(long ptr long) ntdll._itow
@@ -353,7 +353,7 @@
 @ cdecl _mbscpy(ptr str) strcpy
 @ cdecl _mbscspn (str str)
 @ cdecl _mbsdec(ptr ptr)
-@ cdecl _mbsdup(str) _strdup
+@ cdecl _mbsdup(str) MSVCRT__strdup
 @ cdecl _mbsicmp(str str)
 @ cdecl _mbsicoll(str str)
 @ cdecl _mbsinc(str)
@@ -421,7 +421,7 @@
 @ cdecl _safe_fprem()
 @ cdecl _safe_fprem1()
 @ cdecl _scalb( double long)
-@ cdecl _searchenv(str str ptr)
+@ cdecl MSVCRT__searchenv(str str ptr)
 @ stdcall -i386 _seh_longjmp_unwind(ptr)
 @ cdecl _set_error_mode(long)
 @ stub _set_sbh_threshold #(long)
@@ -441,7 +441,7 @@
 @ varargs _spawnlp(long str str)
 @ varargs _spawnlpe(long str str)
 @ cdecl _spawnv(long str ptr)
-@ cdecl _spawnve(long str ptr ptr)
+@ cdecl MSVCRT__spawnve(long str ptr ptr)
 @ cdecl _spawnvp(long str ptr)
 @ cdecl _spawnvpe(long str ptr ptr)
 @ cdecl _splitpath(str ptr ptr ptr ptr) ntdll._splitpath
@@ -450,7 +450,7 @@
 @ cdecl _statusfp()
 @ cdecl _strcmpi(str str) strcasecmp
 @ cdecl _strdate(ptr)
-@ cdecl _strdup(str)
+@ cdecl MSVCRT__strdup(str)
 @ cdecl _strerror(long)
 @ cdecl _stricmp(str str) strcasecmp
 @ stub _stricoll #(str str)
@@ -458,9 +458,9 @@
 @ stub _strncoll #(str str long)
 @ cdecl _strnicmp(str str long) strncasecmp
 @ stub _strnicoll #(str str long)
-@ cdecl _strnset(str long long)
+@ cdecl MSVCRT__strnset(str long long)
 @ cdecl _strrev(str)
-@ cdecl _strset(str long)
+@ cdecl MSVCRT__strset(str long)
 @ cdecl _strtime(ptr)
 @ cdecl _strupr(str) ntdll._strupr
 @ cdecl _swab(str str long) MSVCRT__swab
@@ -479,20 +479,20 @@
 @ cdecl _ultoa(long ptr long) ntdll._ultoa
 @ cdecl _ultow(long ptr long) ntdll._ultow
 @ cdecl _umask(long)
-@ cdecl _ungetch(long)
+@ cdecl MSVCRT__ungetch(long)
 @ cdecl _unlink(str)
 @ cdecl _unloaddll(long)
 @ cdecl _unlock(long)
 @ cdecl _utime(str ptr)
 @ cdecl _vsnprintf(ptr long ptr ptr) vsnprintf
-@ cdecl _vsnwprintf(ptr long wstr long)
+@ cdecl MSVCRT__vsnwprintf(ptr long wstr long)
 @ cdecl _waccess(wstr long)
 @ stub _wasctime #(ptr) MSVCRT__wasctime
 @ cdecl _wchdir(wstr)
 @ cdecl _wchmod(wstr long)
 @ extern _wcmdln MSVCRT__wcmdln
 @ cdecl _wcreat(wstr long)
-@ cdecl _wcsdup(wstr)
+@ cdecl MSVCRT__wcsdup(wstr)
 @ cdecl _wcsicmp(wstr wstr) ntdll._wcsicmp
 @ cdecl _wcsicoll(wstr wstr)
 @ cdecl _wcslwr(wstr) ntdll._wcslwr
@@ -504,7 +504,7 @@
 @ cdecl _wcsset(wstr long)
 @ cdecl _wcsupr(wstr) ntdll._wcsupr
 @ stub _wctime #(ptr)
-@ extern _wenviron MSVCRT__wenviron
+@ extern _wenviron
 @ stub _wexecl #(wstr wstr) varargs
 @ stub _wexecle #(wstr wstr) varargs
 @ stub _wexeclp #(wstr wstr) varargs
@@ -538,7 +538,7 @@
 @ cdecl _wputenv(wstr)
 @ cdecl _wremove(wstr)
 @ cdecl _wrename(wstr wstr)
-@ cdecl _write(long ptr long)
+@ cdecl _write(long ptr long) MSVCRT__write
 @ cdecl _wrmdir(wstr)
 @ stub _wsearchenv #(wstr wstr ptr)
 @ stub _wsetlocale #(long wstr)
Index: dlls/msvcrt/process.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/process.c,v
retrieving revision 1.23
diff -u -r1.23 process.c
--- dlls/msvcrt/process.c	9 Apr 2004 19:03:13 -0000	1.23
+++ dlls/msvcrt/process.c	19 Jun 2004 06:41:56 -0000
@@ -30,13 +30,6 @@
 #include <stdarg.h>
 
 #include "msvcrt.h"
-#include "msvcrt/errno.h"
-
-#include "msvcrt/stdio.h"
-#include "msvcrt/process.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -50,7 +43,7 @@
   if (sizeof(HANDLE) != sizeof(int))
     WARN("This call is unsuitable for your architecture\n");
 
-  if ((unsigned)flags > _P_DETACH)
+  if ((unsigned)flags > MSVCRT__P_DETACH)
   {
     *MSVCRT__errno() = MSVCRT_EINVAL;
     return -1;
@@ -62,30 +55,30 @@
   si.cb = sizeof(si);
 
   if (!CreateProcessA(exe, cmdline, NULL, NULL, TRUE,
-                     flags == _P_DETACH ? DETACHED_PROCESS : 0,
+                     flags == MSVCRT__P_DETACH ? DETACHED_PROCESS : 0,
                      env, NULL, &si, &pi))
   {
-    MSVCRT__set_errno(GetLastError());
+    msvcrt_set_errno(GetLastError());
     return -1;
   }
 
   switch(flags)
   {
-  case _P_WAIT:
+  case MSVCRT__P_WAIT:
     WaitForSingleObject(pi.hProcess, INFINITE);
     GetExitCodeProcess(pi.hProcess,&pi.dwProcessId);
     CloseHandle(pi.hProcess);
     CloseHandle(pi.hThread);
     return (int)pi.dwProcessId;
-  case _P_DETACH:
+  case MSVCRT__P_DETACH:
     CloseHandle(pi.hProcess);
     pi.hProcess = 0;
     /* fall through */
-  case _P_NOWAIT:
-  case _P_NOWAITO:
+  case MSVCRT__P_NOWAIT:
+  case MSVCRT__P_NOWAITO:
     CloseHandle(pi.hThread);
     return (int)pi.hProcess;
-  case  _P_OVERLAY:
+  case  MSVCRT__P_OVERLAY:
     MSVCRT__exit(0);
   }
   return -1; /* can't reach here */
@@ -218,7 +211,7 @@
     *MSVCRT___doserrno() = doserrno;
   }
   else
-    MSVCRT__set_errno(doserrno);
+    msvcrt_set_errno(doserrno);
 
   return status ? *status = -1 : -1;
 }
@@ -239,7 +232,7 @@
   args = msvcrt_valisttos(arg0, ap, ' ');
   va_end(ap);
 
-  ret = msvcrt_spawn(_P_OVERLAY, name, args, NULL);
+  ret = msvcrt_spawn(MSVCRT__P_OVERLAY, name, args, NULL);
   MSVCRT_free(args);
 
   return ret;
@@ -267,13 +260,13 @@
   int ret;
   char fullname[MAX_PATH];
 
-  _searchenv(name, "PATH", fullname);
+  MSVCRT__searchenv(name, "PATH", fullname);
 
   va_start(ap, arg0);
   args = msvcrt_valisttos(arg0, ap, ' ');
   va_end(ap);
 
-  ret = msvcrt_spawn(_P_OVERLAY, fullname[0] ? fullname : name, args, NULL);
+  ret = msvcrt_spawn(MSVCRT__P_OVERLAY, fullname[0] ? fullname : name, args, NULL);
   MSVCRT_free(args);
 
   return ret;
@@ -296,7 +289,7 @@
  */
 int _execv(const char* name, char* const* argv)
 {
-  return _spawnve(_P_OVERLAY, name, (const char* const*) argv, NULL);
+  return MSVCRT__spawnve(MSVCRT__P_OVERLAY, name, (const char* const*) argv, NULL);
 }
 
 /*********************************************************************
@@ -307,7 +300,7 @@
  */
 int _execve(const char* name, char* const* argv, const char* const* envv)
 {
-  return _spawnve(_P_OVERLAY, name, (const char* const*) argv, envv);
+  return MSVCRT__spawnve(MSVCRT__P_OVERLAY, name, (const char* const*) argv, envv);
 }
 
 /*********************************************************************
@@ -320,8 +313,8 @@
 {
   char fullname[MAX_PATH];
 
-  _searchenv(name, "PATH", fullname);
-  return _spawnve(_P_OVERLAY, fullname[0] ? fullname : name,
+  MSVCRT__searchenv(name, "PATH", fullname);
+  return MSVCRT__spawnve(MSVCRT__P_OVERLAY, fullname[0] ? fullname : name,
                   (const char* const*) argv, envv);
 }
 
@@ -381,7 +374,7 @@
   int ret;
   char fullname[MAX_PATH];
 
-  _searchenv(name, "PATH", fullname);
+  MSVCRT__searchenv(name, "PATH", fullname);
 
   va_start(ap, arg0);
   args = msvcrt_valisttos(arg0, ap, ' ');
@@ -403,12 +396,12 @@
 }
 
 /*********************************************************************
- *		_spawnve (MSVCRT.@)
+ *		MSVCRT__spawnve (MSVCRT.@)
  *
  * Like on Windows, this function does not handle arguments with spaces
  * or double-quotes.
  */
-int _spawnve(int flags, const char* name, const char* const* argv,
+int MSVCRT__spawnve(int flags, const char* name, const char* const* argv,
                             const char* const* envv)
 {
   char * args = msvcrt_argvtos(argv,' ');
@@ -438,7 +431,7 @@
  */
 int _spawnv(int flags, const char* name, const char* const* argv)
 {
-  return _spawnve(flags, name, argv, NULL);
+  return MSVCRT__spawnve(flags, name, argv, NULL);
 }
 
 /*********************************************************************
@@ -451,8 +444,8 @@
                             const char* const* envv)
 {
   char fullname[MAX_PATH];
-  _searchenv(name, "PATH", fullname);
-  return _spawnve(flags, fullname[0] ? fullname : name, argv, envv);
+  MSVCRT__searchenv(name, "PATH", fullname);
+  return MSVCRT__spawnve(flags, fullname[0] ? fullname : name, argv, envv);
 }
 
 /*********************************************************************
@@ -502,9 +495,9 @@
     int res;
 
     /* Make a writable copy for CreateProcess */
-    cmdcopy=_strdup(cmd);
+    cmdcopy=MSVCRT__strdup(cmd);
     /* FIXME: should probably launch cmd interpreter in COMSPEC */
-    res=msvcrt_spawn(_P_WAIT, NULL, cmdcopy, NULL);
+    res=msvcrt_spawn(MSVCRT__P_WAIT, NULL, cmdcopy, NULL);
     MSVCRT_free(cmdcopy);
     return res;
 }
@@ -527,7 +520,7 @@
   else
   {
     int err = GetLastError();
-    MSVCRT__set_errno(err);
+    msvcrt_set_errno(err);
     return err;
   }
 }
Index: dlls/msvcrt/scanf.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/scanf.c,v
retrieving revision 1.6
diff -u -r1.6 scanf.c
--- dlls/msvcrt/scanf.c	19 Feb 2004 01:13:13 -0000	1.6
+++ dlls/msvcrt/scanf.c	19 Jun 2004 06:41:56 -0000
@@ -30,10 +30,6 @@
 #include "winreg.h"
 #include "winternl.h"
 #include "msvcrt.h"
-#include "msvcrt/conio.h"
-#include "msvcrt/io.h"
-#include "msvcrt/stdio.h"
-#include "msvcrt/wctype.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
Index: dlls/msvcrt/scanf.h
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/scanf.h,v
retrieving revision 1.17
diff -u -r1.17 scanf.h
--- dlls/msvcrt/scanf.h	17 May 2004 19:49:44 -0000	1.17
+++ dlls/msvcrt/scanf.h	19 Jun 2004 06:43:27 -0000
@@ -46,8 +46,8 @@
 #endif /* WIDE_SCANF */
 
 #ifdef CONSOLE
-#define _GETC_(file) (consumed++, _getch())
-#define _UNGETC_(nch, file) do { _ungetch(nch); consumed--; } while(0)
+#define _GETC_(file) (consumed++, MSVCRT__getch())
+#define _UNGETC_(nch, file) do { MSVCRT__ungetch(nch); consumed--; } while(0)
 #define _FUNCTION_ static int MSVCRT_vcscanf(const char *format, va_list ap)
 #else
 #ifdef STRING
Index: dlls/msvcrt/string.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/string.c,v
retrieving revision 1.9
diff -u -r1.9 string.c
--- dlls/msvcrt/string.c	16 Mar 2004 19:17:11 -0000	1.9
+++ dlls/msvcrt/string.c	19 Jun 2004 06:41:56 -0000
@@ -22,9 +22,6 @@
  */
 
 #include "msvcrt.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -48,9 +45,9 @@
 
 /*********************************************************************
  *		_mbsdup (MSVCRT.@)
- *		_strdup (MSVCRT.@)
+ *		MSVCRT__strdup (MSVCRT.@)
  */
-char* _strdup(const char* str)
+char* MSVCRT__strdup(const char* str)
 {
     char * ret = MSVCRT_malloc(strlen(str)+1);
     if (ret) strcpy( ret, str );
@@ -58,9 +55,9 @@
 }
 
 /*********************************************************************
- *		_strnset (MSVCRT.@)
+ *		MSVCRT__strnset (MSVCRT.@)
  */
-char* _strnset(char* str, int value, unsigned int len)
+char* MSVCRT__strnset(char* str, int value, unsigned int len)
 {
   if (len > 0 && str)
     while (*str && len--)
@@ -88,9 +85,9 @@
 }
 
 /*********************************************************************
- *		_strset (MSVCRT.@)
+ *		MSVCRT__strset (MSVCRT.@)
  */
-char* _strset(char* str, int value)
+char* MSVCRT__strset(char* str, int value)
 {
   char *ptr = str;
   while (*ptr)
Index: dlls/msvcrt/thread.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/thread.c,v
retrieving revision 1.12
diff -u -r1.12 thread.c
--- dlls/msvcrt/thread.c	25 Oct 2002 03:12:01 -0000	1.12
+++ dlls/msvcrt/thread.c	19 Jun 2004 06:41:56 -0000
@@ -18,10 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include "msvcrt.h"
-
-#include "msvcrt/malloc.h"
-#include "msvcrt/process.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -29,7 +25,7 @@
 /********************************************************************/
 
 typedef struct {
-  _beginthread_start_routine_t start_address;
+  MSVCRT__beginthread_start_routine_t start_address;
   void *arglist;
 } _beginthread_trampoline_t;
 
@@ -38,16 +34,16 @@
  *
  * Return the thread local storage structure.
  */
-MSVCRT_thread_data *msvcrt_get_thread_data(void)
+thread_data_t *msvcrt_get_thread_data(void)
 {
-    MSVCRT_thread_data *ptr;
+    thread_data_t *ptr;
     DWORD err = GetLastError();  /* need to preserve last error */
 
-    if (!(ptr = TlsGetValue( MSVCRT_tls_index )))
+    if (!(ptr = TlsGetValue( msvcrt_tls_index )))
     {
         if (!(ptr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ptr) )))
-            MSVCRT__amsg_exit( _RT_THREAD );
-        if (!TlsSetValue( MSVCRT_tls_index, ptr )) MSVCRT__amsg_exit( _RT_THREAD );
+            _amsg_exit( _RT_THREAD );
+        if (!TlsSetValue( msvcrt_tls_index, ptr )) _amsg_exit( _RT_THREAD );
     }
     SetLastError( err );
     return ptr;
@@ -75,7 +71,7 @@
  *		_beginthread (MSVCRT.@)
  */
 unsigned long _beginthread(
-  _beginthread_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
+  MSVCRT__beginthread_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
   unsigned int stack_size, /* [in] Stack size for new thread or 0 */
   void *arglist)           /* [in] Argument list to be passed to new thread or NULL */
 {
@@ -102,7 +98,7 @@
 unsigned long _beginthreadex(
   void *security,          /* [in] Security descriptor for new thread; must be NULL for Windows 9x applications */
   unsigned int stack_size, /* [in] Stack size for new thread or 0 */
-  _beginthreadex_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
+  MSVCRT__beginthreadex_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
   void *arglist,           /* [in] Argument list to be passed to new thread or NULL */
   unsigned int initflag,   /* [in] Initial state of new thread (0 for running or CREATE_SUSPEND for suspended) */
   unsigned int *thrdaddr)  /* [out] Points to a 32-bit variable that receives the thread identifier */
Index: dlls/msvcrt/time.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/time.c,v
retrieving revision 1.14
diff -u -r1.14 time.c
--- dlls/msvcrt/time.c	25 Mar 2004 00:12:40 -0000	1.14
+++ dlls/msvcrt/time.c	19 Jun 2004 06:41:56 -0000
@@ -30,11 +30,7 @@
 #endif
 
 #include "msvcrt.h"
-#include "msvcrt/sys/timeb.h"
-#include "msvcrt/time.h"
-
 #include "winbase.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -221,23 +217,9 @@
 }
 
 /*********************************************************************
- *		time (MSVCRT.@)
- */
-MSVCRT_time_t MSVCRT_time(MSVCRT_time_t* buf)
-{
-  MSVCRT_time_t curtime;
-  struct _timeb tb;
-
-  _ftime(&tb);
-
-  curtime = tb.time;
-  return buf ? *buf = curtime : curtime;
-}
-
-/*********************************************************************
  *		_ftime (MSVCRT.@)
  */
-void _ftime(struct _timeb *buf)
+void _ftime(struct MSVCRT__timeb *buf)
 {
   TIME_ZONE_INFORMATION tzinfo;
   FILETIME ft;
@@ -255,6 +237,20 @@
 }
 
 /*********************************************************************
+ *		time (MSVCRT.@)
+ */
+MSVCRT_time_t MSVCRT_time(MSVCRT_time_t* buf)
+{
+  MSVCRT_time_t curtime;
+  struct MSVCRT__timeb tb;
+
+  _ftime(&tb);
+
+  curtime = tb.time;
+  return buf ? *buf = curtime : curtime;
+}
+
+/*********************************************************************
  *		_daylight (MSVCRT.@)
  */
 int MSVCRT___daylight = 1; /* FIXME: assume daylight */
Index: dlls/msvcrt/wcs.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/wcs.c,v
retrieving revision 1.17
diff -u -r1.17 wcs.c
--- dlls/msvcrt/wcs.c	2 Jun 2004 00:35:09 -0000	1.17
+++ dlls/msvcrt/wcs.c	19 Jun 2004 06:41:56 -0000
@@ -24,12 +24,6 @@
 #include "msvcrt.h"
 #include "winnls.h"
 #include "wine/unicode.h"
-
-#include "msvcrt/stdio.h"
-#include "msvcrt/stdlib.h"
-#include "msvcrt/string.h"
-#include "msvcrt/wctype.h"
-
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@@ -53,9 +47,9 @@
 }
 
 /*********************************************************************
- *		_wcsdup (MSVCRT.@)
+ *		MSVCRT__wcsdup (MSVCRT.@)
  */
-MSVCRT_wchar_t* _wcsdup( const MSVCRT_wchar_t* str )
+MSVCRT_wchar_t* MSVCRT__wcsdup( const MSVCRT_wchar_t* str )
 {
   MSVCRT_wchar_t* ret = NULL;
   if (str)
@@ -356,9 +350,9 @@
 }
 
 /*********************************************************************
- *		_vsnwprintf (MSVCRT.@)
+ *		MSVCRT__vsnwprintf (MSVCRT.@)
  */
-int _vsnwprintf(MSVCRT_wchar_t *str, unsigned int len,
+int MSVCRT__vsnwprintf(MSVCRT_wchar_t *str, unsigned int len,
                 const MSVCRT_wchar_t *format, va_list valist)
 {
     return MSVCRT_vsnprintfW(str, len, format, valist);
Index: dlls/msvcrt/tests/Makefile.in
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/tests/Makefile.in,v
retrieving revision 1.6
diff -u -r1.6 Makefile.in
--- dlls/msvcrt/tests/Makefile.in	25 Mar 2004 00:12:40 -0000	1.6
+++ dlls/msvcrt/tests/Makefile.in	19 Jun 2004 14:44:31 -0000
@@ -4,11 +4,12 @@
 VPATH     = @srcdir@
 TESTDLL   = msvcrt.dll
 IMPORTS   = msvcrt
-EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt
+EXTRAINCL = -I$(TOPSRCDIR)/include/msvcrt -I$(SRCDIR)/..
 
 CTESTS = \
 	cpp.c \
 	file.c \
+	headers.c \
 	heap.c \
 	scanf.c \
 	string.c \
--- /dev/null	2004-02-23 16:02:56.000000000 -0500
+++ dlls/msvcrt/tests/headers.c	2004-06-20 15:54:36.528977936 -0400
@@ -0,0 +1,492 @@
+/*
+ * Copyright 2004 Dimitrie O. Paun
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * This file contains tests to ensure consystencies between symbols
+ * defined in the msvcrt headers, and corresponding duplciated
+ * symbol defined in msvcrt.h (prefixed by MSVCRT_).
+ */
+
+#define USE_MSVCRT_PREFIX
+#include "dos.h"
+#include "math.h"
+#include "stdlib.h"
+#include "eh.h"
+#include "io.h"
+#include "errno.h"
+#include "unistd.h"
+#include "fcntl.h"
+#include "malloc.h"
+#include "limits.h"
+#include "mbctype.h"
+#include "stdio.h"
+#include "wchar.h"
+#include "ctype.h"
+#include "crtdbg.h"
+#include "share.h"
+#include "search.h"
+#include "wctype.h"
+#include "float.h"
+#include "stddef.h"
+#include "mbstring.h"
+#include "sys/unistd.h"
+#include "sys/locking.h"
+#include "sys/utime.h"
+#include "sys/types.h"
+#include "sys/stat.h"
+#include "sys/timeb.h"
+#include "direct.h"
+#include "conio.h"
+#include "dirent.h"
+#include "process.h"
+#include "string.h"
+#include "time.h"
+#include "locale.h"
+#include "setjmp.h"
+#include "msvcrt.h"
+#include "wine/test.h"
+
+#ifdef __GNUC__
+#define TYPEOF(type) typeof(type)
+#else
+#define TYPEOF(type) int
+#endif
+#define MSVCRT(x)    MSVCRT_##x
+#define OFFSET(T,F) ((unsigned int)((char *)&((struct T *)0L)->F - (char *)0L))
+#define CHECK_SIZE(e) ok(sizeof(e) == sizeof(MSVCRT(e)), "Element has different sizes\n")
+#define CHECK_TYPE(t) { TYPEOF(t) a = 0; TYPEOF(MSVCRT(t)) b = 0; a = b; CHECK_SIZE(t); }
+#define CHECK_STRUCT(s) ok(sizeof(struct s) == sizeof(struct MSVCRT(s)), "Struct has different sizes\n")
+#define CHECK_FIELD(s,e) ok(OFFSET(s,e) == OFFSET(MSVCRT(s),e), "Bad offset\n")
+#define CHECK_DEF(n,d1,d2) ok(d1 == d2, "Defines (MSVCRT_)%s are different: '%d' vs. '%d'\n", n, d1, d2)
+#define CHECK_FUNC(f) { TYPEOF(f) *a = 0; TYPEOF(MSVCRT(f)) *b = 0; a = b;  }
+
+/************* Checking types ***************/
+void test_types()
+{
+    CHECK_TYPE(wchar_t);
+    CHECK_TYPE(wint_t);
+    CHECK_TYPE(wctype_t);
+    CHECK_TYPE(_ino_t);
+    CHECK_TYPE(_fsize_t);
+    CHECK_TYPE(size_t);
+    CHECK_TYPE(_dev_t);
+    CHECK_TYPE(_off_t);
+    CHECK_TYPE(clock_t);
+    CHECK_TYPE(time_t);
+    CHECK_TYPE(fpos_t);
+    CHECK_SIZE(FILE);
+    CHECK_TYPE(terminate_handler);
+    CHECK_TYPE(terminate_function);
+    CHECK_TYPE(unexpected_handler);
+    CHECK_TYPE(unexpected_function);
+    CHECK_TYPE(_se_translator_function);
+    CHECK_TYPE(_beginthread_start_routine_t);
+    CHECK_TYPE(_onexit_t);
+}
+
+/************* Checking structs ***************/
+void test_structs()
+{
+    CHECK_STRUCT(tm);
+    CHECK_FIELD(tm, tm_sec);
+    CHECK_FIELD(tm, tm_min);
+    CHECK_FIELD(tm, tm_hour);
+    CHECK_FIELD(tm, tm_mday);
+    CHECK_FIELD(tm, tm_mon);
+    CHECK_FIELD(tm, tm_year);
+    CHECK_FIELD(tm, tm_wday);
+    CHECK_FIELD(tm, tm_yday);
+    CHECK_FIELD(tm, tm_isdst);
+    CHECK_STRUCT(_timeb);
+    CHECK_FIELD(_timeb, time);
+    CHECK_FIELD(_timeb, millitm);
+    CHECK_FIELD(_timeb, timezone);
+    CHECK_FIELD(_timeb, dstflag);
+    CHECK_STRUCT(_iobuf);
+    CHECK_FIELD(_iobuf, _ptr);
+    CHECK_FIELD(_iobuf, _cnt);
+    CHECK_FIELD(_iobuf, _base);
+    CHECK_FIELD(_iobuf, _flag);
+    CHECK_FIELD(_iobuf, _file);
+    CHECK_FIELD(_iobuf, _charbuf);
+    CHECK_FIELD(_iobuf, _bufsiz);
+    CHECK_FIELD(_iobuf, _tmpfname);
+    CHECK_STRUCT(lconv);
+    CHECK_FIELD(lconv, decimal_point);
+    CHECK_FIELD(lconv, thousands_sep);
+    CHECK_FIELD(lconv, grouping);
+    CHECK_FIELD(lconv, int_curr_symbol);
+    CHECK_FIELD(lconv, currency_symbol);
+    CHECK_FIELD(lconv, mon_decimal_point);
+    CHECK_FIELD(lconv, mon_thousands_sep);
+    CHECK_FIELD(lconv, mon_grouping);
+    CHECK_FIELD(lconv, positive_sign);
+    CHECK_FIELD(lconv, negative_sign);
+    CHECK_FIELD(lconv, int_frac_digits);
+    CHECK_FIELD(lconv, frac_digits);
+    CHECK_FIELD(lconv, p_cs_precedes);
+    CHECK_FIELD(lconv, p_sep_by_space);
+    CHECK_FIELD(lconv, n_cs_precedes);
+    CHECK_FIELD(lconv, n_sep_by_space);
+    CHECK_FIELD(lconv, p_sign_posn);
+    CHECK_FIELD(lconv, n_sign_posn);
+    CHECK_STRUCT(_exception);
+    CHECK_FIELD(_exception, type);
+    CHECK_FIELD(_exception, name);
+    CHECK_FIELD(_exception, arg1);
+    CHECK_FIELD(_exception, arg2);
+    CHECK_FIELD(_exception, retval);
+    CHECK_STRUCT(_complex);
+    CHECK_FIELD(_complex, x);
+    CHECK_FIELD(_complex, y);
+    CHECK_STRUCT(_heapinfo);
+    CHECK_FIELD(_heapinfo, _pentry);
+    CHECK_FIELD(_heapinfo, _size);
+    CHECK_FIELD(_heapinfo, _useflag);
+    CHECK_STRUCT(__JUMP_BUFFER);
+    CHECK_FIELD(__JUMP_BUFFER, Ebp);
+    CHECK_FIELD(__JUMP_BUFFER, Ebx);
+    CHECK_FIELD(__JUMP_BUFFER, Edi);
+    CHECK_FIELD(__JUMP_BUFFER, Esi);
+    CHECK_FIELD(__JUMP_BUFFER, Esp);
+    CHECK_FIELD(__JUMP_BUFFER, Eip);
+    CHECK_FIELD(__JUMP_BUFFER, Registration);
+    CHECK_FIELD(__JUMP_BUFFER, TryLevel);
+    CHECK_FIELD(__JUMP_BUFFER, Cookie);
+    CHECK_FIELD(__JUMP_BUFFER, UnwindFunc);
+    CHECK_FIELD(__JUMP_BUFFER, UnwindData[6]);
+    CHECK_STRUCT(_diskfree_t);
+    CHECK_FIELD(_diskfree_t, total_clusters);
+    CHECK_FIELD(_diskfree_t, avail_clusters);
+    CHECK_FIELD(_diskfree_t, sectors_per_cluster);
+    CHECK_FIELD(_diskfree_t, bytes_per_sector);
+    CHECK_STRUCT(_finddata_t);
+    CHECK_FIELD(_finddata_t, attrib);
+    CHECK_FIELD(_finddata_t, time_create);
+    CHECK_FIELD(_finddata_t, time_access);
+    CHECK_FIELD(_finddata_t, time_write);
+    CHECK_FIELD(_finddata_t, size);
+    CHECK_FIELD(_finddata_t, name[260]);
+    CHECK_STRUCT(_finddatai64_t);
+    CHECK_FIELD(_finddatai64_t, attrib);
+    CHECK_FIELD(_finddatai64_t, time_create);
+    CHECK_FIELD(_finddatai64_t, time_access);
+    CHECK_FIELD(_finddatai64_t, time_write);
+    CHECK_FIELD(_finddatai64_t, size);
+    CHECK_FIELD(_finddatai64_t, name[260]);
+    CHECK_STRUCT(_wfinddata_t);
+    CHECK_FIELD(_wfinddata_t, attrib);
+    CHECK_FIELD(_wfinddata_t, time_create);
+    CHECK_FIELD(_wfinddata_t, time_access);
+    CHECK_FIELD(_wfinddata_t, time_write);
+    CHECK_FIELD(_wfinddata_t, size);
+    CHECK_FIELD(_wfinddata_t, name[260]);
+    CHECK_STRUCT(_wfinddatai64_t);
+    CHECK_FIELD(_wfinddatai64_t, attrib);
+    CHECK_FIELD(_wfinddatai64_t, time_create);
+    CHECK_FIELD(_wfinddatai64_t, time_access);
+    CHECK_FIELD(_wfinddatai64_t, time_write);
+    CHECK_FIELD(_wfinddatai64_t, size);
+    CHECK_FIELD(_wfinddatai64_t, name[260]);
+    CHECK_STRUCT(_utimbuf);
+    CHECK_FIELD(_utimbuf, actime);
+    CHECK_FIELD(_utimbuf, modtime);
+    CHECK_STRUCT(_stat);
+    CHECK_FIELD(_stat, st_dev);
+    CHECK_FIELD(_stat, st_ino);
+    CHECK_FIELD(_stat, st_mode);
+    CHECK_FIELD(_stat, st_nlink);
+    CHECK_FIELD(_stat, st_uid);
+    CHECK_FIELD(_stat, st_gid);
+    CHECK_FIELD(_stat, st_rdev);
+    CHECK_FIELD(_stat, st_size);
+    CHECK_FIELD(_stat, st_atime);
+    CHECK_FIELD(_stat, st_mtime);
+    CHECK_FIELD(_stat, st_ctime);
+    CHECK_FIELD(_stat, st_dev);
+    CHECK_FIELD(_stat, st_ino);
+    CHECK_FIELD(_stat, st_mode);
+    CHECK_FIELD(_stat, st_nlink);
+    CHECK_FIELD(_stat, st_uid);
+    CHECK_FIELD(_stat, st_gid);
+    CHECK_FIELD(_stat, st_rdev);
+    CHECK_FIELD(_stat, st_size);
+    CHECK_FIELD(_stat, st_atime);
+    CHECK_FIELD(_stat, st_mtime);
+    CHECK_FIELD(_stat, st_ctime);
+    CHECK_FIELD(_stat, st_dev);
+    CHECK_FIELD(_stat, st_ino);
+    CHECK_FIELD(_stat, st_mode);
+    CHECK_FIELD(_stat, st_nlink);
+    CHECK_FIELD(_stat, st_uid);
+    CHECK_FIELD(_stat, st_gid);
+    CHECK_FIELD(_stat, st_rdev);
+    CHECK_FIELD(_stat, st_size);
+    CHECK_FIELD(_stat, st_atime);
+    CHECK_FIELD(_stat, st_mtime);
+    CHECK_FIELD(_stat, st_ctime);
+    CHECK_STRUCT(stat);
+    CHECK_FIELD(stat, st_dev);
+    CHECK_FIELD(stat, st_ino);
+    CHECK_FIELD(stat, st_mode);
+    CHECK_FIELD(stat, st_nlink);
+    CHECK_FIELD(stat, st_uid);
+    CHECK_FIELD(stat, st_gid);
+    CHECK_FIELD(stat, st_rdev);
+    CHECK_FIELD(stat, st_size);
+    CHECK_FIELD(stat, st_atime);
+    CHECK_FIELD(stat, st_mtime);
+    CHECK_FIELD(stat, st_ctime);
+    CHECK_FIELD(stat, st_dev);
+    CHECK_FIELD(stat, st_ino);
+    CHECK_FIELD(stat, st_mode);
+    CHECK_FIELD(stat, st_nlink);
+    CHECK_FIELD(stat, st_uid);
+    CHECK_FIELD(stat, st_gid);
+    CHECK_FIELD(stat, st_rdev);
+    CHECK_FIELD(stat, st_size);
+    CHECK_FIELD(stat, st_atime);
+    CHECK_FIELD(stat, st_mtime);
+    CHECK_FIELD(stat, st_ctime);
+    CHECK_FIELD(stat, st_dev);
+    CHECK_FIELD(stat, st_ino);
+    CHECK_FIELD(stat, st_mode);
+    CHECK_FIELD(stat, st_nlink);
+    CHECK_FIELD(stat, st_uid);
+    CHECK_FIELD(stat, st_gid);
+    CHECK_FIELD(stat, st_rdev);
+    CHECK_FIELD(stat, st_size);
+    CHECK_FIELD(stat, st_atime);
+    CHECK_FIELD(stat, st_mtime);
+    CHECK_FIELD(stat, st_ctime);
+    CHECK_STRUCT(_stati64);
+    CHECK_FIELD(_stati64, st_dev);
+    CHECK_FIELD(_stati64, st_ino);
+    CHECK_FIELD(_stati64, st_mode);
+    CHECK_FIELD(_stati64, st_nlink);
+    CHECK_FIELD(_stati64, st_uid);
+    CHECK_FIELD(_stati64, st_gid);
+    CHECK_FIELD(_stati64, st_rdev);
+    CHECK_FIELD(_stati64, st_size);
+    CHECK_FIELD(_stati64, st_atime);
+    CHECK_FIELD(_stati64, st_mtime);
+    CHECK_FIELD(_stati64, st_ctime);
+}
+
+/************* Checking defines ***************/
+void test_defines()
+{
+    CHECK_DEF("WEOF", WEOF, MSVCRT_WEOF);
+    CHECK_DEF("EOF", EOF, MSVCRT_EOF);
+    CHECK_DEF("TMP_MAX", TMP_MAX, MSVCRT_TMP_MAX);
+    CHECK_DEF("BUFSIZ", BUFSIZ, MSVCRT_BUFSIZ);
+    CHECK_DEF("STDIN_FILENO", STDIN_FILENO, MSVCRT_STDIN_FILENO);
+    CHECK_DEF("STDOUT_FILENO", STDOUT_FILENO, MSVCRT_STDOUT_FILENO);
+    CHECK_DEF("STDERR_FILENO", STDERR_FILENO, MSVCRT_STDERR_FILENO);
+    CHECK_DEF("_IOFBF", _IOFBF, MSVCRT__IOFBF);
+    CHECK_DEF("_IONBF", _IONBF, MSVCRT__IONBF);
+    CHECK_DEF("_IOLBF", _IOLBF, MSVCRT__IOLBF);
+    CHECK_DEF("FILENAME_MAX", FILENAME_MAX, MSVCRT_FILENAME_MAX);
+    CHECK_DEF("_P_WAIT", _P_WAIT, MSVCRT__P_WAIT);
+    CHECK_DEF("_P_NOWAIT", _P_NOWAIT, MSVCRT__P_NOWAIT);
+    CHECK_DEF("_P_OVERLAY", _P_OVERLAY, MSVCRT__P_OVERLAY);
+    CHECK_DEF("_P_NOWAITO", _P_NOWAITO, MSVCRT__P_NOWAITO);
+    CHECK_DEF("_P_DETACH", _P_DETACH, MSVCRT__P_DETACH);
+    CHECK_DEF("EPERM", EPERM, MSVCRT_EPERM);
+    CHECK_DEF("ENOENT", ENOENT, MSVCRT_ENOENT);
+    CHECK_DEF("ESRCH", ESRCH, MSVCRT_ESRCH);
+    CHECK_DEF("EINTR", EINTR, MSVCRT_EINTR);
+    CHECK_DEF("EIO", EIO, MSVCRT_EIO);
+    CHECK_DEF("ENXIO", ENXIO, MSVCRT_ENXIO);
+    CHECK_DEF("E2BIG", E2BIG, MSVCRT_E2BIG);
+    CHECK_DEF("ENOEXEC", ENOEXEC, MSVCRT_ENOEXEC);
+    CHECK_DEF("EBADF", EBADF, MSVCRT_EBADF);
+    CHECK_DEF("ECHILD", ECHILD, MSVCRT_ECHILD);
+    CHECK_DEF("EAGAIN", EAGAIN, MSVCRT_EAGAIN);
+    CHECK_DEF("ENOMEM", ENOMEM, MSVCRT_ENOMEM);
+    CHECK_DEF("EACCES", EACCES, MSVCRT_EACCES);
+    CHECK_DEF("EFAULT", EFAULT, MSVCRT_EFAULT);
+    CHECK_DEF("EBUSY", EBUSY, MSVCRT_EBUSY);
+    CHECK_DEF("EEXIST", EEXIST, MSVCRT_EEXIST);
+    CHECK_DEF("EXDEV", EXDEV, MSVCRT_EXDEV);
+    CHECK_DEF("ENODEV", ENODEV, MSVCRT_ENODEV);
+    CHECK_DEF("ENOTDIR", ENOTDIR, MSVCRT_ENOTDIR);
+    CHECK_DEF("EISDIR", EISDIR, MSVCRT_EISDIR);
+    CHECK_DEF("EINVAL", EINVAL, MSVCRT_EINVAL);
+    CHECK_DEF("ENFILE", ENFILE, MSVCRT_ENFILE);
+    CHECK_DEF("EMFILE", EMFILE, MSVCRT_EMFILE);
+    CHECK_DEF("ENOTTY", ENOTTY, MSVCRT_ENOTTY);
+    CHECK_DEF("EFBIG", EFBIG, MSVCRT_EFBIG);
+    CHECK_DEF("ENOSPC", ENOSPC, MSVCRT_ENOSPC);
+    CHECK_DEF("ESPIPE", ESPIPE, MSVCRT_ESPIPE);
+    CHECK_DEF("EROFS", EROFS, MSVCRT_EROFS);
+    CHECK_DEF("EMLINK", EMLINK, MSVCRT_EMLINK);
+    CHECK_DEF("EPIPE", EPIPE, MSVCRT_EPIPE);
+    CHECK_DEF("EDOM", EDOM, MSVCRT_EDOM);
+    CHECK_DEF("ERANGE", ERANGE, MSVCRT_ERANGE);
+    CHECK_DEF("EDEADLK", EDEADLK, MSVCRT_EDEADLK);
+    CHECK_DEF("EDEADLOCK", EDEADLOCK, MSVCRT_EDEADLOCK);
+    CHECK_DEF("ENAMETOOLONG", ENAMETOOLONG, MSVCRT_ENAMETOOLONG);
+    CHECK_DEF("ENOLCK", ENOLCK, MSVCRT_ENOLCK);
+    CHECK_DEF("ENOSYS", ENOSYS, MSVCRT_ENOSYS);
+    CHECK_DEF("ENOTEMPTY", ENOTEMPTY, MSVCRT_ENOTEMPTY);
+    CHECK_DEF("LC_ALL", LC_ALL, MSVCRT_LC_ALL);
+    CHECK_DEF("LC_COLLATE", LC_COLLATE, MSVCRT_LC_COLLATE);
+    CHECK_DEF("LC_CTYPE", LC_CTYPE, MSVCRT_LC_CTYPE);
+    CHECK_DEF("LC_MONETARY", LC_MONETARY, MSVCRT_LC_MONETARY);
+    CHECK_DEF("LC_NUMERIC", LC_NUMERIC, MSVCRT_LC_NUMERIC);
+    CHECK_DEF("LC_TIME", LC_TIME, MSVCRT_LC_TIME);
+    CHECK_DEF("LC_MIN", LC_MIN, MSVCRT_LC_MIN);
+    CHECK_DEF("LC_MAX", LC_MAX, MSVCRT_LC_MAX);
+    CHECK_DEF("_HEAPEMPTY", _HEAPEMPTY, MSVCRT__HEAPEMPTY);
+    CHECK_DEF("_HEAPOK", _HEAPOK, MSVCRT__HEAPOK);
+    CHECK_DEF("_HEAPBADBEGIN", _HEAPBADBEGIN, MSVCRT__HEAPBADBEGIN);
+    CHECK_DEF("_HEAPBADNODE", _HEAPBADNODE, MSVCRT__HEAPBADNODE);
+    CHECK_DEF("_HEAPEND", _HEAPEND, MSVCRT__HEAPEND);
+    CHECK_DEF("_HEAPBADPTR", _HEAPBADPTR, MSVCRT__HEAPBADPTR);
+    CHECK_DEF("_FREEENTRY", _FREEENTRY, MSVCRT__FREEENTRY);
+    CHECK_DEF("_USEDENTRY", _USEDENTRY, MSVCRT__USEDENTRY);
+    CHECK_DEF("_OUT_TO_DEFAULT", _OUT_TO_DEFAULT, MSVCRT__OUT_TO_DEFAULT);
+    CHECK_DEF("_REPORT_ERRMODE", _REPORT_ERRMODE, MSVCRT__REPORT_ERRMODE);
+    CHECK_DEF("_UPPER", _UPPER, MSVCRT__UPPER);
+    CHECK_DEF("_LOWER", _LOWER, MSVCRT__LOWER);
+    CHECK_DEF("_DIGIT", _DIGIT, MSVCRT__DIGIT);
+    CHECK_DEF("_SPACE", _SPACE, MSVCRT__SPACE);
+    CHECK_DEF("_PUNCT", _PUNCT, MSVCRT__PUNCT);
+    CHECK_DEF("_CONTROL", _CONTROL, MSVCRT__CONTROL);
+    CHECK_DEF("_BLANK", _BLANK, MSVCRT__BLANK);
+    CHECK_DEF("_HEX", _HEX, MSVCRT__HEX);
+    CHECK_DEF("_LEADBYTE", _LEADBYTE, MSVCRT__LEADBYTE);
+    CHECK_DEF("_ALPHA", _ALPHA, MSVCRT__ALPHA);
+    CHECK_DEF("_IOREAD", _IOREAD, MSVCRT__IOREAD);
+    CHECK_DEF("_IOWRT", _IOWRT, MSVCRT__IOWRT);
+    CHECK_DEF("_IOMYBUF", _IOMYBUF, MSVCRT__IOMYBUF);
+    CHECK_DEF("_IOEOF", _IOEOF, MSVCRT__IOEOF);
+    CHECK_DEF("_IOERR", _IOERR, MSVCRT__IOERR);
+    CHECK_DEF("_IOSTRG", _IOSTRG, MSVCRT__IOSTRG);
+    CHECK_DEF("_IORW", _IORW, MSVCRT__IORW);
+    CHECK_DEF("_S_IEXEC", _S_IEXEC, MSVCRT__S_IEXEC);
+    CHECK_DEF("_S_IWRITE", _S_IWRITE, MSVCRT__S_IWRITE);
+    CHECK_DEF("_S_IREAD", _S_IREAD, MSVCRT__S_IREAD);
+    CHECK_DEF("_S_IFIFO", _S_IFIFO, MSVCRT__S_IFIFO);
+    CHECK_DEF("_S_IFCHR", _S_IFCHR, MSVCRT__S_IFCHR);
+    CHECK_DEF("_S_IFDIR", _S_IFDIR, MSVCRT__S_IFDIR);
+    CHECK_DEF("_S_IFREG", _S_IFREG, MSVCRT__S_IFREG);
+    CHECK_DEF("_S_IFMT", _S_IFMT, MSVCRT__S_IFMT);
+    CHECK_DEF("_LK_UNLCK", _LK_UNLCK, MSVCRT__LK_UNLCK);
+    CHECK_DEF("_LK_LOCK", _LK_LOCK, MSVCRT__LK_LOCK);
+    CHECK_DEF("_LK_NBLCK", _LK_NBLCK, MSVCRT__LK_NBLCK);
+    CHECK_DEF("_LK_RLCK", _LK_RLCK, MSVCRT__LK_RLCK);
+    CHECK_DEF("_LK_NBRLCK", _LK_NBRLCK, MSVCRT__LK_NBRLCK);
+    CHECK_DEF("_O_RDONLY", _O_RDONLY, MSVCRT__O_RDONLY);
+    CHECK_DEF("_O_WRONLY", _O_WRONLY, MSVCRT__O_WRONLY);
+    CHECK_DEF("_O_RDWR", _O_RDWR, MSVCRT__O_RDWR);
+    CHECK_DEF("_O_ACCMODE", _O_ACCMODE, MSVCRT__O_ACCMODE);
+    CHECK_DEF("_O_APPEND", _O_APPEND, MSVCRT__O_APPEND);
+    CHECK_DEF("_O_RANDOM", _O_RANDOM, MSVCRT__O_RANDOM);
+    CHECK_DEF("_O_SEQUENTIAL", _O_SEQUENTIAL, MSVCRT__O_SEQUENTIAL);
+    CHECK_DEF("_O_TEMPORARY", _O_TEMPORARY, MSVCRT__O_TEMPORARY);
+    CHECK_DEF("_O_NOINHERIT", _O_NOINHERIT, MSVCRT__O_NOINHERIT);
+    CHECK_DEF("_O_CREAT", _O_CREAT, MSVCRT__O_CREAT);
+    CHECK_DEF("_O_TRUNC", _O_TRUNC, MSVCRT__O_TRUNC);
+    CHECK_DEF("_O_EXCL", _O_EXCL, MSVCRT__O_EXCL);
+    CHECK_DEF("_O_SHORT_LIVED", _O_SHORT_LIVED, MSVCRT__O_SHORT_LIVED);
+    CHECK_DEF("_O_TEXT", _O_TEXT, MSVCRT__O_TEXT);
+    CHECK_DEF("_O_BINARY", _O_BINARY, MSVCRT__O_BINARY);
+    CHECK_DEF("_O_RAW", _O_RAW, MSVCRT__O_RAW);
+    CHECK_DEF("_SW_INEXACT", _SW_INEXACT, MSVCRT__SW_INEXACT);
+    CHECK_DEF("_SW_UNDERFLOW", _SW_UNDERFLOW, MSVCRT__SW_UNDERFLOW);
+    CHECK_DEF("_SW_OVERFLOW", _SW_OVERFLOW, MSVCRT__SW_OVERFLOW);
+    CHECK_DEF("_SW_ZERODIVIDE", _SW_ZERODIVIDE, MSVCRT__SW_ZERODIVIDE);
+    CHECK_DEF("_SW_INVALID", _SW_INVALID, MSVCRT__SW_INVALID);
+    CHECK_DEF("_SW_UNEMULATED", _SW_UNEMULATED, MSVCRT__SW_UNEMULATED);
+    CHECK_DEF("_SW_SQRTNEG", _SW_SQRTNEG, MSVCRT__SW_SQRTNEG);
+    CHECK_DEF("_SW_STACKOVERFLOW", _SW_STACKOVERFLOW, MSVCRT__SW_STACKOVERFLOW);
+    CHECK_DEF("_SW_STACKUNDERFLOW", _SW_STACKUNDERFLOW, MSVCRT__SW_STACKUNDERFLOW);
+    CHECK_DEF("_SW_DENORMAL", _SW_DENORMAL, MSVCRT__SW_DENORMAL);
+    CHECK_DEF("_FPCLASS_SNAN", _FPCLASS_SNAN, MSVCRT__FPCLASS_SNAN);
+    CHECK_DEF("_FPCLASS_QNAN", _FPCLASS_QNAN, MSVCRT__FPCLASS_QNAN);
+    CHECK_DEF("_FPCLASS_NINF", _FPCLASS_NINF, MSVCRT__FPCLASS_NINF);
+    CHECK_DEF("_FPCLASS_NN", _FPCLASS_NN, MSVCRT__FPCLASS_NN);
+    CHECK_DEF("_FPCLASS_ND", _FPCLASS_ND, MSVCRT__FPCLASS_ND);
+    CHECK_DEF("_FPCLASS_NZ", _FPCLASS_NZ, MSVCRT__FPCLASS_NZ);
+    CHECK_DEF("_FPCLASS_PZ", _FPCLASS_PZ, MSVCRT__FPCLASS_PZ);
+    CHECK_DEF("_FPCLASS_PD", _FPCLASS_PD, MSVCRT__FPCLASS_PD);
+    CHECK_DEF("_FPCLASS_PN", _FPCLASS_PN, MSVCRT__FPCLASS_PN);
+    CHECK_DEF("_FPCLASS_PINF", _FPCLASS_PINF, MSVCRT__FPCLASS_PINF);
+    CHECK_DEF("_EM_INVALID", _EM_INVALID, MSVCRT__EM_INVALID);
+    CHECK_DEF("_EM_DENORMAL", _EM_DENORMAL, MSVCRT__EM_DENORMAL);
+    CHECK_DEF("_EM_ZERODIVIDE", _EM_ZERODIVIDE, MSVCRT__EM_ZERODIVIDE);
+    CHECK_DEF("_EM_OVERFLOW", _EM_OVERFLOW, MSVCRT__EM_OVERFLOW);
+    CHECK_DEF("_EM_UNDERFLOW", _EM_UNDERFLOW, MSVCRT__EM_UNDERFLOW);
+    CHECK_DEF("_EM_INEXACT", _EM_INEXACT, MSVCRT__EM_INEXACT);
+    CHECK_DEF("_IC_AFFINE", _IC_AFFINE, MSVCRT__IC_AFFINE);
+    CHECK_DEF("_IC_PROJECTIVE", _IC_PROJECTIVE, MSVCRT__IC_PROJECTIVE);
+    CHECK_DEF("_RC_CHOP", _RC_CHOP, MSVCRT__RC_CHOP);
+    CHECK_DEF("_RC_UP", _RC_UP, MSVCRT__RC_UP);
+    CHECK_DEF("_RC_DOWN", _RC_DOWN, MSVCRT__RC_DOWN);
+    CHECK_DEF("_RC_NEAR", _RC_NEAR, MSVCRT__RC_NEAR);
+    CHECK_DEF("_PC_24", _PC_24, MSVCRT__PC_24);
+    CHECK_DEF("_PC_53", _PC_53, MSVCRT__PC_53);
+    CHECK_DEF("_PC_64", _PC_64, MSVCRT__PC_64);
+}
+
+/************* Checking functions ***************/
+void test_functions()
+{
+    CHECK_FUNC(free);
+    CHECK_FUNC(malloc);
+    CHECK_FUNC(calloc);
+    CHECK_FUNC(realloc);
+    CHECK_FUNC(iswalpha);
+    CHECK_FUNC(iswspace);
+    CHECK_FUNC(iswdigit);
+    CHECK_FUNC(isleadbyte);
+    CHECK_FUNC(_write);
+    CHECK_FUNC(_getch);
+    CHECK_FUNC(_exit);
+    CHECK_FUNC(abort);
+    CHECK_FUNC(__doserrno);
+    CHECK_FUNC(_errno);
+    CHECK_FUNC(getenv);
+    CHECK_FUNC(setlocale);
+    CHECK_FUNC(terminate);
+    CHECK_FUNC(time);
+    CHECK_FUNC(_vsnwprintf);
+    CHECK_FUNC(_ismbstrail);
+    CHECK_FUNC(_spawnve);
+    CHECK_FUNC(_searchenv);
+    CHECK_FUNC(_getdrive);
+    CHECK_FUNC(_strdup);
+    CHECK_FUNC(_strnset);
+    CHECK_FUNC(_strset);
+    CHECK_FUNC(_ungetch);
+    CHECK_FUNC(_cputs);
+    CHECK_FUNC(_cprintf);
+    CHECK_FUNC(__p__environ);
+    CHECK_FUNC(__p___mb_cur_max);
+    CHECK_FUNC(__p__fmode);
+    CHECK_FUNC(_wcsdup);
+    CHECK_FUNC(__p__wenviron);
+}
+
+START_TEST(headers)
+{
+    test_types();
+    test_structs();
+    test_defines();
+    test_functions();
+}



More information about the wine-patches mailing list