xref: /titanic_50/usr/src/lib/libbc/inc/include/ctype.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1989 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 
30 #define	_U	01
31 #define	_L	02
32 #define	_N	04
33 #define	_S	010
34 #define _P	020
35 #define _C	040
36 #define _X	0100
37 #define	_B	0200
38 
39 extern	char	_ctype_[];
40 
41 #define	isalpha(c)	((_ctype_+1)[c]&(_U|_L))
42 #define	isupper(c)	((_ctype_+1)[c]&_U)
43 #define	islower(c)	((_ctype_+1)[c]&_L)
44 #define	isdigit(c)	((_ctype_+1)[c]&_N)
45 #define	isxdigit(c)	((_ctype_+1)[c]&_X)
46 #define	isspace(c)	((_ctype_+1)[c]&_S)
47 #define ispunct(c)	((_ctype_+1)[c]&_P)
48 #define isalnum(c)	((_ctype_+1)[c]&(_U|_L|_N))
49 #define isprint(c)	((_ctype_+1)[c]&(_P|_U|_L|_N|_B))
50 #define	isgraph(c)	((_ctype_+1)[c]&(_P|_U|_L|_N))
51 #define iscntrl(c)	((_ctype_+1)[c]&_C)
52 #define isascii(c)	((unsigned)(c)<=0177)
53 #define toascii(c)	((c)&0177)
54