ReactOS 0.4.16-dev-822-gbcedb53
localeconv.cpp
Go to the documentation of this file.
1/***
2*lconv.c - Contains the localeconv function
3*
4* Copyright (c) Microsoft Corporation. All rights reserved.
5*
6*Purpose:
7* Contains the localeconv() function.
8*
9*******************************************************************************/
10#include <corecrt_internal.h>
11#include <limits.h>
12#include <locale.h>
13
14
15
16/* pointer to original static to avoid freeing */
17extern "C" { char __acrt_lconv_static_decimal []{"."}; }
18extern "C" { char __acrt_lconv_static_null []{""}; }
19extern "C" { wchar_t __acrt_lconv_static_W_decimal[]{L"."}; }
20extern "C" { wchar_t __acrt_lconv_static_W_null []{L""}; }
21
22/* lconv settings for "C" locale */
23extern "C" { struct lconv __acrt_lconv_c
24{
26 __acrt_lconv_static_null, // thousands_sep
27 __acrt_lconv_static_null, // grouping
28 __acrt_lconv_static_null, // int_curr_symbol
29 __acrt_lconv_static_null, // currency_symbol
30 __acrt_lconv_static_null, // mon_decimal_point
31 __acrt_lconv_static_null, // mon_thousands_sep
32 __acrt_lconv_static_null, // mon_grouping
33 __acrt_lconv_static_null, // positive_sign
34 __acrt_lconv_static_null, // negative_sign
35 CHAR_MAX, // int_frac_digits
36 CHAR_MAX, // frac_digits
37 CHAR_MAX, // p_cs_precedes
38 CHAR_MAX, // p_sep_by_space
39 CHAR_MAX, // n_cs_precedes
40 CHAR_MAX, // n_sep_by_space
41 CHAR_MAX, // p_sign_posn
42 CHAR_MAX, // n_sign_posn
43 __acrt_lconv_static_W_decimal, // _W_decimal_point
44 __acrt_lconv_static_W_null, // _W_thousands_sep
45 __acrt_lconv_static_W_null, // _W_int_curr_symbol
46 __acrt_lconv_static_W_null, // _W_currency_symbol
47 __acrt_lconv_static_W_null, // _W_mon_decimal_point
48 __acrt_lconv_static_W_null, // _W_mon_thousands_sep
49 __acrt_lconv_static_W_null, // _W_positive_sign
50 __acrt_lconv_static_W_null, // _W_negative_sign
51}; }
52
53
54/* pointer to current lconv structure */
55
56extern "C" { struct lconv* __acrt_lconv{&__acrt_lconv_c}; }
57
58/***
59*struct lconv *localeconv(void) - Return the numeric formatting convention
60*
61*Purpose:
62* The localeconv() routine returns the numeric formatting conventions
63* for the current locale setting. [ANSI]
64*
65*Entry:
66* void
67*
68*Exit:
69* struct lconv * = pointer to struct indicating current numeric
70* formatting conventions.
71*
72*Exceptions:
73*
74*******************************************************************************/
75
77{
78 // Note that we don't need _LocaleUpdate in this function. The main reason
79 // being, that this is a leaf function in locale usage terms.
80 __acrt_ptd* const ptd = __acrt_getptd();
81 __crt_locale_data* locale_info = ptd->_locale_info;
82
83 __acrt_update_locale_info(ptd, &locale_info);
84
85 return locale_info->lconv;
86}
#define __cdecl
Definition: accygwin.h:79
__acrt_ptd *__cdecl __acrt_getptd(void)
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
Definition: cvt.cpp:355
#define CHAR_MAX
Definition: limits.h:32
void __acrt_update_locale_info(__acrt_ptd *const ptd, __crt_locale_data **const locale_info)
char __acrt_lconv_static_decimal[]
Definition: localeconv.cpp:17
char __acrt_lconv_static_null[]
Definition: localeconv.cpp:18
lconv *__cdecl localeconv()
Definition: localeconv.cpp:76
struct lconv * __acrt_lconv
Definition: localeconv.cpp:56
wchar_t __acrt_lconv_static_W_decimal[]
Definition: localeconv.cpp:19
wchar_t __acrt_lconv_static_W_null[]
Definition: localeconv.cpp:20
#define L(x)
Definition: ntvdm.h:50
struct lconv * lconv
Definition: locale.h:29