]>
Commit | Line | Data |
---|---|---|
e9ce8d39 A |
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. | |
9 | * | |
10 | * This code is derived from software contributed to Berkeley by | |
11 | * Paul Borman at Krystal Technologies. | |
12 | * | |
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 | * 3. All advertising materials mentioning features or use of this software | |
22 | * must display the following acknowledgement: | |
23 | * This product includes software developed by the University of | |
24 | * California, Berkeley and its contributors. | |
25 | * 4. Neither the name of the University nor the names of its contributors | |
26 | * may be used to endorse or promote products derived from this software | |
27 | * without specific prior written permission. | |
28 | * | |
29 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
30 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
33 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
34 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
35 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
36 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
37 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
38 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
39 | * SUCH DAMAGE. | |
40 | */ | |
41 | ||
5b2abdfb A |
42 | #if defined(LIBC_SCCS) && !defined(lint) |
43 | static char sccsid[] = "@(#)isctype.c 8.3 (Berkeley) 2/24/94"; | |
44 | #endif /* LIBC_SCCS and not lint */ | |
9385eb3d A |
45 | #include <sys/cdefs.h> |
46 | __FBSDID("$FreeBSD: src/lib/libc/locale/isctype.c,v 1.9 2002/08/17 20:03:44 ache Exp $"); | |
e9ce8d39 | 47 | |
e9ce8d39 A |
48 | #include <ctype.h> |
49 | ||
5b2abdfb A |
50 | #undef digittoint |
51 | int | |
52 | digittoint(c) | |
53 | int c; | |
54 | { | |
9385eb3d | 55 | return (__maskrune(c, 0xFF)); |
5b2abdfb A |
56 | } |
57 | ||
e9ce8d39 A |
58 | #undef isalnum |
59 | int | |
60 | isalnum(c) | |
61 | int c; | |
62 | { | |
9385eb3d | 63 | return (__istype(c, _CTYPE_A|_CTYPE_D)); |
e9ce8d39 A |
64 | } |
65 | ||
66 | #undef isalpha | |
67 | int | |
68 | isalpha(c) | |
69 | int c; | |
70 | { | |
9385eb3d | 71 | return (__istype(c, _CTYPE_A)); |
e9ce8d39 A |
72 | } |
73 | ||
74 | #undef isascii | |
75 | int | |
76 | isascii(c) | |
77 | int c; | |
78 | { | |
9385eb3d | 79 | return ((c & ~0x7F) == 0); |
e9ce8d39 A |
80 | } |
81 | ||
82 | #undef isblank | |
83 | int | |
84 | isblank(c) | |
85 | int c; | |
86 | { | |
9385eb3d | 87 | return (__istype(c, _CTYPE_B)); |
e9ce8d39 A |
88 | } |
89 | ||
90 | #undef iscntrl | |
91 | int | |
92 | iscntrl(c) | |
93 | int c; | |
94 | { | |
9385eb3d | 95 | return (__istype(c, _CTYPE_C)); |
e9ce8d39 A |
96 | } |
97 | ||
98 | #undef isdigit | |
99 | int | |
100 | isdigit(c) | |
101 | int c; | |
102 | { | |
9385eb3d | 103 | return (__isctype(c, _CTYPE_D)); |
e9ce8d39 A |
104 | } |
105 | ||
106 | #undef isgraph | |
107 | int | |
108 | isgraph(c) | |
109 | int c; | |
110 | { | |
9385eb3d | 111 | return (__istype(c, _CTYPE_G)); |
5b2abdfb A |
112 | } |
113 | ||
114 | #undef ishexnumber | |
115 | int | |
116 | ishexnumber(c) | |
117 | int c; | |
118 | { | |
9385eb3d | 119 | return (__istype(c, _CTYPE_X)); |
5b2abdfb A |
120 | } |
121 | ||
122 | #undef isideogram | |
123 | int | |
124 | isideogram(c) | |
125 | int c; | |
126 | { | |
9385eb3d | 127 | return (__istype(c, _CTYPE_I)); |
e9ce8d39 A |
128 | } |
129 | ||
130 | #undef islower | |
131 | int | |
132 | islower(c) | |
133 | int c; | |
134 | { | |
9385eb3d | 135 | return (__istype(c, _CTYPE_L)); |
5b2abdfb A |
136 | } |
137 | ||
138 | #undef isnumber | |
139 | int | |
140 | isnumber(c) | |
141 | int c; | |
142 | { | |
9385eb3d | 143 | return (__istype(c, _CTYPE_D)); |
5b2abdfb A |
144 | } |
145 | ||
146 | #undef isphonogram | |
147 | int | |
148 | isphonogram(c) | |
149 | int c; | |
150 | { | |
9385eb3d | 151 | return (__istype(c, _CTYPE_Q)); |
e9ce8d39 A |
152 | } |
153 | ||
154 | #undef isprint | |
155 | int | |
156 | isprint(c) | |
157 | int c; | |
158 | { | |
9385eb3d | 159 | return (__istype(c, _CTYPE_R)); |
e9ce8d39 A |
160 | } |
161 | ||
162 | #undef ispunct | |
163 | int | |
164 | ispunct(c) | |
165 | int c; | |
166 | { | |
9385eb3d | 167 | return (__istype(c, _CTYPE_P)); |
5b2abdfb A |
168 | } |
169 | ||
170 | #undef isrune | |
171 | int | |
172 | isrune(c) | |
173 | int c; | |
174 | { | |
9385eb3d | 175 | return (__istype(c, 0xFFFFFF00L)); |
e9ce8d39 A |
176 | } |
177 | ||
178 | #undef isspace | |
179 | int | |
180 | isspace(c) | |
181 | int c; | |
182 | { | |
9385eb3d | 183 | return (__istype(c, _CTYPE_S)); |
5b2abdfb A |
184 | } |
185 | ||
186 | #undef isspecial | |
187 | int | |
188 | isspecial(c) | |
189 | int c; | |
190 | { | |
9385eb3d | 191 | return (__istype(c, _CTYPE_T)); |
e9ce8d39 A |
192 | } |
193 | ||
194 | #undef isupper | |
195 | int | |
196 | isupper(c) | |
197 | int c; | |
198 | { | |
9385eb3d | 199 | return (__istype(c, _CTYPE_U)); |
e9ce8d39 A |
200 | } |
201 | ||
202 | #undef isxdigit | |
203 | int | |
204 | isxdigit(c) | |
205 | int c; | |
206 | { | |
9385eb3d | 207 | return (__isctype(c, _CTYPE_X)); |
e9ce8d39 A |
208 | } |
209 | ||
210 | #undef toascii | |
211 | int | |
212 | toascii(c) | |
213 | int c; | |
214 | { | |
9385eb3d | 215 | return (c & 0x7F); |
e9ce8d39 A |
216 | } |
217 | ||
218 | #undef tolower | |
219 | int | |
220 | tolower(c) | |
221 | int c; | |
222 | { | |
5b2abdfb | 223 | return (__tolower(c)); |
e9ce8d39 A |
224 | } |
225 | ||
226 | #undef toupper | |
227 | int | |
228 | toupper(c) | |
229 | int c; | |
230 | { | |
5b2abdfb | 231 | return (__toupper(c)); |
e9ce8d39 | 232 | } |
5b2abdfb | 233 |