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
3 //
4 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // The C locale library.
7 //
8 #pragma once
9 #define _INC_LOCALE
10 
11 #include <corecrt.h>
12 
14 
15 
16 
17 // Locale categories
18 #define LC_ALL 0
19 #define LC_COLLATE 1
20 #define LC_CTYPE 2
21 #define LC_MONETARY 3
22 #define LC_NUMERIC 4
23 #define LC_TIME 5
24 
25 #define LC_MIN LC_ALL
26 #define LC_MAX LC_TIME
27 
28 // Locale convention structure
29 struct lconv
30 {
33  char* grouping;
38  char* mon_grouping;
49  wchar_t* _W_decimal_point;
50  wchar_t* _W_thousands_sep;
55  wchar_t* _W_positive_sign;
56  wchar_t* _W_negative_sign;
57 };
58 
59 struct tm;
60 
61 // ANSI: char lconv members default is CHAR_MAX which is compile time dependent.
62 // Defining and using __do_unsigned_char_lconv_initialization here causes CRT
63 // startup code to initialize lconv members properly
64 #ifdef _CHAR_UNSIGNED
65  extern int __do_unsigned_char_lconv_initialization;
66  extern __inline int __use_char_max(void)
67  {
68  return __do_unsigned_char_lconv_initialization;
69  }
70 #endif
71 
72 
73 
74 #define _ENABLE_PER_THREAD_LOCALE 0x0001
75 #define _DISABLE_PER_THREAD_LOCALE 0x0002
76 #define _ENABLE_PER_THREAD_LOCALE_GLOBAL 0x0010
77 #define _DISABLE_PER_THREAD_LOCALE_GLOBAL 0x0020
78 #define _ENABLE_PER_THREAD_LOCALE_NEW 0x0100
79 #define _DISABLE_PER_THREAD_LOCALE_NEW 0x0200
80 
81 #if _CRT_FUNCTIONS_REQUIRED
82 
83  _ACRTIMP void __cdecl _lock_locales(void);
84  _ACRTIMP void __cdecl _unlock_locales(void);
85 
87  _ACRTIMP int __cdecl _configthreadlocale(
88  _In_ int _Flag
89  );
90 
92  _ACRTIMP char* __cdecl setlocale(
93  _In_ int _Category,
94  _In_opt_z_ char const* _Locale
95  );
96 
98  _ACRTIMP struct lconv* __cdecl localeconv(void);
99 
101  _ACRTIMP _locale_t __cdecl _get_current_locale(void);
102 
105  _In_ int _Category,
106  _In_z_ char const* _Locale
107  );
108 
109  _ACRTIMP void __cdecl _free_locale(
111  );
112 
113  // Also declared in <wchar.h>
115  _ACRTIMP wchar_t* __cdecl _wsetlocale(
116  _In_ int _Category,
117  _In_opt_z_ wchar_t const* _Locale
118  );
119 
122  _In_ int _Category,
123  _In_z_ wchar_t const* _Locale
124  );
125 
126 
127 
128  _ACRTIMP wchar_t** __cdecl ___lc_locale_name_func(void);
129  _ACRTIMP unsigned int __cdecl ___lc_codepage_func (void);
130  _ACRTIMP unsigned int __cdecl ___lc_collate_cp_func (void);
131 
132 
133 
134 
135  // Time-related functions
136  _Success_(return != 0)
137  _Ret_z_
138  _ACRTIMP char* __cdecl _Getdays(void);
139 
140  _Success_(return != 0)
141  _Ret_z_
142  _ACRTIMP char* __cdecl _Getmonths(void);
143 
144  _ACRTIMP void* __cdecl _Gettnames(void);
145 
146  _Success_(return != 0)
147  _Ret_z_
148  _ACRTIMP wchar_t* __cdecl _W_Getdays(void);
149 
150  _Success_(return != 0)
151  _Ret_z_
152  _ACRTIMP wchar_t* __cdecl _W_Getmonths(void);
153 
154  _ACRTIMP void* __cdecl _W_Gettnames(void);
155 
156  _Success_(return > 0)
157  _ACRTIMP size_t __cdecl _Strftime(
159  _In_ size_t _Max_size,
160  _In_z_ char const* _Format,
161  _In_ struct tm const* _Timeptr,
162  _In_opt_ void* _Lc_time_arg);
163 
164  _Success_(return > 0)
165  _ACRTIMP size_t __cdecl _Wcsftime(
166  _Out_writes_z_(_Max_size) wchar_t* _Buffer,
167  _In_ size_t _Max_size,
168  _In_z_ wchar_t const* _Format,
169  _In_ struct tm const* _Timeptr,
170  _In_opt_ void* _Lc_time_arg
171  );
172 
173 #endif // _CRT_FUNCTIONS_REQUIRED
174 
175 
return
Definition: corecrt_memcpy_s.h:60
char * mon_thousands_sep
Definition: locale.h:37
Definition: corecrt.h:489
wchar_t * _W_currency_symbol
Definition: locale.h:52
#define _ACRTIMP
Definition: corecrt.h:27
_ACRTIMP wchar_t **__cdecl ___lc_locale_name_func(void)
_Check_return_opt_ _ACRTIMP _locale_t __cdecl _get_current_locale(void)
_ACRTIMP unsigned int __cdecl ___lc_collate_cp_func(void)
_Check_return_opt_ _ACRTIMP int __cdecl _configthreadlocale(_In_ int _Flag)
char * mon_decimal_point
Definition: locale.h:36
#define _Check_return_opt_
Definition: corecrt.h:96
wchar_t * _W_thousands_sep
Definition: locale.h:50
#define _Ret_z_
Definition: sal.h:521
#define _Out_writes_z_(size)
Definition: sal.h:349
char p_sign_posn
Definition: locale.h:47
_Success_(return!=0) _Ret_z_ _ACRTIMP char *__cdecl _Getdays(void)
char * negative_sign
Definition: locale.h:40
char * grouping
Definition: locale.h:33
char * decimal_point
Definition: locale.h:31
wchar_t * _W_positive_sign
Definition: locale.h:55
char * mon_grouping
Definition: locale.h:38
_Check_return_opt_ _ACRTIMP wchar_t *__cdecl _wsetlocale(_In_ int _Category, _In_opt_z_ wchar_t const *_Locale)
_ACRTIMP unsigned int __cdecl ___lc_codepage_func(void)
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:73
char int_frac_digits
Definition: locale.h:41
_ACRTIMP void *__cdecl _Gettnames(void)
#define _In_opt_z_
Definition: sal.h:311
_ACRTIMP void __cdecl _lock_locales(void)
_Check_return_opt_ _ACRTIMP struct lconv *__cdecl localeconv(void)
char n_sep_by_space
Definition: locale.h:46
Definition: locale.h:29
char n_sign_posn
Definition: locale.h:48
#define _In_z_
Definition: sal.h:310
#define _In_
Definition: sal.h:305
char * positive_sign
Definition: locale.h:39
#define _In_opt_
Definition: sal.h:306
char * currency_symbol
Definition: locale.h:35
_Check_return_opt_ _ACRTIMP char *__cdecl setlocale(_In_ int _Category, _In_opt_z_ char const *_Locale)
_Check_return_wat_ *_SizeRead wchar_t * _Buffer
Definition: corecrt_wconio.h:27
char p_sep_by_space
Definition: locale.h:44
char p_cs_precedes
Definition: locale.h:43
char * int_curr_symbol
Definition: locale.h:34
_In_ size_t _Max_size
Definition: locale.h:159
_In_ size_t _In_z_ char const _In_ struct tm const _In_opt_ void * _Lc_time_arg
Definition: locale.h:161
_ACRTIMP void __cdecl _free_locale(_In_opt_ _locale_t _Locale)
Definition: corecrt_wtime.h:22
wchar_t * _W_mon_thousands_sep
Definition: locale.h:54
#define _CRT_END_C_HEADER
Definition: vcruntime.h:76
wchar_t * _W_negative_sign
Definition: locale.h:56
char * thousands_sep
Definition: locale.h:32
_ACRTIMP void *__cdecl _W_Gettnames(void)
_In_ size_t _In_z_ char const _In_ struct tm const * _Timeptr
Definition: locale.h:161
wchar_t * _W_int_curr_symbol
Definition: locale.h:51
_Check_return_opt_ _In_opt_ _locale_t const _Locale
Definition: corecrt_wconio.h:289
_Check_return_opt_ _ACRTIMP _locale_t __cdecl _wcreate_locale(_In_ int _Category, _In_z_ wchar_t const *_Locale)
wchar_t * _W_decimal_point
Definition: locale.h:49
wchar_t * _W_mon_decimal_point
Definition: locale.h:53
char frac_digits
Definition: locale.h:42
_ACRTIMP void __cdecl _unlock_locales(void)
_In_ size_t _In_z_ char const * _Format
Definition: locale.h:159
_Check_return_opt_ _ACRTIMP _locale_t __cdecl _create_locale(_In_ int _Category, _In_z_ char const *_Locale)
char n_cs_precedes
Definition: locale.h:45