ReactOS 0.4.16-dev-819-g75c0dc0
_ctype.cpp File Reference
#include <corecrt_internal.h>
#include <ctype.h>
#include <locale.h>
Include dependency graph for _ctype.cpp:

Go to the source code of this file.

Functions

static __forceinline int fast_check_initial_locale (int const c, int const mask) throw ()
 
static __forceinline int fast_check_current_locale (int const c, int const mask) throw ()
 
static __forceinline int fast_check_given_locale (int const c, int const mask, _locale_t const locale) throw ()
 
 int (__cdecl _isalpha_l)(int const c
 

Variables

_locale_t const locale
 

Function Documentation

◆ fast_check_current_locale()

static __forceinline int fast_check_current_locale ( int const  c,
int const  mask 
)
throw (
)
static

Definition at line 28 of file _ctype.cpp.

29{
30 // Avoid PTD lookup when locale is unchanged.
31 if (!__acrt_locale_changed())
32 {
34 }
35
36 // Avoid _LocaleUpdate overhead:
37 // * Extra un-inlined function calls
38 // * Multibyte locale synchronization
39 // * Marking/unmarking current thread as using per-thread-locales.
40
41 __acrt_ptd * const ptd{__acrt_getptd()};
42 __crt_locale_data * locale_info{ptd->_locale_info};
43 __acrt_update_locale_info(ptd, &locale_info);
44
45 // Common case
46 if (c >= -1 && c <= 255)
47 {
48 return locale_info->_public._locale_pctype[c] & mask;
49 }
50
51 // Microsoft Extension: Translate int values outside of unsigned char range for DBCS locales
52 // Note that our documentation also clearly states this is undefined.
53 if (locale_info->_public._locale_mb_cur_max > 1)
54 {
55 return _isctype_l(c, mask, nullptr);
56 }
57
58 return 0;
59}
static __forceinline int fast_check_initial_locale(int const c, int const mask)
Definition: _ctype.cpp:19
__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
const GLubyte * c
Definition: glext.h:8905
GLenum GLint GLuint mask
Definition: glext.h:6028
_Check_return_ _CRTIMP int __cdecl _isctype_l(_In_ int _C, _In_ int _Type, _In_opt_ _locale_t _Locale)
#define c
Definition: ke_i.h:80
void __acrt_update_locale_info(__acrt_ptd *const ptd, __crt_locale_data **const locale_info)

Referenced by fast_check_given_locale(), and int().

◆ fast_check_given_locale()

static __forceinline int fast_check_given_locale ( int const  c,
int const  mask,
_locale_t const  locale 
)
throw (
)
static

Definition at line 61 of file _ctype.cpp.

62{
63 // Avoid _LocaleUpdate overhead - just check whether it's nullptr.
64 if (locale == nullptr) {
66 }
67
68 // Common case
69 if (c >= -1 && c <= 255)
70 {
71 return locale->locinfo->_public._locale_pctype[c] & mask;
72 }
73
74 // Microsoft Extension: Translate int values outside of unsigned char range for DBCS locales
75 // Note that our documentation also clearly states this is undefined.
76 if (locale->locinfo->_public._locale_mb_cur_max > 1)
77 {
78 return _isctype_l(c, mask, locale);
79 }
80
81 return 0;
82}
static __forceinline int fast_check_current_locale(int const c, int const mask)
Definition: _ctype.cpp:28
Definition: _locale.h:75

◆ fast_check_initial_locale()

static __forceinline int fast_check_initial_locale ( int const  c,
int const  mask 
)
throw (
)
static

Definition at line 19 of file _ctype.cpp.

20{
21 #ifdef _DEBUG
22 return _chvalidator(c, mask);
23 #else
25 #endif
26}
__crt_locale_data __acrt_initial_locale_data
Definition: nlsdata.cpp:92
static int __CRTDECL __acrt_locale_get_ctype_array_value(_In_reads_(_Char_value+1) unsigned short const *const locale_pctype_array, _In_range_(-1, 255) int const c, _In_ int const mask)
Definition: stubs.c:113
unsigned short const * _locale_pctype
Definition: stubs.c:95
__crt_locale_data_public _public

Referenced by fast_check_current_locale().

◆ int()

int ( __cdecl  _isalpha_l) const

Definition at line 90 of file _ctype.cpp.

91{
93}
#define _ALPHA
Definition: ctype.h:76

Variable Documentation

◆ locale

Initial value:
{
static __forceinline int fast_check_given_locale(int const c, int const mask, _locale_t const locale)
Definition: _ctype.cpp:61

Definition at line 85 of file _ctype.cpp.