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 * DISCLAMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
26 #ifndef _LINUX_CTYPE_H
27 #define _LINUX_CTYPE_H
32 #define __need_wchar_t
34 #include <crtdll/stddef.h>
38 * The following flags are used to tell iswctype and _isctype what character
39 * types you are looking for.
46 #define _CONTROL 0x0020
51 #define _LEADBYTE 0x8000
70 #ifndef __STRICT_ANSI__
71 int _isctype (unsigned int c, int ctypeFlags);
78 * NOTE: The above are not old name type wrappers, but functions exported
79 * explicitly by CRTDLL. However, underscored versions are also exported.
81 #ifndef __STRICT_ANSI__
87 #define WEOF (wchar_t)(0xFFFF)
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.
101 /* Wide character equivalents */
102 int iswalnum(wint_t wc);
103 int iswalpha(wint_t wc);
104 int iswascii(wint_t wc);
105 int iswcntrl(wint_t wc);
106 int iswctype(wint_t wc, wctype_t wctypeFlags);
107 int is_wctype(wint_t wc, wctype_t wctypeFlags); /* Obsolete! */
108 int iswdigit(wint_t wc);
109 int iswgraph(wint_t wc);
110 int iswlower(wint_t wc);
111 int iswprint(wint_t wc);
112 int iswpunct(wint_t wc);
113 int iswspace(wint_t wc);
114 int iswupper(wint_t wc);
115 int iswxdigit(wint_t wc);
117 wchar_t towlower(wchar_t c);
118 wchar_t towupper(wchar_t c);
120 int isleadbyte (int c);
122 #ifndef __STRICT_ANSI__
123 int __isascii (int c);
124 int __toascii (int c);
125 int __iscsymf (int c); /* Valid first character in C symbol */
126 int __iscsym (int c); /* Valid character in C symbol (after first) */
129 #define isascii(c) __isascii(c)
130 #define toascii(c) _toascii(c)
131 #define iscsymf(c) __iscsymf(c)
132 #define iscsym(c) __iscsym(c)
133 #endif /* Not _NO_OLDNAMES */
135 #endif /* Not __STRICT_ANSI__ */