Reactos
at master 140 lines 3.9 kB view raw
1// 2// nlsdata.cpp 3// 4// Copyright (c) Microsoft Corporation. All rights reserved. 5// 6// Globals for the locale and code page implementation. These are utilized by 7// almost all locale-dependent functions. 8// 9#include <corecrt_internal.h> 10 11 12 13extern "C" { int __mb_cur_max{1}; } 14 15 16 17extern "C" int* __cdecl __p___mb_cur_max() 18{ 19 __acrt_ptd* ptd = __acrt_getptd(); 20 __crt_locale_data* locale_info = ptd->_locale_info; 21 22 __acrt_update_locale_info(ptd, &locale_info); 23 return &locale_info->_public._locale_mb_cur_max; 24} 25 26 27 28extern "C" { wchar_t __acrt_wide_c_locale_string[]{L"C"}; } 29 30 31 32extern "C" { __crt_lc_time_data const __lc_time_c 33{ 34 { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }, 35 36 { 37 "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", 38 "Friday", "Saturday" 39 }, 40 41 { 42 "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", 43 "Sep", "Oct", "Nov", "Dec" 44 }, 45 46 { 47 "January", "February", "March", "April", "May", "June", 48 "July", "August", "September", "October", 49 "November", "December" 50 }, 51 52 { "AM", "PM" }, 53 54 "MM/dd/yy", 55 "dddd, MMMM dd, yyyy", 56 "HH:mm:ss", 57 58 1, 59 0, 60 61 { L"Sun", L"Mon", L"Tue", L"Wed", L"Thu", L"Fri", L"Sat" }, 62 63 { 64 L"Sunday", L"Monday", L"Tuesday", L"Wednesday", 65 L"Thursday", L"Friday", L"Saturday" 66 }, 67 68 { 69 L"Jan", L"Feb", L"Mar", L"Apr", L"May", L"Jun", L"Jul", 70 L"Aug", L"Sep", L"Oct", L"Nov", L"Dec" 71 }, 72 73 { 74 L"January", L"February", L"March", L"April", L"May", 75 L"June", L"July", L"August", L"September", L"October", 76 L"November", L"December" 77 }, 78 79 { L"AM", L"PM" }, 80 81 L"MM/dd/yy", 82 L"dddd, MMMM dd, yyyy", 83 L"HH:mm:ss", 84 L"en-US" 85}; } 86 87 88 89// The initial locale information structure, containing the C locale data. It 90// is used until the first call to setlocale(). 91extern "C" { __crt_locale_data __acrt_initial_locale_data 92{ 93 { 94 __newctype + 128, // _locale_pctype 95 1, // _locale_mb_cur_max 96 CP_ACP // _locale_lc_codepage 97 }, 98 1, // refcount 99 CP_ACP, // lc_collate_cp 100 CP_ACP, // lc_time_cp 101 1, // lc_clike 102 { 103 { nullptr, nullptr, nullptr, nullptr }, // lc_category[LC_ALL] 104 { nullptr, __acrt_wide_c_locale_string, nullptr, nullptr }, // lc_category[LC_COLLATE] 105 { nullptr, __acrt_wide_c_locale_string, nullptr, nullptr }, // lc_category[LC_CTYPE] 106 { nullptr, __acrt_wide_c_locale_string, nullptr, nullptr }, // lc_category[LC_MONETARY] 107 { nullptr, __acrt_wide_c_locale_string, nullptr, nullptr }, // lc_category[LC_NUMERIC] 108 { nullptr, __acrt_wide_c_locale_string, nullptr, nullptr } // lc_category[LC_TIME] 109 }, 110 nullptr, // lconv_intl_refcount 111 nullptr, // lconv_num_refcount 112 nullptr, // lconv_mon_refcount 113 &__acrt_lconv_c, // lconv 114 nullptr, // ctype1_refcount 115 nullptr, // ctype1 116 __newclmap + 128, // pclmap 117 __newcumap + 128, // pcumap 118 &__lc_time_c, // lc_time_curr 119 { 120 nullptr, // locale_name[LC_ALL] 121 nullptr, // locale_name[LC_COLLATE] 122 nullptr, // locale_name[LC_CTYPE] 123 nullptr, // locale_name[LC_MONETARY] 124 nullptr, // locale_name[LC_NUMERIC] 125 nullptr // locale_name[LC_TIME] 126 } 127}; } 128 129 130 131// Global pointer to the current per-thread locale information structure. 132__crt_state_management::dual_state_global<__crt_locale_data*> __acrt_current_locale_data; 133 134 135 136extern "C" { __crt_locale_pointers __acrt_initial_locale_pointers 137{ 138 &__acrt_initial_locale_data, 139 &__acrt_initial_multibyte_data 140}; }