ReactOS 0.4.16-dev-1106-g00b5dc8
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#ifndef _INC_LOCALE // include guard for 3rd party interop
10#define _INC_LOCALE
11
12#include <corecrt.h>
13
14#pragma warning(push)
15#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
17
19
20
21
22// Locale categories
23#define LC_ALL 0
24#define LC_COLLATE 1
25#define LC_CTYPE 2
26#define LC_MONETARY 3
27#define LC_NUMERIC 4
28#define LC_TIME 5
29
30#define LC_MIN LC_ALL
31#define LC_MAX LC_TIME
32
33// Locale convention structure
34struct lconv
35{
36 char* decimal_point;
37 char* thousands_sep;
38 char* grouping;
39 char* int_curr_symbol;
40 char* currency_symbol;
43 char* mon_grouping;
44 char* positive_sign;
45 char* negative_sign;
46 char int_frac_digits;
47 char frac_digits;
48 char p_cs_precedes;
49 char p_sep_by_space;
50 char n_cs_precedes;
51 char n_sep_by_space;
52 char p_sign_posn;
53 char n_sign_posn;
62};
63
64struct tm;
65
66// ANSI: char lconv members default is CHAR_MAX which is compile time dependent.
67// Defining and using __do_unsigned_char_lconv_initialization here causes CRT
68// startup code to initialize lconv members properly
69#ifdef _CHAR_UNSIGNED
70 extern int __do_unsigned_char_lconv_initialization;
71 extern __inline int __use_char_max(void)
72 {
73 return __do_unsigned_char_lconv_initialization;
74 }
75#endif
76
77
78
79#define _ENABLE_PER_THREAD_LOCALE 0x0001
80#define _DISABLE_PER_THREAD_LOCALE 0x0002
81#define _ENABLE_PER_THREAD_LOCALE_GLOBAL 0x0010
82#define _DISABLE_PER_THREAD_LOCALE_GLOBAL 0x0020
83#define _ENABLE_PER_THREAD_LOCALE_NEW 0x0100
84#define _DISABLE_PER_THREAD_LOCALE_NEW 0x0200
85
86#if _CRT_FUNCTIONS_REQUIRED
87
90
93 _In_ int _Flag
94 );
95
98 _In_ int _Category,
100 );
101
104
107
110 _In_ int _Category,
111 _In_z_ char const* _Locale
112 );
113
116 );
117
118 // Also declared in <wchar.h>
121 _In_ int _Category,
122 _In_opt_z_ wchar_t const* _Locale
123 );
124
127 _In_ int _Category,
128 _In_z_ wchar_t const* _Locale
129 );
130
131
132
134 _ACRTIMP unsigned int __cdecl ___lc_codepage_func (void);
135 _ACRTIMP unsigned int __cdecl ___lc_collate_cp_func (void);
136
137
138
139
140 // Time-related functions
141 _Success_(return != 0)
142 _Ret_z_
143 _ACRTIMP char* __cdecl _Getdays(void);
144
145 _Success_(return != 0)
146 _Ret_z_
147 _ACRTIMP char* __cdecl _Getmonths(void);
148
149 _ACRTIMP void* __cdecl _Gettnames(void);
150
151 _Success_(return != 0)
152 _Ret_z_
153 _ACRTIMP wchar_t* __cdecl _W_Getdays(void);
154
155 _Success_(return != 0)
156 _Ret_z_
157 _ACRTIMP wchar_t* __cdecl _W_Getmonths(void);
158
159 _ACRTIMP void* __cdecl _W_Gettnames(void);
160
161 _Success_(return > 0)
164 _In_ size_t _Max_size,
165 _In_z_ char const* _Format,
166 _In_ struct tm const* _Timeptr,
167 _In_opt_ void* _Lc_time_arg);
168
169 _Success_(return > 0)
172 _In_ size_t _Max_size,
173 _In_z_ wchar_t const* _Format,
174 _In_ struct tm const* _Timeptr,
175 _In_opt_ void* _Lc_time_arg
176 );
177
178#endif // _CRT_FUNCTIONS_REQUIRED
179
180
183#pragma warning(pop) // _UCRT_DISABLED_WARNINGS
184#endif // _INC_LOCALE
#define __inline
Definition: _wctype.cpp:15
#define __cdecl
Definition: accygwin.h:79
return
Definition: dirsup.c:529
_In_z_ _Printf_format_string_ char const *const _Format
Definition: printf.c:19
_CRTIMP unsigned int __cdecl ___lc_collate_cp_func(void)
Definition: locale.c:637
_Check_return_opt_ int __cdecl _configthreadlocale(_In_ int _Flag)
_Check_return_opt_ _locale_t __cdecl _create_locale(_In_ int _Category, _In_z_ const char *_Locale)
_Check_return_opt_ _CRTIMP struct lconv *__cdecl localeconv(void)
Definition: locale.c:603
void __cdecl _free_locale(_In_opt_ _locale_t _Locale)
_CRTIMP unsigned int __cdecl ___lc_codepage_func(void)
Definition: locale.c:629
_Check_return_opt_ _locale_t __cdecl _get_current_locale(void)
Definition: wsetlocale.cpp:213
_Check_return_opt_ _CRTIMP wchar_t *__cdecl _wsetlocale(_In_ int _Category, _In_opt_z_ const wchar_t *_Locale)
_In_ _Pre_notnull_ _Buffer
Definition: stdlib.h:644
wchar_t **__cdecl ___lc_locale_name_func()
Definition: initctype.cpp:326
void __cdecl _lock_locales()
Definition: locks.cpp:62
void __cdecl _unlock_locales()
Definition: locks.cpp:68
void *__cdecl _Gettnames(void)
Definition: locale.c:485
#define _Out_writes_z_(s)
Definition: no_sal2.h:180
#define _Success_(c)
Definition: no_sal2.h:84
#define _In_z_
Definition: no_sal2.h:164
#define _In_opt_z_
Definition: no_sal2.h:218
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _Ret_z_
Definition: no_sal2.h:306
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm _In_opt_ _locale_t _Locale
Definition: time.h:159
_In_ size_t _Max_size
Definition: time.h:156
void *__cdecl _W_Gettnames()
Definition: wcsftime.cpp:83
Definition: locale.h:29
wchar_t * _W_decimal_point
Definition: locale.h:54
char * mon_thousands_sep
Definition: locale.h:36
wchar_t * _W_mon_thousands_sep
Definition: locale.h:59
char p_sign_posn
Definition: locale.h:46
char * int_curr_symbol
Definition: locale.h:33
char p_sep_by_space
Definition: locale.h:43
char * positive_sign
Definition: locale.h:38
char * decimal_point
Definition: locale.h:30
char * grouping
Definition: locale.h:32
wchar_t * _W_thousands_sep
Definition: locale.h:55
char int_frac_digits
Definition: locale.h:40
wchar_t * _W_mon_decimal_point
Definition: locale.h:58
char frac_digits
Definition: locale.h:41
char n_sep_by_space
Definition: locale.h:45
char * mon_grouping
Definition: locale.h:37
char n_cs_precedes
Definition: locale.h:44
char * mon_decimal_point
Definition: locale.h:35
wchar_t * _W_int_curr_symbol
Definition: locale.h:56
char n_sign_posn
Definition: locale.h:47
char * currency_symbol
Definition: locale.h:34
wchar_t * _W_currency_symbol
Definition: locale.h:57
char p_cs_precedes
Definition: locale.h:42
char * thousands_sep
Definition: locale.h:31
wchar_t * _W_positive_sign
Definition: locale.h:60
char * negative_sign
Definition: locale.h:39
wchar_t * _W_negative_sign
Definition: locale.h:61
Definition: time.h:68
#define setlocale(n, s)
Definition: locale.h:46
#define _Check_return_opt_
Definition: corecrt.h:224
#define _ACRTIMP
Definition: corecrt.h:138
#define _UCRT_DISABLE_CLANG_WARNINGS
Definition: corecrt.h:109
#define _UCRT_RESTORE_CLANG_WARNINGS
Definition: corecrt.h:117
#define _CRT_END_C_HEADER
Definition: vcruntime.h:42
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:40
wchar_t *__cdecl _W_Getmonths()
Definition: wcsftime.cpp:51
wchar_t *__cdecl _W_Getdays()
Definition: wcsftime.cpp:19
size_t __cdecl _Wcsftime(wchar_t *const buffer, size_t const max_size, wchar_t const *const format, tm const *const timeptr, void *const lc_time_arg)
Definition: wcsftime.cpp:1170
_locale_t __cdecl _wcreate_locale(int _category, const wchar_t *locale)
Definition: wsetlocale.cpp:340
_CRTIMP size_t __cdecl _Strftime(char *, size_t _Maxsize, const char *, const struct tm *, void *)
Definition: strftime.c:114
_CRTIMP char *__cdecl _Getdays(void)
Definition: locale.c:419
_CRTIMP char *__cdecl _Getmonths(void)
Definition: locale.c:452
#define const
Definition: zconf.h:233