4 * Functions for testing character types and converting characters.
6 * This file is part of the Mingw32 package.
9 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
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.
30 #define __need_wchar_t
32 #include <msvcrt/stddef.h>
36 * The following flags are used to tell iswctype and _isctype what character
37 * types you are looking for.
42 #define _SPACE 0x0008 /* HT LF VT FF CR SP */
44 #define _CONTROL 0x0020
45 #define _BLANK 0x0040 /* this is SP only, not SP and HT as in C99 */
47 #define _LEADBYTE 0x8000
68 #ifndef __STRICT_ANSI__
69 int _isctype (unsigned int, int);
72 /* These are the ANSI versions, with correct checking of argument */
77 * NOTE: The above are not old name type wrappers, but functions exported
78 * explicitly by MSVCRT/CRTDLL. However, underscored versions are also
81 #ifndef __STRICT_ANSI__
83 * These are the cheap non-std versions: The return values are undefined
84 * if the argument is not ASCII char or is not of appropriate case
91 * TODO: MB_CUR_MAX should be defined here (if not already defined, since
92 * it should also be defined in stdlib.h). It is supposed to be the
93 * maximum number of bytes in a multi-byte character in the current
94 * locale. Perhaps accessible through the __mb_curr_max_dll entry point,
95 * but I think (again) that that is a variable pointer, which leads to
96 * problems under the current Cygwin compiler distribution.
102 /* Wide character equivalents */
104 #define WEOF (wchar_t)(0xFFFF)
107 int iswalnum(wint_t);
108 int iswalpha(wint_t);
109 int iswascii(wint_t);
110 int iswcntrl(wint_t);
111 int iswctype(wint_t, wctype_t);
112 int is_wctype(wint_t, wctype_t); /* Obsolete! */
113 int iswdigit(wint_t);
114 int iswgraph(wint_t);
115 int iswlower(wint_t);
116 int iswprint(wint_t);
117 int iswpunct(wint_t);
118 int iswspace(wint_t);
119 int iswupper(wint_t);
120 int iswxdigit(wint_t);
122 wchar_t towlower(wchar_t);
123 wchar_t towupper(wchar_t);
127 #ifndef __STRICT_ANSI__
130 int __iscsymf(int); /* Valid first character in C symbol */
131 int __iscsym(int); /* Valid character in C symbol (after first) */
134 #define isascii(c) __isascii(c)
135 #define toascii(c) _toascii(c)
136 #define iscsymf(c) __iscsymf(c)
137 #define iscsym(c) __iscsym(c)
138 #endif /* Not _NO_OLDNAMES */
140 #endif /* Not __STRICT_ANSI__ */
146 #endif /* Not _CTYPE_H_ */