|
| 1 | +/** |
| 2 | + * This file has no copyright assigned and is placed in the Public Domain. |
| 3 | + * This file is part of the mingw-w64 runtime package. |
| 4 | + * No warranty is given; refer to the file DISCLAIMER.PD within this package. |
| 5 | + */ |
| 6 | +#ifndef _INC_CORECRT_WCTYPE |
| 7 | +#define _INC_CORECRT_WCTYPE |
| 8 | + |
| 9 | +#include <corecrt.h> |
| 10 | + |
| 11 | +#ifdef __cplusplus |
| 12 | +extern "C" { |
| 13 | +#endif |
| 14 | + |
| 15 | +#ifndef _WCTYPE_T_DEFINED |
| 16 | +#define _WCTYPE_T_DEFINED |
| 17 | + typedef unsigned short wint_t; |
| 18 | + typedef unsigned short wctype_t; |
| 19 | +#endif /* _WCTYPE_T_DEFINED */ |
| 20 | + |
| 21 | +#ifndef WEOF |
| 22 | +#define WEOF (wint_t)(0xFFFF) |
| 23 | +#endif |
| 24 | + |
| 25 | +#ifndef _CRT_CTYPEDATA_DEFINED |
| 26 | +#define _CRT_CTYPEDATA_DEFINED |
| 27 | +#ifndef _CTYPE_DISABLE_MACROS |
| 28 | + |
| 29 | +#ifndef __PCTYPE_FUNC |
| 30 | +#define __PCTYPE_FUNC __pctype_func() |
| 31 | + _CRTIMP const unsigned short* __pctype_func(void); |
| 32 | +#endif |
| 33 | + |
| 34 | +#ifndef _pctype |
| 35 | +#define _pctype (__pctype_func()) |
| 36 | +#endif |
| 37 | + |
| 38 | +#endif |
| 39 | +#endif |
| 40 | + |
| 41 | +#ifndef _CRT_WCTYPEDATA_DEFINED |
| 42 | +#define _CRT_WCTYPEDATA_DEFINED |
| 43 | +#ifndef _CTYPE_DISABLE_MACROS |
| 44 | +#if !defined(_wctype) && defined(_CRT_USE_WINAPI_FAMILY_DESKTOP_APP) |
| 45 | + extern const unsigned short ** __MINGW_IMP_SYMBOL(_wctype); |
| 46 | +#define _wctype (* __MINGW_IMP_SYMBOL(_wctype)) |
| 47 | +#endif |
| 48 | + |
| 49 | + _CRTIMP const wctype_t * __cdecl __pwctype_func(void); |
| 50 | +#ifndef _pwctype |
| 51 | +#define _pwctype (__pwctype_func()) |
| 52 | +#endif |
| 53 | +#endif |
| 54 | +#endif |
| 55 | + |
| 56 | +#define _UPPER 0x1 |
| 57 | +#define _LOWER 0x2 |
| 58 | +#define _DIGIT 0x4 |
| 59 | +#define _SPACE 0x8 |
| 60 | + |
| 61 | +#define _PUNCT 0x10 |
| 62 | +#define _CONTROL 0x20 |
| 63 | +#define _BLANK 0x40 |
| 64 | +#define _HEX 0x80 |
| 65 | + |
| 66 | +#define _LEADBYTE 0x8000 |
| 67 | +#define _ALPHA (0x0100|_UPPER|_LOWER) |
| 68 | + |
| 69 | +#ifndef _WCTYPE_DEFINED |
| 70 | +#define _WCTYPE_DEFINED |
| 71 | + |
| 72 | + _CRTIMP int __cdecl iswalpha(wint_t _C); |
| 73 | + _CRTIMP int __cdecl iswupper(wint_t _C); |
| 74 | + _CRTIMP int __cdecl iswlower(wint_t _C); |
| 75 | + _CRTIMP int __cdecl iswdigit(wint_t _C); |
| 76 | + _CRTIMP int __cdecl iswxdigit(wint_t _C); |
| 77 | + _CRTIMP int __cdecl iswspace(wint_t _C); |
| 78 | + _CRTIMP int __cdecl iswpunct(wint_t _C); |
| 79 | + _CRTIMP int __cdecl iswalnum(wint_t _C); |
| 80 | + _CRTIMP int __cdecl iswprint(wint_t _C); |
| 81 | + _CRTIMP int __cdecl iswgraph(wint_t _C); |
| 82 | + _CRTIMP int __cdecl iswcntrl(wint_t _C); |
| 83 | + _CRTIMP int __cdecl iswascii(wint_t _C); |
| 84 | +#ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP |
| 85 | + _CRTIMP int __cdecl isleadbyte(int _C); |
| 86 | +#endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */ |
| 87 | + _CRTIMP wint_t __cdecl towupper(wint_t _C); |
| 88 | + _CRTIMP wint_t __cdecl towlower(wint_t _C); |
| 89 | + _CRTIMP int __cdecl iswctype(wint_t _C,wctype_t _Type); |
| 90 | + _CRTIMP int __cdecl __iswcsymf(wint_t _C); |
| 91 | + _CRTIMP int __cdecl __iswcsym(wint_t _C); |
| 92 | + _CRTIMP int __cdecl iswblank(wint_t _C); |
| 93 | +#if __MSVCRT_VERSION__ >= 0x800 || (__MSVCRT_VERSION__ == 0x600 && _WIN32_WINNT >= 0x0600) |
| 94 | + /* These are available since msvcr80.dll (__MSVCRT_VERSION__ >= 0x800), and in |
| 95 | + * msvcrt.dll (__MSVCRT_VERSION__ == 0x600) since Vista (_WIN32_WINNT >= 0x0600). */ |
| 96 | + _CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale); |
| 97 | + _CRTIMP int __cdecl _iswupper_l(wint_t _C,_locale_t _Locale); |
| 98 | + _CRTIMP int __cdecl _iswlower_l(wint_t _C,_locale_t _Locale); |
| 99 | + _CRTIMP int __cdecl _iswdigit_l(wint_t _C,_locale_t _Locale); |
| 100 | + _CRTIMP int __cdecl _iswxdigit_l(wint_t _C,_locale_t _Locale); |
| 101 | + _CRTIMP int __cdecl _iswspace_l(wint_t _C,_locale_t _Locale); |
| 102 | + _CRTIMP int __cdecl _iswpunct_l(wint_t _C,_locale_t _Locale); |
| 103 | + _CRTIMP int __cdecl _iswalnum_l(wint_t _C,_locale_t _Locale); |
| 104 | + _CRTIMP int __cdecl _iswprint_l(wint_t _C,_locale_t _Locale); |
| 105 | + _CRTIMP int __cdecl _iswgraph_l(wint_t _C,_locale_t _Locale); |
| 106 | + _CRTIMP int __cdecl _iswcntrl_l(wint_t _C,_locale_t _Locale); |
| 107 | + _CRTIMP wint_t __cdecl _towupper_l(wint_t _C,_locale_t _Locale); |
| 108 | + _CRTIMP wint_t __cdecl _towlower_l(wint_t _C,_locale_t _Locale); |
| 109 | +# ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP |
| 110 | + _CRTIMP int __cdecl _isleadbyte_l(int _C,_locale_t _Locale); |
| 111 | +# endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */ |
| 112 | + _CRTIMP int __cdecl _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale); |
| 113 | + _CRTIMP int __cdecl _iswblank_l(wint_t _C,_locale_t _Locale); |
| 114 | +#endif |
| 115 | +#if __MSVCRT_VERSION__ >= 0x800 |
| 116 | + /* These are only available since msvcr80.dll, never in msvcrt.dll. */ |
| 117 | + _CRTIMP int __cdecl _iswcsymf_l(wint_t _C,_locale_t _Locale); |
| 118 | + _CRTIMP int __cdecl _iswcsym_l(wint_t _C,_locale_t _Locale); |
| 119 | +#endif |
| 120 | +#ifdef _CRT_USE_WINAPI_FAMILY_DESKTOP_APP |
| 121 | + _CRTIMP int __cdecl is_wctype(wint_t _C,wctype_t _Type); |
| 122 | +#endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP */ |
| 123 | +#endif |
| 124 | + |
| 125 | +#ifndef _WCTYPE_INLINE_DEFINED |
| 126 | +#define _WCTYPE_INLINE_DEFINED |
| 127 | + |
| 128 | +#undef _CRT_WCTYPE_NOINLINE |
| 129 | +#ifndef __cplusplus |
| 130 | +#define iswalpha(_c) (iswctype(_c,_ALPHA)) |
| 131 | +#define iswupper(_c) (iswctype(_c,_UPPER)) |
| 132 | +#define iswlower(_c) (iswctype(_c,_LOWER)) |
| 133 | +#define iswdigit(_c) (iswctype(_c,_DIGIT)) |
| 134 | +#define iswxdigit(_c) (iswctype(_c,_HEX)) |
| 135 | +#define iswspace(_c) (iswctype(_c,_SPACE)) |
| 136 | +#define iswpunct(_c) (iswctype(_c,_PUNCT)) |
| 137 | +#define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT)) |
| 138 | +#define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT)) |
| 139 | +#define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT)) |
| 140 | +#define iswcntrl(_c) (iswctype(_c,_CONTROL)) |
| 141 | +#define iswascii(_c) ((unsigned)(_c) < 0x80) |
| 142 | +#define iswblank(_c) (((_c) == '\t') || iswctype(_c,_BLANK)) |
| 143 | +#if __MSVCRT_VERSION__ >= 0x800 || (__MSVCRT_VERSION__ == 0x600 && _WIN32_WINNT >= 0x0600) |
| 144 | +# define _iswalpha_l(_c,_p) (_iswctype_l(_c,_ALPHA,_p)) |
| 145 | +# define _iswupper_l(_c,_p) (_iswctype_l(_c,_UPPER,_p)) |
| 146 | +# define _iswlower_l(_c,_p) (_iswctype_l(_c,_LOWER,_p)) |
| 147 | +# define _iswdigit_l(_c,_p) (_iswctype_l(_c,_DIGIT,_p)) |
| 148 | +# define _iswxdigit_l(_c,_p) (_iswctype_l(_c,_HEX,_p)) |
| 149 | +# define _iswspace_l(_c,_p) (_iswctype_l(_c,_SPACE,_p)) |
| 150 | +# define _iswpunct_l(_c,_p) (_iswctype_l(_c,_PUNCT,_p)) |
| 151 | +# define _iswalnum_l(_c,_p) (_iswctype_l(_c,_ALPHA|_DIGIT,_p)) |
| 152 | +# define _iswprint_l(_c,_p) (_iswctype_l(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT,_p)) |
| 153 | +# define _iswgraph_l(_c,_p) (_iswctype_l(_c,_PUNCT|_ALPHA|_DIGIT,_p)) |
| 154 | +# define _iswcntrl_l(_c,_p) (_iswctype_l(_c,_CONTROL,_p)) |
| 155 | +# define _iswblank_l(_c,_p) (((_c) == '\t') || _iswctype_l(_c,_BLANK,_p)) |
| 156 | +#endif /* __MSVCRT_VERSION__ >= 0x800 */ |
| 157 | +#endif |
| 158 | +#endif |
| 159 | + |
| 160 | +#ifdef __cplusplus |
| 161 | +} |
| 162 | +#endif |
| 163 | + |
| 164 | +#endif |
0 commit comments