STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
locale.h
Go to the documentation of this file.
1 /***
2 *locale.h - definitions/declarations for localization routines
3 *
4 * Copyright (c) Microsoft Corporation. All rights reserved.
5 *
6 *Purpose:
7 * This file defines the structures, values, macros, and functions
8 * used by the localization routines.
9 *
10 * [Public]
11 *
12 ****/
13 
14 #pragma once
15 
16 #ifndef _INC_LOCALE
17 #define _INC_LOCALE
18 
19 #include <crtdefs.h>
20 
21 /*
22  * Currently, all MS C compilers for Win32 platforms default to 8 byte
23  * alignment.
24  */
25 #pragma pack(push,_CRT_PACKING)
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30 
31 /* define NULL pointer value */
32 #ifndef NULL
33 #ifdef __cplusplus
34 #define NULL 0
35 #else /* __cplusplus */
36 #define NULL ((void *)0)
37 #endif /* __cplusplus */
38 #endif /* NULL */
39 
40 /* Locale categories */
41 
42 #define LC_ALL 0
43 #define LC_COLLATE 1
44 #define LC_CTYPE 2
45 #define LC_MONETARY 3
46 #define LC_NUMERIC 4
47 #define LC_TIME 5
48 
49 #define LC_MIN LC_ALL
50 #define LC_MAX LC_TIME
51 
52 /* Locale convention structure */
53 
54 #ifndef _LCONV_DEFINED
55 struct lconv {
58  char *grouping;
63  char *mon_grouping;
74  wchar_t *_W_decimal_point;
75  wchar_t *_W_thousands_sep;
80  wchar_t *_W_positive_sign;
81  wchar_t *_W_negative_sign;
82  };
83 #define _LCONV_DEFINED
84 #endif /* _LCONV_DEFINED */
85 
86 /* ANSI: char lconv members default is CHAR_MAX which is compile time
87  dependent. Defining and using _charmax here causes CRT startup code
88  to initialize lconv members properly */
89 
90 #ifdef _CHAR_UNSIGNED
91 extern int _charmax;
92 extern __inline int __dummy(void) { return _charmax; }
93 #endif /* _CHAR_UNSIGNED */
94 
95 /* function prototypes */
96 
97 #ifndef _CONFIG_LOCALE_SWT
98 #define _ENABLE_PER_THREAD_LOCALE 0x1
99 #define _DISABLE_PER_THREAD_LOCALE 0x2
100 #define _ENABLE_PER_THREAD_LOCALE_GLOBAL 0x10
101 #define _DISABLE_PER_THREAD_LOCALE_GLOBAL 0x20
102 #define _ENABLE_PER_THREAD_LOCALE_NEW 0x100
103 #define _DISABLE_PER_THREAD_LOCALE_NEW 0x200
104 #define _CONFIG_LOCALE_SWT
105 #endif /* _CONFIG_LOCALE_SWT */
106 
107 _Check_return_opt_ _CRTIMP int __cdecl _configthreadlocale(_In_ int _Flag);
108 _Check_return_opt_ _CRTIMP char * __cdecl setlocale(_In_ int _Category, _In_opt_z_ const char * _Locale);
109 _Check_return_opt_ _CRTIMP struct lconv * __cdecl localeconv(void);
111 _Check_return_opt_ _CRTIMP _locale_t __cdecl _create_locale(_In_ int _Category, _In_z_ const char * _Locale);
113 
114 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
115 /* use _get_current_locale, _create_locale and _free_locale, instead of these functions with double leading underscore */
116 _Check_return_ _CRT_OBSOLETE(_get_current_locale) _CRTIMP _locale_t __cdecl __get_current_locale(void);
117 _Check_return_ _CRT_OBSOLETE(_create_locale) _CRTIMP _locale_t __cdecl __create_locale(_In_ int _Category, _In_z_ const char * _Locale);
118 _CRT_OBSOLETE(_free_locale) _CRTIMP void __cdecl __free_locale(_In_opt_ _locale_t _Locale);
119 #endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */
120 
121 #ifndef _WLOCALE_DEFINED
122 
123 /* wide function prototypes, also declared in wchar.h */
124 
125 _Check_return_opt_ _CRTIMP wchar_t * __cdecl _wsetlocale(_In_ int _Category, _In_opt_z_ const wchar_t * _Locale);
126 _Check_return_opt_ _CRTIMP _locale_t __cdecl _wcreate_locale(_In_ int _Category, _In_z_ const wchar_t * _Locale);
127 
128 #define _WLOCALE_DEFINED
129 #endif /* _WLOCALE_DEFINED */
130 
131 #ifdef __cplusplus
132 }
133 #endif /* __cplusplus */
134 
135 #pragma pack(pop)
136 
137 #endif /* _INC_LOCALE */
char * mon_thousands_sep
Definition: locale.h:62
wchar_t * _W_currency_symbol
Definition: locale.h:77
_Check_return_opt_ _CRTIMP wchar_t *__cdecl _wsetlocale(_In_ int _Category, _In_opt_z_ const wchar_t *_Locale)
char * mon_decimal_point
Definition: locale.h:61
#define _CRTIMP
Definition: crtdefs.h:23
wchar_t * _W_thousands_sep
Definition: locale.h:75
char p_sign_posn
Definition: locale.h:72
char * negative_sign
Definition: locale.h:65
char * grouping
Definition: locale.h:58
char * decimal_point
Definition: locale.h:56
wchar_t * _W_positive_sign
Definition: locale.h:80
char * mon_grouping
Definition: locale.h:63
_Check_return_opt_ _CRTIMP struct lconv *__cdecl localeconv(void)
char int_frac_digits
Definition: locale.h:66
#define _In_opt_z_
Definition: sal.h:320
#define _Check_return_
Definition: sal.h:563
char n_sep_by_space
Definition: locale.h:71
_Check_return_opt_ _CRTIMP _locale_t __cdecl _wcreate_locale(_In_ int _Category, _In_z_ const wchar_t *_Locale)
Definition: locale.h:55
char n_sign_posn
Definition: locale.h:73
#define _In_z_
Definition: sal.h:319
#define _In_
Definition: sal.h:314
_Check_return_ _In_z_ const char * _Locale
Definition: locale.h:117
char * positive_sign
Definition: locale.h:64
_Check_return_opt_ _CRTIMP char *__cdecl setlocale(_In_ int _Category, _In_opt_z_ const char *_Locale)
#define _In_opt_
Definition: sal.h:315
char * currency_symbol
Definition: locale.h:60
char p_sep_by_space
Definition: locale.h:69
_CRTIMP void __cdecl _free_locale(_In_opt_ _locale_t _Locale)
char p_cs_precedes
Definition: locale.h:68
char * int_curr_symbol
Definition: locale.h:59
_Check_return_opt_ _CRTIMP _locale_t __cdecl _get_current_locale(void)
_Check_return_ _CRT_OBSOLETE(_get_current_locale) _CRTIMP _locale_t __cdecl __get_current_locale(void)
wchar_t * _W_mon_thousands_sep
Definition: locale.h:79
_Check_return_opt_ _CRTIMP int __cdecl _configthreadlocale(_In_ int _Flag)
wchar_t * _W_negative_sign
Definition: locale.h:81
char * thousands_sep
Definition: locale.h:57
#define _Check_return_opt_
Definition: crtdefs.h:2122
wchar_t * _W_int_curr_symbol
Definition: locale.h:76
wchar_t * _W_decimal_point
Definition: locale.h:74
wchar_t * _W_mon_decimal_point
Definition: locale.h:78
char frac_digits
Definition: locale.h:67
_Check_return_opt_ _CRTIMP _locale_t __cdecl _create_locale(_In_ int _Category, _In_z_ const char *_Locale)
Definition: crtdefs.h:2078
char n_cs_precedes
Definition: locale.h:70