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
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
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 $");
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
64 return (__istype(wc
, _CTYPE_A
|_CTYPE_D
));
72 return (__istype(wc
, _CTYPE_A
));
80 return ((wc
& ~0x7F) == 0);
88 return (__istype(wc
, _CTYPE_B
));
96 return (__istype(wc
, _CTYPE_C
));
104 return (__isctype(wc
, _CTYPE_D
));
112 return (__istype(wc
, _CTYPE_G
));
120 return (__istype(wc
, _CTYPE_X
));
123 #ifndef __AROS__ /* not suppoted atm */
129 return (__istype(wc
, _CTYPE_I
));
138 return (__istype(wc
, _CTYPE_L
));
146 return (__istype(wc
, _CTYPE_D
));
149 #ifndef __AROS__ /* not suppoted atm */
155 return (__istype(wc
, _CTYPE_Q
));
164 return (__istype(wc
, _CTYPE_R
));
172 return (__istype(wc
, _CTYPE_P
));
180 return (__istype(wc
, 0xFFFFFF00L
));
188 return (__istype(wc
, _CTYPE_S
));
191 #ifndef __AROS__ /* not suppoted atm */
197 return (__istype(wc
, _CTYPE_T
));
206 return (__istype(wc
, _CTYPE_U
));
214 return (__isctype(wc
, _CTYPE_X
));
222 return (__tolower(wc
));
230 return (__toupper(wc
));