1 /***
2 *ctype.h - character conversion macros and ctype macros
3 *
4 *           Copyright (c) Microsoft Corporation. All rights reserved.
5 *
6 *Purpose:
7 *           Defines macros for character classification/conversion.
8 *           [ANSI/System V]
9 *
10 *           [Public]
11 *
12 ****/
13
14 #if        _MSC_VER > 1000
15 #pragma once
16 #endif
17
18 #ifndef _INC_CTYPE
19 #define _INC_CTYPE
20
21 #include <crtdefs.h>
22
23 #ifdef  __cplusplus
24 extern "C" {
25 #endif
26
27 #ifndef WEOF
28 #define WEOF (wint_t)(0xFFFF)
29 #endif
30
31 #ifndef _CRT_CTYPEDATA_DEFINED
32 #define _CRT_CTYPEDATA_DEFINED
33 #ifndef _CTYPE_DISABLE_MACROS
34
35 #ifndef __PCTYPE_FUNC
36 #if defined(_CRT_DISABLE_PERFCRIT_LOCKS) && !defined(_DLL)
37 #define __PCTYPE_FUNC  _pctype
38 #else
39 #define __PCTYPE_FUNC     __pctype_func()
40 #endif  
41 #endif  /* __PCTYPE_FUNC */
42
43 _CRTIMP const unsigned short * __cdecl __pctype_func(void);
44 #if !defined(_M_CEE_PURE)
45 _CRTIMP extern const unsigned short *_pctype;
46 #else
47 #define _pctype (__pctype_func())
48 #endif /* !defined(_M_CEE_PURE) */
49 #endif  /* _CTYPE_DISABLE_MACROS */
50 #endif
51
52 #ifndef _CRT_WCTYPEDATA_DEFINED
53 #define _CRT_WCTYPEDATA_DEFINED
54 #ifndef _CTYPE_DISABLE_MACROS
55 #if !defined(_M_CEE_PURE)
56 _CRTIMP extern const unsigned short _wctype[];
57 #endif /* !defined(_M_CEE_PURE) */
58
59 _CRTIMP const wctype_t * __cdecl __pwctype_func(void);
60 #if !defined(_M_CEE_PURE)
61 _CRTIMP extern const wctype_t *_pwctype;
62 #else
63 #define _pwctype (__pwctype_func())
64 #endif /* !defined(_M_CEE_PURE) */
65 #endif  /* _CTYPE_DISABLE_MACROS */
66 #endif
67
68 #ifndef _CTYPE_DISABLE_MACROS
69 #endif  /* _CTYPE_DISABLE_MACROS */
70
71
72
73
74 /* set bit masks for the possible character types */
75
76 #define _UPPER                0x1        /* upper case letter */
77 #define _LOWER                0x2        /* lower case letter */
78 #define _DIGIT                0x4        /* digit[0-9] */
79 #define _SPACE                0x8        /* tab, carriage return, newline, */
80                                                      /* vertical tab or form feed */
81 #define _PUNCT                0x10      /* punctuation character */
82 #define _CONTROL             0x20      /* control character */
83 #define _BLANK                0x40      /* space char */
84 #define _HEX                    0x80      /* hexadecimal digit */
85
86 #define _LEADBYTE           0x8000                              /* multibyte leadbyte */
87 #define _ALPHA                (0x0100|_UPPER|_LOWER)  /* alphabetic character */
88
89
90 /* character classification function prototypes */
91
92 #ifndef _CTYPE_DEFINED
93
94 _Check_return_ _CRTIMP int __cdecl _isctype(_In_ int _C, _In_ int _Type);
95 _Check_return_ _CRTIMP int __cdecl _isctype_l(_In_ int _C, _In_ int _Type, _In_opt_ _locale_t _Locale);
96 _Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl isalpha(_In_ int _C);
97 _Check_return_ _CRTIMP int __cdecl _isalpha_l(_In_ int _C, _In_opt_ _locale_t _Locale);
98 _Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl isupper(_In_ int _C);
99 _Check_return_ _CRTIMP int __cdecl _isupper_l(_In_ int _C, _In_opt_ _locale_t _Locale);
100 _Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl islower(_In_ int _C);
101 _Check_return_ _CRTIMP int __cdecl _islower_l(_In_ int _C, _In_opt_ _locale_t _Locale);
102 _Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl isdigit(_In_ int _C);
103 _Check_return_ _CRTIMP int __cdecl _isdigit_l(_In_ int _C, _In_opt_ _locale_t _Locale);
104 _Check_return_ _CRTIMP int __cdecl isxdigit(_In_ int _C);
105 _Check_return_ _CRTIMP int __cdecl _isxdigit_l(_In_ int _C, _In_opt_ _locale_t _Locale);
106 _Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl isspace(_In_ int _C);
107 _Check_return_ _CRTIMP int __cdecl _isspace_l(_In_ int _C, _In_opt_ _locale_t _Locale);
108 _Check_return_ _CRTIMP int __cdecl ispunct(_In_ int _C);
109 _Check_return_ _CRTIMP int __cdecl _ispunct_l(_In_ int _C, _In_opt_ _locale_t _Locale);
110 _Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl isalnum(_In_ int _C);
111 _Check_return_ _CRTIMP int __cdecl _isalnum_l(_In_ int _C, _In_opt_ _locale_t _Locale);
112 _Check_return_ _CRTIMP int __cdecl isprint(_In_ int _C);
113 _Check_return_ _CRTIMP int __cdecl _isprint_l(_In_ int _C, _In_opt_ _locale_t _Locale);
114 _Check_return_ _CRTIMP int __cdecl isgraph(_In_ int _C);
115 _Check_return_ _CRTIMP int __cdecl _isgraph_l(_In_ int _C, _In_opt_ _locale_t _Locale);
116 _Check_return_ _CRTIMP int __cdecl iscntrl(_In_ int _C);
117 _Check_return_ _CRTIMP int __cdecl _iscntrl_l(_In_ int _C, _In_opt_ _locale_t _Locale);
118 _Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl toupper(_In_ int _C);
119 _Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl tolower(_In_ int _C);
120 _Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl _tolower(_In_ int _C);
121 _Check_return_ _CRTIMP int __cdecl _tolower_l(_In_ int _C, _In_opt_ _locale_t _Locale);
122 _Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl _toupper(_In_ int _C);
123 _Check_return_ _CRTIMP int __cdecl _toupper_l(_In_ int _C, _In_opt_ _locale_t _Locale);
124 _Check_return_ _CRTIMP int __cdecl __isascii(_In_ int _C);
125 _Check_return_ _CRTIMP int __cdecl __toascii(_In_ int _C);
126 _Check_return_ _CRTIMP int __cdecl __iscsymf(_In_ int _C);
127 _Check_return_ _CRTIMP int __cdecl __iscsym(_In_ int _C);
128 #define _CTYPE_DEFINED
129 #endif
130
131 #ifndef _WCTYPE_DEFINED
132
133 /* wide function prototypes, also declared in wchar.h  */
134
135 /* character classification function prototypes */
136
137 _Check_return_ _CRTIMP int __cdecl iswalpha(_In_ wint_t _C);
138 _Check_return_ _CRTIMP int __cdecl _iswalpha_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale);
139 _Check_return_ _CRTIMP int __cdecl iswupper(_In_ wint_t _C);
140 _Check_return_ _CRTIMP int __cdecl _iswupper_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale);
141 _Check_return_ _CRTIMP int __cdecl iswlower(_In_ wint_t _C);
142 _Check_return_ _CRTIMP int __cdecl _iswlower_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale);
143 _Check_return_ _CRTIMP int __cdecl iswdigit(_In_ wint_t _C);
144 _Check_return_ _CRTIMP int __cdecl _iswdigit_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale);
145 _Check_return_ _CRTIMP int __cdecl iswxdigit(_In_ wint_t _C);
146 _Check_return_ _CRTIMP int __cdecl _iswxdigit_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale);
147 _Check_return_ _CRTIMP int __cdecl iswspace(_In_ wint_t _C);
148 _Check_return_ _CRTIMP int __cdecl _iswspace_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale);
Lines 149 ... 158 are skipped.
159 _Check_return_ _CRTIMP int __cdecl iswascii(_In_ wint_t _C);
160 _Check_return_ _CRTIMP int __cdecl isleadbyte(_In_ int _C);
161 _Check_return_ _CRTIMP int __cdecl _isleadbyte_l(_In_ int _C, _In_opt_ _locale_t _Locale);
162
163 _Check_return_ _CRTIMP wint_t __cdecl towupper(_In_ wint_t _C);
164 _Check_return_ _CRTIMP wint_t __cdecl _towupper_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale);
165 _Check_return_ _CRTIMP wint_t __cdecl towlower(_In_ wint_t _C);
166 _Check_return_ _CRTIMP wint_t __cdecl _towlower_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale); 
167 _Check_return_ _CRTIMP int __cdecl iswctype(_In_ wint_t _C, _In_ wctype_t _Type);
168 _Check_return_ _CRTIMP int __cdecl _iswctype_l(_In_ wint_t _C, _In_ wctype_t _Type, _In_opt_ _locale_t _Locale);
169
170 _Check_return_ _CRTIMP int __cdecl __iswcsymf(_In_ wint_t _C);
171 _Check_return_ _CRTIMP int __cdecl _iswcsymf_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale);
172 _Check_return_ _CRTIMP int __cdecl __iswcsym(_In_ wint_t _C);
173 _Check_return_ _CRTIMP int __cdecl _iswcsym_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale);
174
175 _CRT_OBSOLETE(iswctype) _CRTIMP int __cdecl is_wctype(_In_ wint_t _C, _In_ wctype_t _Type);
176
177 #define _WCTYPE_DEFINED
178 #endif
179
180 /* the character classification macro definitions */
181
182 #ifndef _CTYPE_DISABLE_MACROS
183
184 /*
185  * Maximum number of bytes in multi-byte character in the current locale
186  * (also defined in stdlib.h).
187  */
188 #ifndef MB_CUR_MAX
189
190 #if defined(_CRT_DISABLE_PERFCRIT_LOCKS) && !defined(_DLL)
191 #define MB_CUR_MAX __mb_cur_max
192 #else
193 #define MB_CUR_MAX ___mb_cur_max_func()
194 #endif
195 #if !defined(_M_CEE_PURE)
196 /* No data exports in pure code */
197 _CRTIMP extern int __mb_cur_max;
198 #else
199 #define __mb_cur_max (___mb_cur_max_func())
200 #endif /* !defined(_M_CEE_PURE) */
201 _CRTIMP int __cdecl ___mb_cur_max_func(void);
202 _CRTIMP int __cdecl ___mb_cur_max_l_func(_locale_t);
203 #endif  /* MB_CUR_MAX */
204
205 /* Introduced to detect error when character testing functions are called
206  * with illegal input of integer.
207  */
208 #ifdef _DEBUG
209 _CRTIMP int __cdecl _chvalidator(_In_ int _Ch, _In_ int _Mask);
210 #define __chvalidchk(a,b)           _chvalidator(a,b)
211 #else
212 #define __chvalidchk(a,b)           (__PCTYPE_FUNC[(a)] & (b))
213 #endif
214
215
216
217 #if defined(_CRT_DISABLE_PERFCRIT_LOCKS) && !defined(_DLL)
218 #ifndef __cplusplus
219 #define isalpha(_c)        (MB_CUR_MAX > 1 ? _isctype(_c,_ALPHA) : __chvalidchk(_c, _ALPHA))
220 #define isupper(_c)        (MB_CUR_MAX > 1 ? _isctype(_c,_UPPER) : __chvalidchk(_c, _UPPER))
221 #define islower(_c)        (MB_CUR_MAX > 1 ? _isctype(_c,_LOWER) : __chvalidchk(_c, _LOWER))
222 #define isdigit(_c)        (MB_CUR_MAX > 1 ? _isctype(_c,_DIGIT) : __chvalidchk(_c, _DIGIT))
223 #define isxdigit(_c)      (MB_CUR_MAX > 1 ? _isctype(_c,_HEX)     : __chvalidchk(_c, _HEX))
224 #define isspace(_c)        (MB_CUR_MAX > 1 ? _isctype(_c,_SPACE) : __chvalidchk(_c, _SPACE))
225 #define ispunct(_c)        (MB_CUR_MAX > 1 ? _isctype(_c,_PUNCT) : __chvalidchk(_c, _PUNCT))
226 #define isalnum(_c)        (MB_CUR_MAX > 1 ? _isctype(_c,_ALPHA|_DIGIT) : __chvalidchk(_c, (_ALPHA|_DIGIT)))
227 #define isprint(_c)        (MB_CUR_MAX > 1 ? _isctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT) : __chvalidchk(_c, (_BLANK|_PUNCT|_ALPHA|_DIGIT)))
228 #define isgraph(_c)        (MB_CUR_MAX > 1 ? _isctype(_c,_PUNCT|_ALPHA|_DIGIT) : __chvalidchk(_c, (_PUNCT|_ALPHA|_DIGIT)))
229 #define iscntrl(_c)        (MB_CUR_MAX > 1 ? _isctype(_c,_CONTROL) : __chvalidchk(_c, _CONTROL))
230 #elif     0               /* Pending ANSI C++ integration */
231 _Check_return_ inline int isalpha(_In_ int _C)
232              {return (MB_CUR_MAX > 1 ? _isctype(_C,_ALPHA) : __chvalidchk(_C, _ALPHA)); }
233 _Check_return_ inline int isupper(_In_ int _C)
234              {return (MB_CUR_MAX > 1 ? _isctype(_C,_UPPER) : __chvalidchk(_C, _UPPER)); }
235 _Check_return_ inline int islower(_In_ int _C)
236              {return (MB_CUR_MAX > 1 ? _isctype(_C,_LOWER) : __chvalidchk(_C, _LOWER)); }
237 _Check_return_ inline int isdigit(_In_ int _C)
238              {return (MB_CUR_MAX > 1 ? _isctype(_C,_DIGIT) : __chvalidchk(_C, _DIGIT)); }
239 _Check_return_ inline int isxdigit(_In_ int _C)
240              {return (MB_CUR_MAX > 1 ? _isctype(_C,_HEX)     : __chvalidchk(_C, _HEX)); }
241 _Check_return_ inline int isspace(_In_ int _C)
242              {return (MB_CUR_MAX > 1 ? _isctype(_C,_SPACE) : __chvalidchk(_C, _SPACE)); }
243 _Check_return_ inline int ispunct(_In_ int _C)
244              {return (MB_CUR_MAX > 1 ? _isctype(_C,_PUNCT) : __chvalidchk(_C, _PUNCT)); }
245 _Check_return_ inline int isalnum(_In_ int _C)
246              {return (MB_CUR_MAX > 1 ? _isctype(_C,_ALPHA|_DIGIT)
247                           : __chvalidchk(_C) , (_ALPHA|_DIGIT)); }
248 _Check_return_ inline int isprint(_In_ int _C)
249              {return (MB_CUR_MAX > 1 ? _isctype(_C,_BLANK|_PUNCT|_ALPHA|_DIGIT)
250                           : __chvalidchk(_C , (_BLANK|_PUNCT|_ALPHA|_DIGIT))); }
251 _Check_return_ inline int isgraph(_In_ int _C)
252              {return (MB_CUR_MAX > 1 ? _isctype(_C,_PUNCT|_ALPHA|_DIGIT)
253                           : __chvalidchk(_C , (_PUNCT|_ALPHA|_DIGIT))); }
254 _Check_return_ inline int iscntrl(_In_ int _C)
255              {return (MB_CUR_MAX > 1 ? _isctype(_C,_CONTROL)
256                           : __chvalidchk(_C , _CONTROL)); }
257 #endif  /* __cplusplus */
258 #endif  /* _MT */
259
260 #ifdef _DEBUG
261 _CRTIMP int __cdecl _chvalidator_l(_In_opt_ _locale_t, _In_ int _Ch, _In_ int _Mask);
262 #define _chvalidchk_l(_Char, _Flag, _Locale)  _chvalidator_l(_Locale, _Char, _Flag)
263 #else
264 #define _chvalidchk_l(_Char, _Flag, _Locale)  (_Locale==NULL ? __chvalidchk(_Char, _Flag) : ((_locale_t)_Locale)->locinfo->pctype[_Char] & (_Flag))
265 #endif  /* DEBUG */
266
267
268 #define _ischartype_l(_Char, _Flag, _Locale)      ( ((_Locale)!=NULL && (((_locale_t)(_Locale))->locinfo->mb_cur_max) > 1) ? _isctype_l(_Char, (_Flag), _Locale) : _chvalidchk_l(_Char,_Flag,_Locale))
269 #define _isalpha_l(_Char, _Locale)          _ischartype_l(_Char, _ALPHA, _Locale)
270 #define _isupper_l(_Char, _Locale)          _ischartype_l(_Char, _UPPER, _Locale)
271 #define _islower_l(_Char, _Locale)          _ischartype_l(_Char, _LOWER, _Locale)
272 #define _isdigit_l(_Char, _Locale)          _ischartype_l(_Char, _DIGIT, _Locale)
273 #define _isxdigit_l(_Char, _Locale)        _ischartype_l(_Char, _HEX, _Locale)
274 #define _isspace_l(_Char, _Locale)          _ischartype_l(_Char, _SPACE, _Locale)
275 #define _ispunct_l(_Char, _Locale)          _ischartype_l(_Char, _PUNCT, _Locale)
276 #define _isalnum_l(_Char, _Locale)          _ischartype_l(_Char, _ALPHA|_DIGIT, _Locale)
277 #define _isprint_l(_Char, _Locale)          _ischartype_l(_Char, _BLANK|_PUNCT|_ALPHA|_DIGIT, _Locale)
278 #define _isgraph_l(_Char, _Locale)          _ischartype_l(_Char, _PUNCT|_ALPHA|_DIGIT, _Locale)
279 #define _iscntrl_l(_Char, _Locale)          _ischartype_l(_Char, _CONTROL, _Locale)
280
281 #define _tolower(_Char)      ( (_Char)-'A'+'a' )
282 #define _toupper(_Char)      ( (_Char)-'a'+'A' )
283
284 #define __isascii(_Char)     ( (unsigned)(_Char) < 0x80 )
285 #define __toascii(_Char)     ( (_Char) & 0x7f )
286
287 #ifndef _WCTYPE_INLINE_DEFINED
288
289 #undef _CRT_WCTYPE_NOINLINE
290
291 #if !defined(__cplusplus) || defined(_M_CEE_PURE) || defined(MRTDLL) || defined(_CRT_WCTYPE_NOINLINE)
292 #define iswalpha(_c)      ( iswctype(_c,_ALPHA) )
293 #define iswupper(_c)      ( iswctype(_c,_UPPER) )
294 #define iswlower(_c)      ( iswctype(_c,_LOWER) )
295 #define iswdigit(_c)      ( iswctype(_c,_DIGIT) )
296 #define iswxdigit(_c)     ( iswctype(_c,_HEX) )
297 #define iswspace(_c)      ( iswctype(_c,_SPACE) )
298 #define iswpunct(_c)      ( iswctype(_c,_PUNCT) )
299 #define iswalnum(_c)      ( iswctype(_c,_ALPHA|_DIGIT) )
300 #define iswprint(_c)      ( iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT) )
301 #define iswgraph(_c)      ( iswctype(_c,_PUNCT|_ALPHA|_DIGIT) )
302 #define iswcntrl(_c)      ( iswctype(_c,_CONTROL) )
303 #define iswascii(_c)      ( (unsigned)(_c) < 0x80 )
304
305 #define _iswalpha_l(_c,_p)      ( _iswctype_l(_c,_ALPHA, _p) )
306 #define _iswupper_l(_c,_p)      ( _iswctype_l(_c,_UPPER, _p) )
307 #define _iswlower_l(_c,_p)      ( _iswctype_l(_c,_LOWER, _p) )
308 #define _iswdigit_l(_c,_p)      ( _iswctype_l(_c,_DIGIT, _p) )
309 #define _iswxdigit_l(_c,_p)     ( _iswctype_l(_c,_HEX, _p) )
310 #define _iswspace_l(_c,_p)      ( _iswctype_l(_c,_SPACE, _p) )
311 #define _iswpunct_l(_c,_p)      ( _iswctype_l(_c,_PUNCT, _p) )
312 #define _iswalnum_l(_c,_p)      ( _iswctype_l(_c,_ALPHA|_DIGIT, _p) )
313 #define _iswprint_l(_c,_p)      ( _iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT, _p) )
314 #define _iswgraph_l(_c,_p)      ( _iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT, _p) )
315 #define _iswcntrl_l(_c,_p)      ( _iswctype_l(_c,_CONTROL, _p) )
316 #elif     0               /* __cplusplus */
317 _Check_return_ inline int iswalpha(_In_ wint_t _C) {return (iswctype(_C,_ALPHA)); }
318 _Check_return_ inline int iswupper(_In_ wint_t _C) {return (iswctype(_C,_UPPER)); }
319 _Check_return_ inline int iswlower(_In_ wint_t _C) {return (iswctype(_C,_LOWER)); }
320 _Check_return_ inline int iswdigit(_In_ wint_t _C) {return (iswctype(_C,_DIGIT)); }
321 _Check_return_ inline int iswxdigit(_In_ wint_t _C) {return (iswctype(_C,_HEX)); }
322 _Check_return_ inline int iswspace(_In_ wint_t _C) {return (iswctype(_C,_SPACE)); }
323 _Check_return_ inline int iswpunct(_In_ wint_t _C) {return (iswctype(_C,_PUNCT)); }
324 _Check_return_ inline int iswalnum(_In_ wint_t _C) {return (iswctype(_C,_ALPHA|_DIGIT)); }
325 _Check_return_ inline int iswprint(_In_ wint_t _C) {return (iswctype(_C,_BLANK|_PUNCT|_ALPHA|_DIGIT)); }
326 _Check_return_ inline int iswgraph(_In_ wint_t _C) {return (iswctype(_C,_PUNCT|_ALPHA|_DIGIT)); }
327 _Check_return_ inline int iswcntrl(_In_ wint_t _C) {return (iswctype(_C,_CONTROL)); }
328 _Check_return_ inline int iswascii(_In_ wint_t _C) {return ((unsigned)(_C) < 0x80); }
329
330 _Check_return_ inline int __CRTDECL _iswalpha_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale) {return (_iswctype_l(_C,_ALPHA, _Locale)); }
331 _Check_return_ inline int __CRTDECL _iswupper_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale) {return (_iswctype_l(_C,_UPPER, _Locale)); }
332 _Check_return_ inline int __CRTDECL _iswlower_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale) {return (_iswctype_l(_C,_LOWER, _Locale)); }
333 _Check_return_ inline int __CRTDECL _iswdigit_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale) {return (_iswctype_l(_C,_DIGIT, _Locale)); }
334 _Check_return_ inline int __CRTDECL _iswxdigit_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale) {return(_iswctype_l(_C,_HEX, _Locale)); }
335 _Check_return_ inline int __CRTDECL _iswspace_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale) {return (_iswctype_l(_C,_SPACE, _Locale)); }
336 _Check_return_ inline int __CRTDECL _iswpunct_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale) {return (_iswctype_l(_C,_PUNCT, _Locale)); }
337 _Check_return_ inline int __CRTDECL _iswalnum_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale) {return (_iswctype_l(_C,_ALPHA|_DIGIT, _Locale)); }
338 _Check_return_ inline int __CRTDECL _iswprint_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale) {return (_iswctype_l(_C,_BLANK|_PUNCT|_ALPHA|_DIGIT, _Locale)); }
339 _Check_return_ inline int __CRTDECL _iswgraph_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale) {return (_iswctype_l(_C,_PUNCT|_ALPHA|_DIGIT, _Locale)); }
340 _Check_return_ inline int __CRTDECL _iswcntrl_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale) {return (_iswctype_l(_C,_CONTROL, _Locale)); }
341
342 _Check_return_ inline int isleadbyte(int _C) {return (__PCTYPE_FUNC[(unsigned char)(_C)] & _LEADBYTE); }
343 #endif  /* __cplusplus */
344 #define _WCTYPE_INLINE_DEFINED
345 #endif  /* _WCTYPE_INLINE_DEFINED */
346
347 /* MS C version 2.0 extended ctype macros */
348
349 #define __iscsymf(_c)     (isalpha(_c) || ((_c) == '_'))
350 #define __iscsym(_c)      (isalnum(_c) || ((_c) == '_'))
351 #define __iswcsymf(_c)  (iswalpha(_c) || ((_c) == '_'))
352 #define __iswcsym(_c)     (iswalnum(_c) || ((_c) == '_'))
353
354 #define _iscsymf_l(_c, _p)     (_isalpha_l(_c, _p) || ((_c) == '_'))
355 #define _iscsym_l(_c, _p)      (_isalnum_l(_c, _p) || ((_c) == '_'))
356 #define _iswcsymf_l(_c, _p)  (_iswalpha_l(_c, _p) || ((_c) == '_'))
357 #define _iswcsym_l(_c, _p)     (_iswalnum_l(_c, _p) || ((_c) == '_'))
358
359 #endif  /* _CTYPE_DISABLE_MACROS */
360
361
362 #if        !__STDC__
363
364 /* Non-ANSI names for compatibility */
365
366 #ifndef _CTYPE_DEFINED
367 _Check_return_ _CRT_NONSTDC_DEPRECATE(__isascii) _CRTIMP int __cdecl isascii(_In_ int _C);
368 _Check_return_ _CRT_NONSTDC_DEPRECATE(__toascii) _CRTIMP int __cdecl toascii(_In_ int _C);
369 _Check_return_ _CRT_NONSTDC_DEPRECATE(__iscsymf) _CRTIMP int __cdecl iscsymf(_In_ int _C);
370 _Check_return_ _CRT_NONSTDC_DEPRECATE(__iscsym) _CRTIMP int __cdecl iscsym(_In_ int _C);
371 #else
372 #define isascii __isascii
373 #define toascii __toascii
374 #define iscsymf __iscsymf
375 #define iscsym  __iscsym
376 #endif
377
378 #endif  /* __STDC__ */
379
380 #ifdef  __cplusplus
381 }
382 #endif
383
384 #endif  /* _INC_CTYPE */
385