ReactOS 0.4.15-dev-7788-g1ad9096
ctype.h
Go to the documentation of this file.
1
6#ifndef _INC_CTYPE
7#define _INC_CTYPE
8
9#include <crtdefs.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#ifndef WEOF
16#define WEOF (wint_t)(0xFFFF)
17#endif
18
19#ifndef _CRT_CTYPEDATA_DEFINED
20# define _CRT_CTYPEDATA_DEFINED
21# ifndef _CTYPE_DISABLE_MACROS
22# ifndef __PCTYPE_FUNC
23# ifdef _DLL
24# define __PCTYPE_FUNC __pctype_func()
25# else
26# define __PCTYPE_FUNC _pctype
27# endif
28# endif /* !__PCTYPE_FUNC */
29 _CRTIMP const unsigned short * __cdecl __pctype_func(void);
30# ifndef _M_CEE_PURE
31 _CRTDATA(extern const unsigned short *_pctype);
32# else
33# define _pctype (__pctype_func())
34# endif /* !_M_CEE_PURE */
35# endif /* !_CTYPE_DISABLE_MACROS */
36#endif /* !_CRT_CTYPEDATA_DEFINED */
37
38#ifndef _CRT_WCTYPEDATA_DEFINED
39#define _CRT_WCTYPEDATA_DEFINED
40# ifndef _CTYPE_DISABLE_MACROS
41 _CRTDATA(extern const unsigned short _wctype[]);
43# ifndef _M_CEE_PURE
44 _CRTDATA(extern const wctype_t *_pwctype);
45# else
46# define _pwctype (__pwctype_func())
47# endif /* !_M_CEE_PURE */
48# endif /* !_CTYPE_DISABLE_MACROS */
49#endif /* !_CRT_WCTYPEDATA_DEFINED */
50
51 /* CRT stuff */
52#if 1
53 extern const unsigned char __newclmap[];
54 extern const unsigned char __newcumap[];
57 extern int __globallocalestatus;
58 extern int __locale_changed;
63#endif
64
65#define _UPPER 0x1
66#define _LOWER 0x2
67#define _DIGIT 0x4
68#define _SPACE 0x8
69
70#define _PUNCT 0x10
71#define _CONTROL 0x20
72#define _BLANK 0x40
73#define _HEX 0x80
74
75#define _LEADBYTE 0x8000
76#define _ALPHA (0x0100|_UPPER|_LOWER)
77
78#ifndef _CTYPE_DEFINED
79#define _CTYPE_DEFINED
80
83 int
86 _In_ int _C,
87 _In_ int _Type);
88
91 int
94 _In_ int _C,
95 _In_ int _Type,
97
100 int
101 __cdecl
103 _In_ int _C);
104
106 _CRTIMP
107 int
108 __cdecl
110 _In_ int _C,
112
114 _CRTIMP
115 int
116 __cdecl
118 _In_ int _C);
119
121 _CRTIMP
122 int
123 __cdecl
125 _In_ int _C,
127
129 _CRTIMP
130 int
131 __cdecl
133 _In_ int _C);
134
136 _CRTIMP
137 int
138 __cdecl
140 _In_ int _C,
142
144 _CRTIMP
145 int
146 __cdecl
148 _In_ int _C);
149
151 _CRTIMP
152 int
153 __cdecl
155 _In_ int _C,
157
159 _CRTIMP
160 int
161 __cdecl
163 _In_ int _C);
164
166 _CRTIMP
167 int
168 __cdecl
170 _In_ int _C,
172
174 _CRTIMP
175 int
176 __cdecl
178 _In_ int _C);
179
181 _CRTIMP
182 int
183 __cdecl
185 _In_ int _C,
187
189 _CRTIMP
190 int
191 __cdecl
193 _In_ int _C);
194
196 _CRTIMP
197 int
198 __cdecl
200 _In_ int _C,
202
204 _CRTIMP
205 int
206 __cdecl
208 _In_ int _C);
209
211 _CRTIMP
212 int
213 __cdecl
215 _In_ int _C,
217
219 _CRTIMP
220 int
221 __cdecl
223 _In_ int _C);
224
226 _CRTIMP
227 int
228 __cdecl
230 _In_ int _C,
232
234 _CRTIMP
235 int
236 __cdecl
238 _In_ int _C);
239
241 _CRTIMP
242 int
243 __cdecl
245 _In_ int _C,
247
249 _CRTIMP
250 int
251 __cdecl
253 _In_ int _C);
254
256 _CRTIMP
257 int
258 __cdecl
260 _In_ int _C,
262
264 _CRTIMP
265 int
266 __cdecl
268 _In_ int _C);
269
271 _CRTIMP
272 int
273 __cdecl
275 _In_ int _C);
276
278 _CRTIMP
279 int
280 __cdecl
282 _In_ int _C);
283
285 _CRTIMP
286 int
287 __cdecl
289 _In_ int _C,
291
293 _CRTIMP
294 int
295 __cdecl
297 _In_ int _C);
298
300 _CRTIMP
301 int
302 __cdecl
304 _In_ int _C,
306
308 _CRTIMP
309 int
310 __cdecl
312 _In_ int _C);
313
315 _CRTIMP
316 int
317 __cdecl
319 _In_ int _C);
320
322 _CRTIMP
323 int
324 __cdecl
326 _In_ int _C);
327
329 _CRTIMP
330 int
331 __cdecl
333 _In_ int _C);
334
335#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES)
336 int __cdecl isblank(int _C);
337#endif
338
339#endif /* !_CTYPE_DEFINED */
340
341#ifndef _WCTYPE_DEFINED
342#define _WCTYPE_DEFINED
343
345 _CRTIMP
346 int
347 __cdecl
349 _In_ wint_t _C);
350
352 _CRTIMP
353 int
354 __cdecl
356 _In_ wint_t _C,
358
360 _CRTIMP
361 int
362 __cdecl
364 _In_ wint_t _C);
365
367 _CRTIMP
368 int
369 __cdecl
371 _In_ wint_t _C,
373
375 _CRTIMP
376 int
377 __cdecl
379 _In_ wint_t _C);
380
382 _CRTIMP
383 int
384 __cdecl
386 _In_ wint_t _C,
388
390 _CRTIMP
391 int
392 __cdecl
394 _In_ wint_t _C);
395
397 _CRTIMP
398 int
399 __cdecl
401 _In_ wint_t _C,
403
405 _CRTIMP
406 int
407 __cdecl
409 _In_ wint_t _C);
410
412 _CRTIMP
413 int
414 __cdecl
416 _In_ wint_t _C,
418
420 _CRTIMP
421 int
422 __cdecl
424 _In_ wint_t _C);
425
427 _CRTIMP
428 int
429 __cdecl
431 _In_ wint_t _C,
433
435 _CRTIMP
436 int
437 __cdecl
439 _In_ wint_t _C);
440
442 _CRTIMP
443 int
444 __cdecl
446 _In_ wint_t _C,
448
450 _CRTIMP
451 int
452 __cdecl
454 _In_ wint_t _C);
455
457 _CRTIMP
458 int
459 __cdecl
461 _In_ wint_t _C,
463
465 _CRTIMP
466 int
467 __cdecl
469 _In_ wint_t _C);
470
472 _CRTIMP
473 int
474 __cdecl
476 _In_ wint_t _C,
478
480 _CRTIMP
481 int
482 __cdecl
484 _In_ wint_t _C);
485
487 _CRTIMP
488 int
489 __cdecl
491 _In_ wint_t _C,
493
495 _CRTIMP
496 int
497 __cdecl
499 _In_ wint_t _C);
500
502 _CRTIMP
503 int
504 __cdecl
506 _In_ wint_t _C,
508
510 _CRTIMP
511 int
512 __cdecl
514 _In_ wint_t _C);
515
517 _CRTIMP
518 int
519 __cdecl
521 _In_ int _C);
522
524 _CRTIMP
525 int
526 __cdecl
528 _In_ int _C,
530
532 _CRTIMP
533 wint_t
534 __cdecl
536 _In_ wint_t _C);
537
539 _CRTIMP
540 wint_t
541 __cdecl
543 _In_ wint_t _C,
545
547 _CRTIMP
548 wint_t
549 __cdecl
551 _In_ wint_t _C);
552
554 _CRTIMP
555 wint_t
556 __cdecl
558 _In_ wint_t _C,
560
562 _CRTIMP
563 int
564 __cdecl
566 _In_ wint_t _C,
567 _In_ wctype_t _Type);
568
570 _CRTIMP
571 int
572 __cdecl
574 _In_ wint_t _C,
575 _In_ wctype_t _Type,
577
579 _CRTIMP
580 int
581 __cdecl
583 _In_ wint_t _C);
584
586 _CRTIMP
587 int
588 __cdecl
590 _In_ wint_t _C,
592
594 _CRTIMP
595 int
596 __cdecl
598 _In_ wint_t _C);
599
601 _CRTIMP
602 int
603 __cdecl
605 _In_ wint_t _C,
607
608 _CRTIMP
609 int
610 __cdecl
612 _In_ wint_t _C,
613 _In_ wctype_t _Type);
614
615#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES)
616 int __cdecl iswblank(wint_t _C);
617#endif
618
619#endif /* _WCTYPE_DEFINED */
620
621#ifndef _CTYPE_DISABLE_MACROS
622
623#ifndef MB_CUR_MAX
624#define MB_CUR_MAX ___mb_cur_max_func()
625#ifndef __mb_cur_max
626#ifdef _MSVCRT_
627 extern int __mb_cur_max;
628#else
629#define __mb_cur_max (*_imp____mb_cur_max)
630 extern int *_imp____mb_cur_max;
631#endif
632#endif
633#ifdef _MSVCRT_
634#define ___mb_cur_max_func() (__mb_cur_max)
635#else
636#define ___mb_cur_max_func() (*_imp____mb_cur_max)
637#endif
638#endif
639
640#define __chvalidchk(a,b) (__PCTYPE_FUNC[(a)] & (b))
641#define _chvalidchk_l(_Char,_Flag,_Locale) (!_Locale ? __chvalidchk(_Char,_Flag) : ((_locale_t)_Locale)->locinfo->pctype[_Char] & (_Flag))
642#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))
643#define _isalpha_l(_Char,_Locale) _ischartype_l(_Char,_ALPHA,_Locale)
644#define _isupper_l(_Char,_Locale) _ischartype_l(_Char,_UPPER,_Locale)
645#define _islower_l(_Char,_Locale) _ischartype_l(_Char,_LOWER,_Locale)
646#define _isdigit_l(_Char,_Locale) _ischartype_l(_Char,_DIGIT,_Locale)
647#define _isxdigit_l(_Char,_Locale) _ischartype_l(_Char,_HEX,_Locale)
648#define _isspace_l(_Char,_Locale) _ischartype_l(_Char,_SPACE,_Locale)
649#define _ispunct_l(_Char,_Locale) _ischartype_l(_Char,_PUNCT,_Locale)
650#define _isalnum_l(_Char,_Locale) _ischartype_l(_Char,_ALPHA|_DIGIT,_Locale)
651#define _isprint_l(_Char,_Locale) _ischartype_l(_Char,_BLANK|_PUNCT|_ALPHA|_DIGIT,_Locale)
652#define _isgraph_l(_Char,_Locale) _ischartype_l(_Char,_PUNCT|_ALPHA|_DIGIT,_Locale)
653#define _iscntrl_l(_Char,_Locale) _ischartype_l(_Char,_CONTROL,_Locale)
654#define _tolower(_Char) ((_Char)-'A'+'a')
655#define _toupper(_Char) ((_Char)-'a'+'A')
656#define __isascii(_Char) ((unsigned)(_Char) < 0x80)
657#define __toascii(_Char) ((_Char) & 0x7f)
658
659#ifndef _WCTYPE_INLINE_DEFINED
660#define _WCTYPE_INLINE_DEFINED
661
662#undef _CRT_WCTYPE_NOINLINE
663#ifndef __cplusplus
664#define iswalpha(_c) (iswctype(_c,_ALPHA))
665#define iswupper(_c) (iswctype(_c,_UPPER))
666#define iswlower(_c) (iswctype(_c,_LOWER))
667#define iswdigit(_c) (iswctype(_c,_DIGIT))
668#define iswxdigit(_c) (iswctype(_c,_HEX))
669#define iswspace(_c) (iswctype(_c,_SPACE))
670#define iswpunct(_c) (iswctype(_c,_PUNCT))
671#define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT))
672#define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT))
673#define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT))
674#define iswcntrl(_c) (iswctype(_c,_CONTROL))
675#define iswascii(_c) ((unsigned)(_c) < 0x80)
676#define _iswalpha_l(_c,_p) (_iswctype_l(_c,_ALPHA,_p))
677#define _iswupper_l(_c,_p) (_iswctype_l(_c,_UPPER,_p))
678#define _iswlower_l(_c,_p) (_iswctype_l(_c,_LOWER,_p))
679#define _iswdigit_l(_c,_p) (_iswctype_l(_c,_DIGIT,_p))
680#define _iswxdigit_l(_c,_p) (_iswctype_l(_c,_HEX,_p))
681#define _iswspace_l(_c,_p) (_iswctype_l(_c,_SPACE,_p))
682#define _iswpunct_l(_c,_p) (_iswctype_l(_c,_PUNCT,_p))
683#define _iswalnum_l(_c,_p) (_iswctype_l(_c,_ALPHA|_DIGIT,_p))
684#define _iswprint_l(_c,_p) (_iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT,_p))
685#define _iswgraph_l(_c,_p) (_iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT,_p))
686#define _iswcntrl_l(_c,_p) (_iswctype_l(_c,_CONTROL,_p))
687#endif
688#endif
689
690#define __iscsymf(_c) (isalpha(_c) || ((_c)=='_'))
691#define __iscsym(_c) (isalnum(_c) || ((_c)=='_'))
692#define __iswcsymf(_c) (iswalpha(_c) || ((_c)=='_'))
693#define __iswcsym(_c) (iswalnum(_c) || ((_c)=='_'))
694#define _iscsymf_l(_c,_p) (_isalpha_l(_c,_p) || ((_c)=='_'))
695#define _iscsym_l(_c,_p) (_isalnum_l(_c,_p) || ((_c)=='_'))
696#define _iswcsymf_l(_c,_p) (_iswalpha_l(_c,_p) || ((_c)=='_'))
697#define _iswcsym_l(_c,_p) (_iswalnum_l(_c,_p) || ((_c)=='_'))
698#endif
699
700#ifndef NO_OLDNAMES
701
702#ifndef _CTYPE_DEFINED
703
705 _CRTIMP
707 _CRTIMP
708 int
709 __cdecl
710 isascii(
711 _In_ int _C);
712
714 _CRTIMP
716 _CRTIMP
717 int
718 __cdecl
719 toascii(
720 _In_ int _C);
721
723 _CRTIMP
725 _CRTIMP
726 int
727 __cdecl
728 iscsymf(
729 _In_ int _C);
730
732 _CRTIMP
734 _CRTIMP
735 int
736 __cdecl
737 iscsym(
738 _In_ int _C);
739
740#else /* _CTYPE_DEFINED */
741
742#define isascii __isascii
743#define toascii __toascii
744#define iscsymf __iscsymf
745#define iscsym __iscsym
746
747#endif /* _CTYPE_DEFINED */
748
749#endif /* NO_OLDNAMES */
750
751#ifdef __cplusplus
752}
753#endif
754
755#endif /* !_INC_CTYPE */
int wint_t
Definition: _apple.h:38
#define isspace(c)
Definition: acclib.h:69
#define islower(c)
Definition: acclib.h:72
#define isalpha(c)
Definition: acclib.h:74
#define isdigit(c)
Definition: acclib.h:68
#define isprint(c)
Definition: acclib.h:73
#define isxdigit(c)
Definition: acclib.h:70
#define isupper(c)
Definition: acclib.h:71
#define __cdecl
Definition: accygwin.h:79
struct threadmbcinfostruct * pthreadmbcinfo
Definition: crtdefs.h:399
unsigned short wctype_t
Definition: crtdefs.h:352
#define _CRTIMP
Definition: crtdefs.h:72
#define _CRT_NONSTDC_DEPRECATE(_Replacement)
Definition: crtdefs.h:231
#define _CRTDATA(x)
Definition: crtdefs.h:95
int __cdecl iswctype(wint_t wc, wctype_t wctypeFlags)
Definition: freeldr.c:99
#define __iscsym(_c)
Definition: ctype.h:691
#define _iswcsym_l(_c, _p)
Definition: ctype.h:697
#define _islower_l(_Char, _Locale)
Definition: ctype.h:645
#define _isspace_l(_Char, _Locale)
Definition: ctype.h:648
#define iswgraph(_c)
Definition: ctype.h:673
#define isascii
Definition: ctype.h:742
#define toascii
Definition: ctype.h:743
_Check_return_ _CRTIMP int __cdecl _isctype_l(_In_ int _C, _In_ int _Type, _In_opt_ _locale_t _Locale)
#define _tolower(_Char)
Definition: ctype.h:654
_Check_return_ _CRTIMP int __cdecl _tolower_l(_In_ int _C, _In_opt_ _locale_t _Locale)
Definition: stubs.c:697
#define iscsymf
Definition: ctype.h:744
#define _iswdigit_l(_c, _p)
Definition: ctype.h:679
#define _iswlower_l(_c, _p)
Definition: ctype.h:678
_Check_return_ _CRTIMP int __cdecl _isctype(_In_ int _C, _In_ int _Type)
#define __isascii(_Char)
Definition: ctype.h:656
#define _isprint_l(_Char, _Locale)
Definition: ctype.h:651
#define iswcntrl(_c)
Definition: ctype.h:674
#define iswspace(_c)
Definition: ctype.h:669
_locale_tstruct __initiallocalestructinfo
_Check_return_ _CRTIMP wint_t __cdecl _towlower_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale)
Definition: stubs.c:602
#define _iswupper_l(_c, _p)
Definition: ctype.h:677
int * _imp____mb_cur_max
const unsigned char __newcumap[]
_Check_return_ _CRTIMP int __cdecl ispunct(_In_ int _C)
#define _isalnum_l(_Char, _Locale)
Definition: ctype.h:650
_CRTIMP const wctype_t *__cdecl __pwctype_func(void)
Definition: ctype.c:569
#define iswupper(_c)
Definition: ctype.h:665
_Check_return_ _CRTIMP int __cdecl _toupper_l(_In_ int _C, _In_opt_ _locale_t _Locale)
Definition: stubs.c:709
_Check_return_ _CRTIMP int __cdecl _iswctype_l(_In_ wint_t _C, _In_ wctype_t _Type, _In_opt_ _locale_t _Locale)
Definition: stubs.c:337
#define __toascii(_Char)
Definition: ctype.h:657
#define _iswcsymf_l(_c, _p)
Definition: ctype.h:696
#define _iswspace_l(_c, _p)
Definition: ctype.h:681
pthreadlocinfo __ptlocinfo
#define _iswgraph_l(_c, _p)
Definition: ctype.h:685
pthreadmbcinfo __cdecl __updatetmbcinfo(void)
#define _isalpha_l(_Char, _Locale)
Definition: ctype.h:643
_Check_return_ _CRTIMP int __cdecl isgraph(_In_ int _C)
int __locale_changed
#define iswdigit(_c)
Definition: ctype.h:667
_Check_return_ _CRTIMP int __cdecl tolower(_In_ int _C)
#define _isdigit_l(_Char, _Locale)
Definition: ctype.h:646
#define iscsym
Definition: ctype.h:745
#define _ispunct_l(_Char, _Locale)
Definition: ctype.h:649
#define iswalnum(_c)
Definition: ctype.h:671
_Check_return_ _CRTIMP int __cdecl iscntrl(_In_ int _C)
#define __iswcsymf(_c)
Definition: ctype.h:692
#define iswlower(_c)
Definition: ctype.h:666
_Check_return_ _CRTIMP int __cdecl toupper(_In_ int _C)
#define __iswcsym(_c)
Definition: ctype.h:693
pthreadlocinfo __cdecl __updatetlocinfo(void)
pthreadmbcinfo __ptmbcinfo
#define _iswxdigit_l(_c, _p)
Definition: ctype.h:680
#define __mb_cur_max
Definition: ctype.h:629
#define iswascii(_c)
Definition: ctype.h:675
#define _iscntrl_l(_Char, _Locale)
Definition: ctype.h:653
#define _isgraph_l(_Char, _Locale)
Definition: ctype.h:652
int __cdecl iswblank(wint_t _C)
Definition: iswblank.c:4
const unsigned char __newclmap[]
#define _iswprint_l(_c, _p)
Definition: ctype.h:684
#define __iscsymf(_c)
Definition: ctype.h:690
#define _isupper_l(_Char, _Locale)
Definition: ctype.h:644
#define _isxdigit_l(_Char, _Locale)
Definition: ctype.h:647
#define _iswalpha_l(_c, _p)
Definition: ctype.h:676
#define iswprint(_c)
Definition: ctype.h:672
#define _iswpunct_l(_c, _p)
Definition: ctype.h:682
_Check_return_ _CRTIMP int __cdecl _isleadbyte_l(_In_ int _C, _In_opt_ _locale_t _Locale)
_CRTIMP int __cdecl is_wctype(_In_ wint_t _C, _In_ wctype_t _Type)
struct threadlocaleinfostruct __initiallocinfo
#define _toupper(_Char)
Definition: ctype.h:655
_Check_return_ _CRTIMP int __cdecl isalnum(_In_ int _C)
int __globallocalestatus
#define _iswcntrl_l(_c, _p)
Definition: ctype.h:686
#define iswxdigit(_c)
Definition: ctype.h:668
#define _iswalnum_l(_c, _p)
Definition: ctype.h:683
#define iswpunct(_c)
Definition: ctype.h:670
#define iswalpha(_c)
Definition: ctype.h:664
_Check_return_ _CRTIMP wint_t __cdecl _towupper_l(_In_ wint_t _C, _In_opt_ _locale_t _Locale)
Definition: stubs.c:614
_CRTIMP const unsigned short *__cdecl __pctype_func(void)
Definition: locale.c:1523
#define isleadbyte(_c)
Definition: wchar.h:596
#define _pctype
Definition: wctype.h:43
#define _wctype
Definition: wctype.h:58
#define _pwctype
Definition: wctype.h:67
#define _Check_return_
Definition: ms_sal.h:557
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
_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 isblank(x)
Definition: trio.c:93