:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / include / crtdll / ctype.h
1 /* 
2  * ctype.h
3  *
4  * Functions for testing character types and converting characters.
5  *
6  * This file is part of the Mingw32 package.
7  *
8  * Contributors:
9  *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
10  *
11  *  THIS SOFTWARE IS NOT COPYRIGHTED
12  *
13  *  This source code is offered for use in the public domain. You may
14  *  use, modify or distribute it freely.
15  *
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.
20  *
21  * $Revision$
22  * $Author$
23  * $Date$
24  *
25  */
26 #ifndef _LINUX_CTYPE_H
27 #define _LINUX_CTYPE_H
28
29 #ifndef _CTYPE_H_
30 #define _CTYPE_H_
31
32 #define __need_wchar_t
33 #define __need_wint_t
34 #include <crtdll/stddef.h>
35
36
37 /*
38  * The following flags are used to tell iswctype and _isctype what character
39  * types you are looking for.
40  */
41 #define _UPPER          0x0001
42 #define _LOWER          0x0002
43 #define _DIGIT          0x0004
44 #define _SPACE          0x0008
45 #define _PUNCT          0x0010
46 #define _CONTROL        0x0020
47 #define _BLANK          0x0040
48 #define _HEX            0x0080
49
50 #define _ALPHA          0x0103
51 #define _LEADBYTE       0x8000
52
53
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57
58 int     isalnum(int c);
59 int     isalpha(int c);
60 int     iscntrl(int c);
61 int     isdigit(int c);
62 int     isgraph(int c);
63 int     islower(int c);
64 int     isprint(int c);
65 int     ispunct(int c);
66 int     isspace(int c);
67 int     isupper(int c);
68 int     isxdigit(int c);
69
70 #ifndef __STRICT_ANSI__
71 int     _isctype (unsigned int c, int ctypeFlags);
72 #endif
73
74 int     tolower(int c);
75 int     toupper(int c);
76
77 /*
78  * NOTE: The above are not old name type wrappers, but functions exported
79  * explicitly by CRTDLL. However, underscored versions are also exported.
80  */
81 #ifndef __STRICT_ANSI__
82 int     _tolower(int c);
83 int     _toupper(int c);
84 #endif
85
86 #ifndef WEOF
87 #define WEOF    (wchar_t)(0xFFFF)
88 #endif
89
90 /*
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.
97  */
98
99 typedef int     wctype_t;
100
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);
116
117 wchar_t towlower(wchar_t c);
118 wchar_t towupper(wchar_t c);
119
120 int     isleadbyte (int c);
121
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) */
127
128 #ifndef _NO_OLDNAMES
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 */
134
135 #endif  /* Not __STRICT_ANSI__ */
136
137 #ifdef __cplusplus
138 }
139 #endif
140
141 #endif
142 #endif