compiler/clib/regex: Switched to NetBSD version of the regex functions.
[AROS.git] / compiler / clib / locale / iswctype.c
blob2af5f5514ad2bba0e4d531e1e31718a8d9933882
1 /*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.
10 * This code is derived from software contributed to Berkeley by
11 * Paul Borman at Krystal Technologies.
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
38 #include <sys/cdefs.h>
39 __FBSDID("$FreeBSD: src/lib/libc/locale/iswctype.c,v 1.9 2007/10/23 17:39:28 ache Exp $");
41 #include <wctype.h>
43 #ifdef __AROS__
44 #include <ctype.h>
45 #include "_ctype.h"
46 #define _CTYPE_A _ISalpha
47 #define _CTYPE_C _IScntrl
48 #define _CTYPE_D _ISdigit
49 #define _CTYPE_G _ISgraph
50 #define _CTYPE_L _ISlower
51 #define _CTYPE_P _ISpunct
52 #define _CTYPE_S _ISspace
53 #define _CTYPE_U _ISupper
54 #define _CTYPE_X _ISxdigit
55 #define _CTYPE_B _ISblank
56 #define _CTYPE_R _ISprint
57 #endif
59 #undef iswalnum
60 int
61 iswalnum(wc)
62 wint_t wc;
64 return (__istype(wc, _CTYPE_A|_CTYPE_D));
67 #undef iswalpha
68 int
69 iswalpha(wc)
70 wint_t wc;
72 return (__istype(wc, _CTYPE_A));
75 #undef iswascii
76 int
77 iswascii(wc)
78 wint_t wc;
80 return ((wc & ~0x7F) == 0);
83 #undef iswblank
84 int
85 iswblank(wc)
86 wint_t wc;
88 return (__istype(wc, _CTYPE_B));
91 #undef iswcntrl
92 int
93 iswcntrl(wc)
94 wint_t wc;
96 return (__istype(wc, _CTYPE_C));
99 #undef iswdigit
101 iswdigit(wc)
102 wint_t wc;
104 return (__isctype(wc, _CTYPE_D));
107 #undef iswgraph
109 iswgraph(wc)
110 wint_t wc;
112 return (__istype(wc, _CTYPE_G));
115 #undef iswhexnumber
117 iswhexnumber(wc)
118 wint_t wc;
120 return (__istype(wc, _CTYPE_X));
123 #ifndef __AROS__ /* not suppoted atm */
124 #undef iswideogram
126 iswideogram(wc)
127 wint_t wc;
129 return (__istype(wc, _CTYPE_I));
131 #endif
133 #undef iswlower
135 iswlower(wc)
136 wint_t wc;
138 return (__istype(wc, _CTYPE_L));
141 #undef iswnumber
143 iswnumber(wc)
144 wint_t wc;
146 return (__istype(wc, _CTYPE_D));
149 #ifndef __AROS__ /* not suppoted atm */
150 #undef iswphonogram
152 iswphonogram(wc)
153 wint_t wc;
155 return (__istype(wc, _CTYPE_Q));
157 #endif
159 #undef iswprint
161 iswprint(wc)
162 wint_t wc;
164 return (__istype(wc, _CTYPE_R));
167 #undef iswpunct
169 iswpunct(wc)
170 wint_t wc;
172 return (__istype(wc, _CTYPE_P));
175 #undef iswrune
177 iswrune(wc)
178 wint_t wc;
180 return (__istype(wc, 0xFFFFFF00L));
183 #undef iswspace
185 iswspace(wc)
186 wint_t wc;
188 return (__istype(wc, _CTYPE_S));
191 #ifndef __AROS__ /* not suppoted atm */
192 #undef iswspecial
194 iswspecial(wc)
195 wint_t wc;
197 return (__istype(wc, _CTYPE_T));
199 #endif
201 #undef iswupper
203 iswupper(wc)
204 wint_t wc;
206 return (__istype(wc, _CTYPE_U));
209 #undef iswxdigit
211 iswxdigit(wc)
212 wint_t wc;
214 return (__isctype(wc, _CTYPE_X));
217 #undef towlower
218 wint_t
219 towlower(wc)
220 wint_t wc;
222 return (__tolower(wc));
225 #undef towupper
226 wint_t
227 towupper(wc)
228 wint_t wc;
230 return (__toupper(wc));