Msvcrt fixes, locale.h

Francois Gouget fgouget at free.fr
Tue Sep 18 02:16:07 CDT 2001



Changelog:

 * include/msvcrt/locale.h,
   include/msvcrt/wchar.h,
   include/msvcrt/sys/stat.h,
   dlls/msvcrt/locale.c,
   dlls/msvcrt/main.c

   Add msvcrt/locale.h
   Add missing include directives in msvcrt/wchar.h
   Fix prototype of _wstati64 in msvcrt/sys/stat.h



--
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
    I haven't lost my mind, it's backed up on tape around here somewhere...
-------------- next part --------------
--- /dev/null	Sat Jun 30 11:39:08 2001
+++ include/msvcrt/locale.h	Mon Sep 17 14:34:01 2001
@@ -0,0 +1,73 @@
+/*
+ * Locale definitions
+ *
+ * Copyright 2000 Francois Gouget.
+ */
+#ifndef __WINE_LOCALE_H
+#define __WINE_LOCALE_H
+
+#include "winnt.h"
+
+#ifdef USE_MSVCRT_PREFIX
+#define MSVCRT(x)    MSVCRT_##x
+#else
+#define MSVCRT(x)    x
+#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
+#define LC_MONETARY            3
+#define LC_NUMERIC             4
+#define LC_TIME                5
+#define LC_MIN                 LC_ALL
+#define LC_MAX                 LC_TIME
+#endif /* USE_MSVCRT_PREFIX */
+
+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;
+};
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char*       MSVCRT(setlocale)(int,const char*);
+struct MSVCRT(lconv)* MSVCRT(localeconv)(void);
+
+WCHAR*      _wsetlocale(int,const WCHAR*);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WINE_LOCALE_H */
Index: include/msvcrt/wchar.h
===================================================================
RCS file: /home/wine/wine/include/msvcrt/wchar.h,v
retrieving revision 1.1
diff -u -r1.1 wchar.h
--- include/msvcrt/wchar.h	2001/04/10 23:21:43	1.1
+++ include/msvcrt/wchar.h	2001/09/18 00:48:02
@@ -9,13 +9,13 @@
 #define __WINE_WCHAR_H
 
 #include "msvcrt/io.h"
-/* FIXME: does not exist yet #include "msvcrt/locale.h" */
-/* FIXME: does not exist yet #include "msvcrt/process.h" */
+#include "msvcrt/locale.h"
+#include "msvcrt/process.h"
 #include "msvcrt/stdio.h"
 #include "msvcrt/stdlib.h"
 #include "msvcrt/string.h"
 #include "msvcrt/sys/stat.h"
-/* FIXME: does not exist yet #include "msvcrt/sys/types.h" */
+#include "msvcrt/sys/types.h"
 #include "msvcrt/time.h"
 #include "msvcrt/wctype.h"
 
Index: include/msvcrt/sys/stat.h
===================================================================
RCS file: /home/wine/wine/include/msvcrt/sys/stat.h,v
retrieving revision 1.1
diff -u -r1.1 stat.h
--- include/msvcrt/sys/stat.h	2001/04/10 23:21:44	1.1
+++ include/msvcrt/sys/stat.h	2001/09/18 00:48:02
@@ -60,7 +60,7 @@
 int _stati64(const char*,struct _stati64*);
 
 int _wstat(const WCHAR*,struct _stat*);
-int _wstati64(const wchar_t*,struct _stati64*);
+int _wstati64(const WCHAR*,struct _stati64*);
 
 #ifdef __cplusplus
 }
Index: dlls/msvcrt/locale.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/locale.c,v
retrieving revision 1.7
diff -u -r1.7 locale.c
--- dlls/msvcrt/locale.c	2001/09/11 00:32:32	1.7
+++ dlls/msvcrt/locale.c	2001/09/18 00:47:49
@@ -4,7 +4,9 @@
  * Copyright 2000 Jon Griffiths
  */
 #include "winnt.h"
+
 #include "msvcrt.h"
+#include "msvcrt/locale.h"
 
 DEFAULT_DEBUG_CHANNEL(msvcrt);
 
@@ -32,16 +34,6 @@
 extern unsigned char MSVCRT_mbctype[257];
 
 #define MSVCRT_LEADBYTE  0x8000
-
-/* Locales */
-#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
 
 /* Friendly country strings & iso codes for synonym support.
  * Based on MS documentation for setlocale().
Index: dlls/msvcrt/main.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/main.c,v
retrieving revision 1.4
diff -u -r1.4 main.c
--- dlls/msvcrt/main.c	2001/07/11 18:56:42	1.4
+++ dlls/msvcrt/main.c	2001/09/18 00:47:49
@@ -5,6 +5,7 @@
  */
 #include "msvcrt.h"
 
+#include "msvcrt/locale.h"
 #include "msvcrt/stdio.h"
 
 
@@ -32,7 +33,6 @@
 void msvcrt_init_args(void);
 void msvcrt_free_args(void);
 void msvcrt_init_vtables(void);
-char* MSVCRT_setlocale(int category, const char* locale);
 
 
 /*********************************************************************


More information about the wine-patches mailing list