xref: /illumos-gate/usr/src/head/ctype.h (revision b4203d75)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*	Copyright (c) 1988 AT&T	*/
23*b4203d75SMarcel Telka /*	  All Rights Reserved	*/
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*
27ba3594baSGarrett D'Amore  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28ba3594baSGarrett D'Amore  *
297c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
307c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
317c478bd9Sstevel@tonic-gate  */
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #ifndef _CTYPE_H
347c478bd9Sstevel@tonic-gate #define	_CTYPE_H
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #include <iso/ctype_iso.h>
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate /*
397c478bd9Sstevel@tonic-gate  * Allow global visibility for symbols defined in
407c478bd9Sstevel@tonic-gate  * C++ "std" namespace in <iso/ctype_iso.h>.
417c478bd9Sstevel@tonic-gate  */
427c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
437c478bd9Sstevel@tonic-gate using std::isalnum;
447c478bd9Sstevel@tonic-gate using std::isalpha;
457c478bd9Sstevel@tonic-gate using std::iscntrl;
467c478bd9Sstevel@tonic-gate using std::isdigit;
477c478bd9Sstevel@tonic-gate using std::isgraph;
487c478bd9Sstevel@tonic-gate using std::islower;
497c478bd9Sstevel@tonic-gate using std::isprint;
507c478bd9Sstevel@tonic-gate using std::ispunct;
517c478bd9Sstevel@tonic-gate using std::isspace;
527c478bd9Sstevel@tonic-gate using std::isupper;
537c478bd9Sstevel@tonic-gate using std::isxdigit;
547c478bd9Sstevel@tonic-gate using std::tolower;
557c478bd9Sstevel@tonic-gate using std::toupper;
56fed328a0SHans Rosenfeld #if (__cplusplus >= 201103L) || defined(_STDC_C99) || defined(_XPG6) || \
57fed328a0SHans Rosenfeld 	!defined(_STRICT_SYMBOLS)
582d08521bSGarrett D'Amore using std::isblank;
592d08521bSGarrett D'Amore #endif
607c478bd9Sstevel@tonic-gate #endif
617c478bd9Sstevel@tonic-gate 
627c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
637c478bd9Sstevel@tonic-gate extern "C" {
647c478bd9Sstevel@tonic-gate #endif
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
677c478bd9Sstevel@tonic-gate 	((!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
687c478bd9Sstevel@tonic-gate 	defined(_XOPEN_SOURCE))
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate extern int isascii(int);
717c478bd9Sstevel@tonic-gate extern int toascii(int);
727c478bd9Sstevel@tonic-gate extern int _tolower(int);
737c478bd9Sstevel@tonic-gate extern int _toupper(int);
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || ((!defined(_STRICT_STDC) ... */
767c478bd9Sstevel@tonic-gate 
777c478bd9Sstevel@tonic-gate #if !defined(__lint)
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
807c478bd9Sstevel@tonic-gate 	((!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
817c478bd9Sstevel@tonic-gate 	defined(_XOPEN_SOURCE)) || defined(__XPG4_CHAR_CLASS__)
827c478bd9Sstevel@tonic-gate #define	isascii(c)	(!(((int)(c)) & ~0177))
837c478bd9Sstevel@tonic-gate #define	toascii(c)	(((int)(c)) & 0177)
842d08521bSGarrett D'Amore #define	_toupper(c)	(toupper(c))
852d08521bSGarrett D'Amore #define	_tolower(c)	(tolower(c))
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || ((!defined(_STRICT_STDC) ... */
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate #endif	/* !defined(__lint) */
907c478bd9Sstevel@tonic-gate 
912d08521bSGarrett D'Amore #if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
922d08521bSGarrett D'Amore 
932d08521bSGarrett D'Amore #ifndef _LOCALE_T
942d08521bSGarrett D'Amore #define	_LOCALE_T
95732efd55SDan McDonald typedef struct _locale *locale_t;
962d08521bSGarrett D'Amore #endif
972d08521bSGarrett D'Amore 
982d08521bSGarrett D'Amore extern int isalnum_l(int, locale_t);
992d08521bSGarrett D'Amore extern int isalpha_l(int, locale_t);
1002d08521bSGarrett D'Amore extern int isblank_l(int, locale_t);
1012d08521bSGarrett D'Amore extern int iscntrl_l(int, locale_t);
1022d08521bSGarrett D'Amore extern int isdigit_l(int, locale_t);
1032d08521bSGarrett D'Amore extern int isgraph_l(int, locale_t);
1042d08521bSGarrett D'Amore extern int islower_l(int, locale_t);
1052d08521bSGarrett D'Amore extern int isprint_l(int, locale_t);
1062d08521bSGarrett D'Amore extern int ispunct_l(int, locale_t);
1072d08521bSGarrett D'Amore extern int isspace_l(int, locale_t);
1082d08521bSGarrett D'Amore extern int isupper_l(int, locale_t);
1092d08521bSGarrett D'Amore extern int isxdigit_l(int, locale_t);
1102ae3114cSRichard PALO extern int tolower_l(int, locale_t);
1112ae3114cSRichard PALO extern int toupper_l(int, locale_t);
1122d08521bSGarrett D'Amore 
1132d08521bSGarrett D'Amore #endif /* defined(_XPG7) || !defined(_STRICT_SYMBOLS) */
1142d08521bSGarrett D'Amore 
1157c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1167c478bd9Sstevel@tonic-gate }
1177c478bd9Sstevel@tonic-gate #endif
1187c478bd9Sstevel@tonic-gate 
1197c478bd9Sstevel@tonic-gate #endif	/* _CTYPE_H */
120