4 * Functions for testing wide character types and converting characters.
6 * This file is part of the Mingw32 package.
9 * Created by Mumit Khan <khan@xraylith.wisc.edu>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
26 /* All the headers include this file. */
29 #define __need_wchar_t
33 #endif /* Not RC_INVOKED */
36 * The following flags are used to tell iswctype and _isctype what character
37 * types you are looking for.
44 #define _CONTROL 0x0020
47 #define _LEADBYTE 0x8000
58 #define WEOF (wchar_t)(0xFFFF)
61 #ifndef _WCTYPE_T_DEFINED
62 typedef wchar_t wctype_t;
63 #define _WCTYPE_T_DEFINED
66 /* Wide character equivalents - also in ctype.h */
71 int iswctype(wint_t, wctype_t);
72 int is_wctype(wint_t, wctype_t); /* Obsolete! */
80 int iswxdigit(wint_t);
82 wchar_t towlower(wchar_t);
83 wchar_t towupper(wchar_t);
89 __MINGW_IMPORT
unsigned short _ctype
[];
91 __MINGW_IMPORT
unsigned short* _pctype
;
93 __MINGW_IMPORT
unsigned short* _pctype_dll
;
94 #define _pctype _pctype_dll
97 #if !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
98 #define __WCTYPE_INLINES_DEFINED
99 extern inline int iswalnum(wint_t wc
) {return (iswctype(wc
,_ALPHA
|_DIGIT
));}
100 extern inline int iswalpha(wint_t wc
) {return (iswctype(wc
,_ALPHA
));}
101 extern inline int iswascii(wint_t wc
) {return (((unsigned)wc
& 0x7F) ==0);}
102 extern inline int iswcntrl(wint_t wc
) {return (iswctype(wc
,_CONTROL
));}
103 extern inline int iswdigit(wint_t wc
) {return (iswctype(wc
,_DIGIT
));}
104 extern inline int iswgraph(wint_t wc
) {return (iswctype(wc
,_PUNCT
|_ALPHA
|_DIGIT
));}
105 extern inline int iswlower(wint_t wc
) {return (iswctype(wc
,_LOWER
));}
106 extern inline int iswprint(wint_t wc
) {return (iswctype(wc
,_BLANK
|_PUNCT
|_ALPHA
|_DIGIT
));}
107 extern inline int iswpunct(wint_t wc
) {return (iswctype(wc
,_PUNCT
));}
108 extern inline int iswspace(wint_t wc
) {return (iswctype(wc
,_SPACE
));}
109 extern inline int iswupper(wint_t wc
) {return (iswctype(wc
,_UPPER
));}
110 extern inline int iswxdigit(wint_t wc
) {return (iswctype(wc
,_HEX
));}
111 extern inline int isleadbyte(int c
) {return (_pctype
[(unsigned char)(c
)] & _LEADBYTE
);}
112 #endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
115 typedef wchar_t wctrans_t;
116 wint_t towctrans(wint_t, wctrans_t);
117 wctrans_t wctrans(const char*);
118 wctype_t wctype(const char*);
124 #endif /* Not RC_INVOKED */
126 #endif /* Not _WCTYPE_H_ */