3 * @copy 2012 MinGW.org project
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
24 /* Created by Mumit Khan <khan@xraylith.wisc.edu> */
27 #pragma GCC system_header
30 #define __need_wchar_t
35 #endif /* Not RC_INVOKED */
38 * The following flags are used to tell iswctype and _isctype what character
39 * types you are looking for.
46 #define _CONTROL 0x0020
49 #define _LEADBYTE 0x8000
60 #define WEOF (wchar_t)(0xFFFF)
63 #ifndef _WCTYPE_T_DEFINED
64 typedef wchar_t wctype_t;
65 #define _WCTYPE_T_DEFINED
68 /* Wide character equivalents - also in ctype.h */
69 _CRTIMP int __cdecl __MINGW_NOTHROW iswalnum(wint_t);
70 _CRTIMP int __cdecl __MINGW_NOTHROW iswalpha(wint_t);
71 _CRTIMP int __cdecl __MINGW_NOTHROW iswascii(wint_t);
72 _CRTIMP int __cdecl __MINGW_NOTHROW iswcntrl(wint_t);
73 _CRTIMP int __cdecl __MINGW_NOTHROW iswctype(wint_t, wctype_t);
74 _CRTIMP int __cdecl __MINGW_NOTHROW is_wctype(wint_t, wctype_t); /* Obsolete! */
75 _CRTIMP int __cdecl __MINGW_NOTHROW iswdigit(wint_t);
76 _CRTIMP int __cdecl __MINGW_NOTHROW iswgraph(wint_t);
77 _CRTIMP int __cdecl __MINGW_NOTHROW iswlower(wint_t);
78 _CRTIMP int __cdecl __MINGW_NOTHROW iswprint(wint_t);
79 _CRTIMP int __cdecl __MINGW_NOTHROW iswpunct(wint_t);
80 _CRTIMP int __cdecl __MINGW_NOTHROW iswspace(wint_t);
81 _CRTIMP int __cdecl __MINGW_NOTHROW iswupper(wint_t);
82 _CRTIMP int __cdecl __MINGW_NOTHROW iswxdigit(wint_t);
84 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
85 || !defined __STRICT_ANSI__ || defined __cplusplus
86 int __cdecl __MINGW_NOTHROW iswblank (wint_t);
89 /* Older MS docs uses wchar_t for arg and return type, while newer
90 online MS docs say arg is wint_t and return is int.
91 ISO C uses wint_t for both. */
92 _CRTIMP wint_t __cdecl __MINGW_NOTHROW towlower (wint_t);
93 _CRTIMP wint_t __cdecl __MINGW_NOTHROW towupper (wint_t);
95 _CRTIMP int __cdecl __MINGW_NOTHROW isleadbyte (int);
99 __MINGW_IMPORT unsigned short _ctype[];
100 __MINGW_IMPORT unsigned short* _pctype;
103 #if !(defined (__NO_INLINE__) || defined(__NO_CTYPE_INLINES) \
104 || defined(__WCTYPE_INLINES_DEFINED))
105 #define __WCTYPE_INLINES_DEFINED
106 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));}
107 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));}
108 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswascii(wint_t wc) {return ((wc & ~0x7F) ==0);}
109 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));}
110 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));}
111 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));}
112 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswlower(wint_t wc) {return (iswctype(wc,_LOWER));}
113 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
114 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));}
115 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
116 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
117 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
118 __CRT_INLINE int __cdecl __MINGW_NOTHROW isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
120 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
121 || !defined __STRICT_ANSI__ || defined __cplusplus
122 __CRT_INLINE int __cdecl __MINGW_NOTHROW iswblank (wint_t wc)
123 {return (iswctype(wc, _BLANK) || wc == L'\t');}
126 #endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
128 typedef wchar_t wctrans_t;
130 /* These are resolved by libmingwex.a. Note, that they are also exported
131 by the MS C++ runtime lib (msvcp60.dll). The msvcp60.dll implementations
132 of wctrans and towctrans are not C99 compliant in that wctrans("tolower")
133 returns 0, while std specifies that a non-zero value should be returned
134 for a valid string descriptor. If you want the MS behaviour (and you have
135 msvcp60.dll in your path) add -lmsvcp60 to your command line. */
137 wint_t __cdecl __MINGW_NOTHROW towctrans(wint_t, wctrans_t);
138 wctrans_t __cdecl __MINGW_NOTHROW wctrans(const char*);
139 wctype_t __cdecl __MINGW_NOTHROW wctype(const char*);
145 #endif /* Not RC_INVOKED */
147 #endif /* Not _WCTYPE_H */