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#pragma ident	"%Z%%M%	%I%	%E% SMI"
23
24/*	Copyright (c) 1984 AT&T	*/
25/*	  All Rights Reserved  	*/
26/*	Portions Copyright (c) 1989 Sun Microsystems, Inc.	*/
27/*	All Rights Reserved	*/
28
29
30#ifndef	__ctype_h
31#define	__ctype_h
32
33#define	_U	01	/* Upper case */
34#define	_L	02	/* Lower case */
35#define	_N	04	/* Numeral (digit) */
36#define	_S	010	/* Spacing character */
37#define	_P	020	/* Punctuation */
38#define	_C	040	/* Control character */
39#define	_X	0100	/* heXadecimal digit */
40#define	_B	0200	/* Blank */
41
42extern int	isalnum(/* int c */);
43extern int	isalpha(/* int c */);
44#ifndef	_POSIX_SOURCE
45extern int	isascii(/* int c */);
46#endif
47extern int	iscntrl(/* int c */);
48extern int	isdigit(/* int c */);
49extern int	isgraph(/* int c */);
50extern int	islower(/* int c */);
51extern int	isprint(/* int c */);
52extern int	ispunct(/* int c */);
53extern int	isspace(/* int c */);
54extern int	isupper(/* int c */);
55extern int	isxdigit(/* int c */);
56#ifndef	_POSIX_SOURCE
57extern int	toascii(/* int c */);
58#endif
59extern int	tolower(/* int c */);
60extern int	toupper(/* int c */);
61
62#ifndef	lint
63
64#define	isalnum(c)	((_ctype_ + 1)[c] & (_U | _L | _N))
65#define	isalpha(c)	((_ctype_ + 1)[c] & (_U | _L))
66#ifndef	_POSIX_SOURCE
67#define	isascii(c)	(!((c) & ~0177))
68#endif
69#define	iscntrl(c)	((_ctype_ + 1)[c] & _C)
70#define	isdigit(c)	((_ctype_ + 1)[c] & _N)
71#define	isgraph(c)	((_ctype_ + 1)[c] & (_P | _U | _L | _N))
72#define	islower(c)	((_ctype_ + 1)[c] & _L)
73#define	isprint(c)	((_ctype_ + 1)[c] & (_P | _U | _L | _N | _B))
74#define	ispunct(c)	((_ctype_ + 1)[c] & _P)
75#define	isspace(c)	((_ctype_ + 1)[c] & _S)
76#define	isupper(c)	((_ctype_ + 1)[c] & _U)
77#define	isxdigit(c)	((_ctype_ + 1)[c] & _X)
78#ifndef	_POSIX_SOURCE
79#define	toascii(c)	((c) & 0177)
80/*
81 * These upper/lower macros are not codeset independent
82 */
83
84#define _toupper(c)      ((c) - 'a' + 'A')
85#define _tolower(c)      ((c) - 'A' + 'a')
86#endif
87
88extern char	_ctype_[];
89
90#endif	/* lint */
91
92#endif	/* !__ctype_h */
93