xref: /reactos/sdk/lib/ucrt/locale/locale_update.cpp (revision 04e0dc4a)
1 //
2 // locale_update.cpp
3 //
4 //      Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // Encapsulated implementation details of _LocaleUpdate that cannot be defined
7 // in the header because they refer to data not exported from the AppCRT DLL.
8 //
9 #include <corecrt_internal.h>
10 
__acrt_update_locale_info(__acrt_ptd * const ptd,__crt_locale_data ** const locale_info)11 extern "C" void __acrt_update_locale_info(
12     __acrt_ptd*         const ptd,
13     __crt_locale_data** const locale_info
14     )
15 {
16     if (*locale_info != __acrt_current_locale_data.value() && __acrt_should_sync_with_global_locale(ptd))
17     {
18         *locale_info = __acrt_update_thread_locale_data();
19     }
20 }
21 
__acrt_update_multibyte_info(__acrt_ptd * const ptd,__crt_multibyte_data ** const multibyte_info)22 extern "C" void __acrt_update_multibyte_info(
23     __acrt_ptd*            const ptd,
24     __crt_multibyte_data** const multibyte_info
25     )
26 {
27     if (*multibyte_info != __acrt_current_multibyte_data.value() && __acrt_should_sync_with_global_locale(ptd))
28     {
29         *multibyte_info = __acrt_update_thread_multibyte_data();
30     }
31 }
32 
__acrt_update_locale_info_explicit(__acrt_ptd * const ptd,__crt_locale_data ** const locale_info,size_t const current_global_state_index)33 extern "C" void __acrt_update_locale_info_explicit(
34     __acrt_ptd*         const ptd,
35     __crt_locale_data** const locale_info,
36     size_t              const current_global_state_index
37     )
38 {
39     if (*locale_info != __acrt_current_locale_data.value_explicit(current_global_state_index) && __acrt_should_sync_with_global_locale(ptd))
40     {
41         *locale_info = __acrt_update_thread_locale_data();
42     }
43 }
44 
__acrt_update_multibyte_info_explicit(__acrt_ptd * const ptd,__crt_multibyte_data ** const multibyte_info,size_t const current_global_state_index)45 extern "C" void __acrt_update_multibyte_info_explicit(
46     __acrt_ptd*            const ptd,
47     __crt_multibyte_data** const multibyte_info,
48     size_t                 const current_global_state_index
49     )
50 {
51     if (*multibyte_info != __acrt_current_multibyte_data.value_explicit(current_global_state_index) && __acrt_should_sync_with_global_locale(ptd))
52     {
53         *multibyte_info = __acrt_update_thread_multibyte_data();
54     }
55 }
56