From 433430ae960a878f9f8b802f34f53b6f902f779a Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Wed, 19 Sep 2001 20:29:33 +0000 Subject: [PATCH] Add msvcrt/locale.h. Add missing include directives in msvcrt/wchar.h. Fix prototype of _wstati64 in msvcrt/sys/stat.h. --- dlls/msvcrt/locale.c | 12 ++----- dlls/msvcrt/main.c | 2 +- include/Makefile.in | 1 + include/msvcrt/locale.h | 73 +++++++++++++++++++++++++++++++++++++++ include/msvcrt/sys/stat.h | 2 +- include/msvcrt/wchar.h | 6 ++-- 6 files changed, 81 insertions(+), 15 deletions(-) create mode 100644 include/msvcrt/locale.h diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index 3bb407d9c2e..df6667a2b8d 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -4,7 +4,9 @@ * Copyright 2000 Jon Griffiths */ #include "winnt.h" + #include "msvcrt.h" +#include "msvcrt/locale.h" DEFAULT_DEBUG_CHANNEL(msvcrt); @@ -33,16 +35,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(). */ diff --git a/dlls/msvcrt/main.c b/dlls/msvcrt/main.c index 52a4a077e60..1dad326ef13 100644 --- a/dlls/msvcrt/main.c +++ b/dlls/msvcrt/main.c @@ -5,6 +5,7 @@ */ #include "msvcrt.h" +#include "msvcrt/locale.h" #include "msvcrt/stdio.h" @@ -32,7 +33,6 @@ void msvcrt_free_console(void); void msvcrt_init_args(void); void msvcrt_free_args(void); void msvcrt_init_vtables(void); -char* MSVCRT_setlocale(int category, const char* locale); /********************************************************************* diff --git a/include/Makefile.in b/include/Makefile.in index ee235447b6e..78eb8b43fca 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -59,6 +59,7 @@ INSTALLED_INCLUDES = \ msvcrt/eh.h \ msvcrt/fcntl.h \ msvcrt/io.h \ + msvcrt/locale.h \ msvcrt/malloc.h \ msvcrt/process.h \ msvcrt/search.h \ diff --git a/include/msvcrt/locale.h b/include/msvcrt/locale.h new file mode 100644 index 00000000000..a5d6ed7e12d --- /dev/null +++ b/include/msvcrt/locale.h @@ -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 */ diff --git a/include/msvcrt/sys/stat.h b/include/msvcrt/sys/stat.h index ffc0e5d5c1a..4a9b102465b 100644 --- a/include/msvcrt/sys/stat.h +++ b/include/msvcrt/sys/stat.h @@ -60,7 +60,7 @@ int _stat(const char*,struct _stat*); int _stati64(const char*,struct _stati64*); int _wstat(const WCHAR*,struct _stat*); -int _wstati64(const wchar_t*,struct _stati64*); +int _wstati64(const WCHAR*,struct _stati64*); #ifdef __cplusplus } diff --git a/include/msvcrt/wchar.h b/include/msvcrt/wchar.h index e4c95b15676..a4f76aa6731 100644 --- a/include/msvcrt/wchar.h +++ b/include/msvcrt/wchar.h @@ -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"