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_WCTYPE
7 #define _INC_WCTYPE
8 
9 #ifndef _WIN32
10 #error Only Win32 target is supported!
11 #endif
12 
13 #include <crtdefs.h>
14 
15 #pragma pack(push,_CRT_PACKING)
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 #ifndef _CRTIMP
22 #define _CRTIMP __declspec(dllimport)
23 #endif
24 
25 #ifndef _WCHAR_T_DEFINED
26 #define _WCHAR_T_DEFINED
27 #ifndef __cplusplus
28   typedef unsigned short wchar_t;
29 #endif /* C++ */
30 #endif /* _WCHAR_T_DEFINED */
31 
32 #ifndef _WCTYPE_T_DEFINED
33 #define _WCTYPE_T_DEFINED
34   typedef unsigned short wint_t;
35   typedef unsigned short wctype_t;
36 #endif /* _WCTYPE_T_DEFINED */
37 
38 #ifndef WEOF
39 #define WEOF (wint_t)(0xFFFF)
40 #endif
41 
42 #ifndef _CRT_CTYPEDATA_DEFINED
43 #define _CRT_CTYPEDATA_DEFINED
44 #ifndef _CTYPE_DISABLE_MACROS
45 
46 #ifndef __PCTYPE_FUNC
47 #define __PCTYPE_FUNC __pctype_func()
48 #ifdef _MSVCRT_
49 #define __pctype_func() (_pctype)
50 #else
51 #ifdef _UCRT
52   _CRTIMP unsigned short* __pctype_func(void);
53 #else
54 #define __pctype_func() (* __MINGW_IMP_SYMBOL(_pctype))
55 #endif
56 #endif
57 #endif
58 
59 #ifndef _pctype
60 #ifdef _MSVCRT_
61   extern unsigned short *_pctype;
62 #else
63 #ifdef _UCRT
64 #define _pctype (__pctype_func())
65 #else
66   extern unsigned short ** __MINGW_IMP_SYMBOL(_pctype);
67 #define _pctype (* __MINGW_IMP_SYMBOL(_pctype))
68 #endif
69 #endif
70 #endif
71 
72 #endif
73 #endif
74 
75 #ifndef _CRT_WCTYPEDATA_DEFINED
76 #define _CRT_WCTYPEDATA_DEFINED
77 #ifndef _CTYPE_DISABLE_MACROS
78 #if !defined(_wctype) && defined(_CRT_USE_WINAPI_FAMILY_DESKTOP_APP)
79 #ifdef _MSVCRT_
80   extern unsigned short *_wctype;
81 #else
82   extern unsigned short ** __MINGW_IMP_SYMBOL(_wctype);
83 #define _wctype (* __MINGW_IMP_SYMBOL(_wctype))
84 #endif
85 #endif
86 
87 #ifndef _pwctype
88 #ifdef _MSVCRT_
89   extern unsigned short *_pwctype;
90 #else
91   extern unsigned short ** __MINGW_IMP_SYMBOL(_pwctype);
92 #define _pwctype (* __MINGW_IMP_SYMBOL(_pwctype))
93 #define __pwctype_func() (* __MINGW_IMP_SYMBOL(_pwctype))
94 #endif
95 #endif
96 #endif
97 #endif
98 
99 #define _UPPER 0x1
100 #define _LOWER 0x2
101 #define _DIGIT 0x4
102 #define _SPACE 0x8
103 
104 #define _PUNCT 0x10
105 #define _CONTROL 0x20
106 #define _BLANK 0x40
107 #define _HEX 0x80
108 
109 #define _LEADBYTE 0x8000
110 #define _ALPHA (0x0100|_UPPER|_LOWER)
111 
112 #ifndef _WCTYPE_DEFINED
113 #define _WCTYPE_DEFINED
114 
115   int __cdecl iswalpha(wint_t);
116   int __cdecl iswupper(wint_t);
117   int __cdecl iswlower(wint_t);
118   int __cdecl iswdigit(wint_t);
119   int __cdecl iswxdigit(wint_t);
120   int __cdecl iswspace(wint_t);
121   int __cdecl iswpunct(wint_t);
122   int __cdecl iswalnum(wint_t);
123   int __cdecl iswprint(wint_t);
124   int __cdecl iswgraph(wint_t);
125   int __cdecl iswcntrl(wint_t);
126   int __cdecl iswascii(wint_t);
127   int __cdecl isleadbyte(int);
128   wint_t __cdecl towupper(wint_t);
129   wint_t __cdecl towlower(wint_t);
130   int __cdecl iswctype(wint_t,wctype_t);
131 #if __MSVCRT_VERSION__ >= 0x800
132   _CRTIMP int __cdecl __iswcsymf(wint_t);
133   _CRTIMP int __cdecl __iswcsym(wint_t);
134 #endif
135   int __cdecl is_wctype(wint_t,wctype_t);
136 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES) || defined (__cplusplus)
137 int __cdecl iswblank(wint_t _C);
138 #endif
139 #endif
140 
141 #ifndef _WCTYPE_INLINE_DEFINED
142 #define _WCTYPE_INLINE_DEFINED
143 #ifndef __cplusplus
144 #define iswalpha(_c) (iswctype(_c,_ALPHA))
145 #define iswupper(_c) (iswctype(_c,_UPPER))
146 #define iswlower(_c) (iswctype(_c,_LOWER))
147 #define iswdigit(_c) (iswctype(_c,_DIGIT))
148 #define iswxdigit(_c) (iswctype(_c,_HEX))
149 #define iswspace(_c) (iswctype(_c,_SPACE))
150 #define iswpunct(_c) (iswctype(_c,_PUNCT))
151 #define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT))
152 #define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT))
153 #define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT))
154 #define iswcntrl(_c) (iswctype(_c,_CONTROL))
155 #define iswascii(_c) ((unsigned)(_c) < 0x80)
156 #define isleadbyte(c) (__pctype_func()[(unsigned char)(c)] & _LEADBYTE)
157 #else
158 #ifndef __CRT__NO_INLINE
iswalpha(wint_t _C)159   __CRT_INLINE int __cdecl iswalpha(wint_t _C) {return (iswctype(_C,_ALPHA)); }
iswupper(wint_t _C)160   __CRT_INLINE int __cdecl iswupper(wint_t _C) {return (iswctype(_C,_UPPER)); }
iswlower(wint_t _C)161   __CRT_INLINE int __cdecl iswlower(wint_t _C) {return (iswctype(_C,_LOWER)); }
iswdigit(wint_t _C)162   __CRT_INLINE int __cdecl iswdigit(wint_t _C) {return (iswctype(_C,_DIGIT)); }
iswxdigit(wint_t _C)163   __CRT_INLINE int __cdecl iswxdigit(wint_t _C) {return (iswctype(_C,_HEX)); }
iswspace(wint_t _C)164   __CRT_INLINE int __cdecl iswspace(wint_t _C) {return (iswctype(_C,_SPACE)); }
iswpunct(wint_t _C)165   __CRT_INLINE int __cdecl iswpunct(wint_t _C) {return (iswctype(_C,_PUNCT)); }
iswalnum(wint_t _C)166   __CRT_INLINE int __cdecl iswalnum(wint_t _C) {return (iswctype(_C,_ALPHA|_DIGIT)); }
iswprint(wint_t _C)167   __CRT_INLINE int __cdecl iswprint(wint_t _C) {return (iswctype(_C,_BLANK|_PUNCT|_ALPHA|_DIGIT)); }
iswgraph(wint_t _C)168   __CRT_INLINE int __cdecl iswgraph(wint_t _C) {return (iswctype(_C,_PUNCT|_ALPHA|_DIGIT)); }
iswcntrl(wint_t _C)169   __CRT_INLINE int __cdecl iswcntrl(wint_t _C) {return (iswctype(_C,_CONTROL)); }
iswascii(wint_t _C)170   __CRT_INLINE int __cdecl iswascii(wint_t _C) {return ((unsigned)(_C) < 0x80); }
isleadbyte(int _C)171   __CRT_INLINE int __cdecl isleadbyte(int _C) {return (__pctype_func()[(unsigned char)(_C)] & _LEADBYTE); }
172 #endif /* !__CRT__NO_INLINE */
173 #endif /* __cplusplus */
174 #endif
175 
176   typedef wchar_t wctrans_t;
177   wint_t __cdecl towctrans(wint_t,wctrans_t);
178   wctrans_t __cdecl wctrans(const char *);
179   wctype_t __cdecl wctype(const char *);
180 
181 #ifdef __cplusplus
182 }
183 #endif
184 
185 #pragma pack(pop)
186 #endif
187