ReactOS 0.4.16-dev-905-gc1b8c4f
corecrt_wctype.h
Go to the documentation of this file.
1//
2// corecrt_wctype.h
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// This file declares the wide character (wchar_t) classification functionality,
7// shared by <ctype.h>, <wchar.h>, and <wctype.h>.
8//
9#pragma once
10
11#include <corecrt.h>
12
13#pragma warning(push)
14#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
16
18
19
20
21#define WEOF ((wint_t)(0xFFFF))
22
23
24
25// This declaration allows the user access to the ctype look-up
26// array _ctype defined in ctype.obj by simply including ctype.h
27#ifndef _CTYPE_DISABLE_MACROS
28
29 #if defined _CRT_DISABLE_PERFCRIT_LOCKS && !defined _DLL
30 #define __PCTYPE_FUNC _pctype
31 #else
32 #define __PCTYPE_FUNC __pctype_func()
33 #endif
34
35 _ACRTIMP const unsigned short* __cdecl __pctype_func(void);
37
38 #ifdef _CRT_DECLARE_GLOBAL_VARIABLES_DIRECTLY
39 extern const unsigned short* _pctype;
40 extern const wctype_t* _pwctype;
41 #else
42 #define _pctype (__pctype_func())
43 #define _pwctype (__pwctype_func())
44 #endif
45#endif
46
47// Bit masks for the possible character types
48#define _UPPER 0x01 // uppercase letter
49#define _LOWER 0x02 // lowercase letter
50#define _DIGIT 0x04 // digit[0-9]
51#define _SPACE 0x08 // tab, carriage return, newline, vertical tab, or form feed
52#define _PUNCT 0x10 // punctuation character
53#define _CONTROL 0x20 // control character
54#define _BLANK 0x40 // space char (tab is handled separately)
55#define _HEX 0x80 // hexadecimal digit
56
57#define _LEADBYTE 0x8000 // multibyte leadbyte
58#define _ALPHA (0x0100 | _UPPER | _LOWER) // alphabetic character
59
60
61
62//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
63//
64// Wide Character Classification and Conversion Functions
65//
66//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
72
73_When_(_Param_(1) == 0, _Post_equal_to_(0))
75
85
100
101
105
109
110
111#ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
114
116#endif
117
118
119
120//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
121//
122// Macro and Inline Definitions
123//
124//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
125#if !defined __cplusplus || defined _M_CEE_PURE || defined MRTDLL || defined _CORECRT_BUILD
126 #ifndef _CTYPE_DISABLE_MACROS
127
128 #define iswalpha(_c) (iswctype(_c, _ALPHA))
129 #define iswupper(_c) (iswctype(_c, _UPPER))
130 #define iswlower(_c) (iswctype(_c, _LOWER))
131 #define iswdigit(_c) (iswctype(_c, _DIGIT))
132 #define iswxdigit(_c) (iswctype(_c, _HEX))
133 #define iswspace(_c) (iswctype(_c, _SPACE))
134 #define iswpunct(_c) (iswctype(_c, _PUNCT))
135 #define iswblank(_c) (((_c) == '\t') ? _BLANK : iswctype(_c,_BLANK) )
136 #define iswalnum(_c) (iswctype(_c, _ALPHA | _DIGIT))
137 #define iswprint(_c) (iswctype(_c, _BLANK | _PUNCT | _ALPHA | _DIGIT))
138 #define iswgraph(_c) (iswctype(_c, _PUNCT | _ALPHA | _DIGIT))
139 #define iswcntrl(_c) (iswctype(_c, _CONTROL))
140 #define iswascii(_c) ((unsigned)(_c) < 0x80)
141
142 #define _iswalpha_l(_c,_p) (iswctype(_c, _ALPHA))
143 #define _iswupper_l(_c,_p) (iswctype(_c, _UPPER))
144 #define _iswlower_l(_c,_p) (iswctype(_c, _LOWER))
145 #define _iswdigit_l(_c,_p) (iswctype(_c, _DIGIT))
146 #define _iswxdigit_l(_c,_p) (iswctype(_c, _HEX))
147 #define _iswspace_l(_c,_p) (iswctype(_c, _SPACE))
148 #define _iswpunct_l(_c,_p) (iswctype(_c, _PUNCT))
149 #define _iswblank_l(_c,_p) (iswctype(_c, _BLANK))
150 #define _iswalnum_l(_c,_p) (iswctype(_c, _ALPHA | _DIGIT))
151 #define _iswprint_l(_c,_p) (iswctype(_c, _BLANK | _PUNCT | _ALPHA | _DIGIT))
152 #define _iswgraph_l(_c,_p) (iswctype(_c, _PUNCT | _ALPHA | _DIGIT))
153 #define _iswcntrl_l(_c,_p) (iswctype(_c, _CONTROL))
154
155 #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
156 #define isleadbyte(_c) (__PCTYPE_FUNC[(unsigned char)(_c)] & _LEADBYTE)
157 #endif
158
159 #endif // _CTYPE_DISABLE_MACROS
160// CRT_REFACTOR TODO I've had to remove the inline function definitions because
161// they break the debugger build. These were moved here from <wctype.h> in
162// C968560. We need to figure out what is wrong.
163//#else
164// #ifndef _CTYPE_DISABLE_MACROS
165// inline int __cdecl iswalpha (_In_ wint_t _C) { return iswctype(_C, _ALPHA); }
166// inline int __cdecl iswupper (_In_ wint_t _C) { return iswctype(_C, _UPPER); }
167// inline int __cdecl iswlower (_In_ wint_t _C) { return iswctype(_C, _LOWER); }
168// inline int __cdecl iswdigit (_In_ wint_t _C) { return iswctype(_C, _DIGIT); }
169// inline int __cdecl iswxdigit(_In_ wint_t _C) { return iswctype(_C, _HEX); }
170// inline int __cdecl iswspace (_In_ wint_t _C) { return iswctype(_C, _SPACE); }
171// inline int __cdecl iswpunct (_In_ wint_t _C) { return iswctype(_C, _PUNCT); }
172// inline int __cdecl iswblank (_In_ wint_t _C) { return (((_C) == '\t') ? _BLANK : iswctype(_C,_BLANK)); }
173// inline int __cdecl iswalnum (_In_ wint_t _C) { return iswctype(_C, _ALPHA | _DIGIT); }
174// inline int __cdecl iswprint (_In_ wint_t _C) { return iswctype(_C, _BLANK | _PUNCT | _ALPHA | _DIGIT); }
175// inline int __cdecl iswgraph (_In_ wint_t _C) { return iswctype(_C, _PUNCT | _ALPHA | _DIGIT); }
176// inline int __cdecl iswcntrl (_In_ wint_t _C) { return iswctype(_C, _CONTROL); }
177// inline int __cdecl iswascii (_In_ wint_t _C) { return (unsigned)(_C) < 0x80; }
178//
179// inline int __cdecl _iswalpha_l (_In_ wint_t _C, _In_opt_ _locale_t) { return iswctype(_C, _ALPHA); }
180// inline int __cdecl _iswupper_l (_In_ wint_t _C, _In_opt_ _locale_t) { return iswctype(_C, _UPPER); }
181// inline int __cdecl _iswlower_l (_In_ wint_t _C, _In_opt_ _locale_t) { return iswctype(_C, _LOWER); }
182// inline int __cdecl _iswdigit_l (_In_ wint_t _C, _In_opt_ _locale_t) { return iswctype(_C, _DIGIT); }
183// inline int __cdecl _iswxdigit_l(_In_ wint_t _C, _In_opt_ _locale_t) { return iswctype(_C, _HEX); }
184// inline int __cdecl _iswspace_l (_In_ wint_t _C, _In_opt_ _locale_t) { return iswctype(_C, _SPACE); }
185// inline int __cdecl _iswpunct_l (_In_ wint_t _C, _In_opt_ _locale_t) { return iswctype(_C, _PUNCT); }
186// inline int __cdecl _iswblank_l (_In_ wint_t _C, _In_opt_ _locale_t) { return iswctype(_C, _BLANK); }
187// inline int __cdecl _iswalnum_l (_In_ wint_t _C, _In_opt_ _locale_t) { return iswctype(_C, _ALPHA | _DIGIT); }
188// inline int __cdecl _iswprint_l (_In_ wint_t _C, _In_opt_ _locale_t) { return iswctype(_C, _BLANK | _PUNCT | _ALPHA | _DIGIT); }
189// inline int __cdecl _iswgraph_l (_In_ wint_t _C, _In_opt_ _locale_t) { return iswctype(_C, _PUNCT | _ALPHA | _DIGIT); }
190// inline int __cdecl _iswcntrl_l (_In_ wint_t _C, _In_opt_ _locale_t) { return iswctype(_C, _CONTROL); }
191//
192// #ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP
193// inline int __cdecl isleadbyte(_In_ int _C)
194// {
195// return __pctype_func()[(unsigned char)(_C)] & _LEADBYTE;
196// }
197// #endif
198// #endif
199#endif
200
201
202
205#pragma warning(pop) // _UCRT_DISABLED_WARNINGS
int wint_t
Definition: _apple.h:38
#define __cdecl
Definition: accygwin.h:79
#define _isleadbyte_l(_C, _L)
#define iswgraph(_c)
#define _iswdigit_l(_c, _p)
#define _iswlower_l(_c, _p)
#define iswcntrl(_c)
#define iswspace(_c)
#define _iswupper_l(_c, _p)
_Check_return_ _ACRTIMP wint_t __cdecl _towlower_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale)
Definition: stubs.c:602
#define iswupper(_c)
#define _iswspace_l(_c, _p)
_Check_return_ _ACRTIMP int __cdecl iswctype(_In_ wint_t _C, _In_ wctype_t _Type)
#define _iswgraph_l(_c, _p)
#define iswdigit(_c)
_Check_return_ _ACRTIMP wint_t __cdecl _towupper_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale)
Definition: stubs.c:614
#define iswblank(_c)
#define iswalnum(_c)
#define _pctype
#define _iswblank_l(_c, _p)
#define iswlower(_c)
_ACRTIMP const wctype_t *__cdecl __pwctype_func(void)
Definition: ctype.c:569
#define _iswxdigit_l(_c, _p)
#define iswascii(_c)
#define _iswprint_l(_c, _p)
#define _iswalpha_l(_c, _p)
#define iswprint(_c)
#define _iswpunct_l(_c, _p)
_Check_return_ _ACRTIMP int __cdecl _iswctype_l(_In_ wint_t _C, _In_ wctype_t _Type, _In_opt_ _locale_t _Locale)
Definition: stubs.c:337
_ACRTIMP const unsigned short *__cdecl __pctype_func(void)
Definition: locale.c:1525
#define _pwctype
#define _iswcntrl_l(_c, _p)
#define iswxdigit(_c)
#define _iswalnum_l(_c, _p)
#define iswpunct(_c)
#define iswalpha(_c)
#define _iswcsym_l(_c, _p)
Definition: ctype.h:697
#define _iswcsymf_l(_c, _p)
Definition: ctype.h:696
#define __iswcsymf(_c)
Definition: ctype.h:692
#define __iswcsym(_c)
Definition: ctype.h:693
_CRTIMP int __cdecl is_wctype(_In_ wint_t _C, _In_ wctype_t _Type)
#define isleadbyte(_c)
Definition: wchar.h:598
#define _Check_return_
Definition: no_sal2.h:60
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _Post_equal_to_(e)
Definition: no_sal2.h:384
#define _When_(c, a)
Definition: no_sal2.h:38
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm _In_opt_ _locale_t _Locale
Definition: time.h:159
#define towlower(c)
Definition: wctype.h:97
#define towupper(c)
Definition: wctype.h:99
#define _CRT_OBSOLETE(_NewItem)
Definition: corecrt.h:549
#define _DCRTIMP
Definition: corecrt.h:154
#define _ACRTIMP
Definition: corecrt.h:138
#define _UCRT_DISABLE_CLANG_WARNINGS
Definition: corecrt.h:109
#define _UCRT_RESTORE_CLANG_WARNINGS
Definition: corecrt.h:117
unsigned short wctype_t
Definition: corecrt.h:617
#define _CRT_END_C_HEADER
Definition: vcruntime.h:42
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:40