xref: /netbsd-src/include/ctype.h (revision af730bf1c881198a395d035b8c468cbaa7916d14)
1*af730bf1Sjoerg /*	$NetBSD: ctype.h,v 1.35 2020/03/20 01:08:42 joerg Exp $	*/
24d2cbfceScgd 
3e6b5ddd9Scgd /*
4e6b5ddd9Scgd  * Copyright (c) 1989 The Regents of the University of California.
5e6b5ddd9Scgd  * All rights reserved.
6e6b5ddd9Scgd  * (c) UNIX System Laboratories, Inc.
7e6b5ddd9Scgd  * All or some portions of this file are derived from material licensed
8e6b5ddd9Scgd  * to the University of California by American Telephone and Telegraph
9e6b5ddd9Scgd  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10e6b5ddd9Scgd  * the permission of UNIX System Laboratories, Inc.
11e6b5ddd9Scgd  *
12e6b5ddd9Scgd  * Redistribution and use in source and binary forms, with or without
13e6b5ddd9Scgd  * modification, are permitted provided that the following conditions
14e6b5ddd9Scgd  * are met:
15e6b5ddd9Scgd  * 1. Redistributions of source code must retain the above copyright
16e6b5ddd9Scgd  *    notice, this list of conditions and the following disclaimer.
17e6b5ddd9Scgd  * 2. Redistributions in binary form must reproduce the above copyright
18e6b5ddd9Scgd  *    notice, this list of conditions and the following disclaimer in the
19e6b5ddd9Scgd  *    documentation and/or other materials provided with the distribution.
20039cc956Sagc  * 3. Neither the name of the University nor the names of its contributors
21e6b5ddd9Scgd  *    may be used to endorse or promote products derived from this software
22e6b5ddd9Scgd  *    without specific prior written permission.
23e6b5ddd9Scgd  *
24e6b5ddd9Scgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25e6b5ddd9Scgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26e6b5ddd9Scgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27e6b5ddd9Scgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28e6b5ddd9Scgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29e6b5ddd9Scgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30e6b5ddd9Scgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31e6b5ddd9Scgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32e6b5ddd9Scgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33e6b5ddd9Scgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34e6b5ddd9Scgd  * SUCH DAMAGE.
35e6b5ddd9Scgd  *
364d2cbfceScgd  *	@(#)ctype.h	5.3 (Berkeley) 4/3/91
37e6b5ddd9Scgd  */
38e6b5ddd9Scgd 
39e6b5ddd9Scgd #ifndef _CTYPE_H_
40e6b5ddd9Scgd #define _CTYPE_H_
41c903851aSkleink 
42e6b5ddd9Scgd #include <sys/cdefs.h>
433a344e27Sbjh21 #include <sys/featuretest.h>
44e6b5ddd9Scgd 
45e6b5ddd9Scgd __BEGIN_DECLS
4619b7469aSperry int	isalnum(int);
4719b7469aSperry int	isalpha(int);
4819b7469aSperry int	iscntrl(int);
4919b7469aSperry int	isdigit(int);
5019b7469aSperry int	isgraph(int);
5119b7469aSperry int	islower(int);
5219b7469aSperry int	isprint(int);
5319b7469aSperry int	ispunct(int);
5419b7469aSperry int	isspace(int);
5519b7469aSperry int	isupper(int);
5619b7469aSperry int	isxdigit(int);
5719b7469aSperry int	tolower(int);
5819b7469aSperry int	toupper(int);
59e6b5ddd9Scgd 
604e2459a9Sjoerg #if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
614e2459a9Sjoerg #  ifndef __LOCALE_T_DECLARED
624e2459a9Sjoerg typedef struct _locale		*locale_t;
634e2459a9Sjoerg #  define __LOCALE_T_DECLARED
644e2459a9Sjoerg #  endif
654e2459a9Sjoerg 
664e2459a9Sjoerg int	isalnum_l(int, locale_t);
674e2459a9Sjoerg int	isalpha_l(int, locale_t);
684e2459a9Sjoerg int	isblank_l(int, locale_t);
694e2459a9Sjoerg int	iscntrl_l(int, locale_t);
704e2459a9Sjoerg int	isdigit_l(int, locale_t);
714e2459a9Sjoerg int	isgraph_l(int, locale_t);
724e2459a9Sjoerg int	islower_l(int, locale_t);
734e2459a9Sjoerg int	isprint_l(int, locale_t);
744e2459a9Sjoerg int	ispunct_l(int, locale_t);
754e2459a9Sjoerg int	isspace_l(int, locale_t);
764e2459a9Sjoerg int	isupper_l(int, locale_t);
774e2459a9Sjoerg int	isxdigit_l(int, locale_t);
784e2459a9Sjoerg int	tolower_l(int, locale_t);
794e2459a9Sjoerg int	toupper_l(int, locale_t);
804e2459a9Sjoerg #endif
814e2459a9Sjoerg 
824be7a2dcSbjh21 #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
8319b7469aSperry int	isascii(int);
8419b7469aSperry int	toascii(int);
8519b7469aSperry int	_tolower(int);
8619b7469aSperry int	_toupper(int);
87e6b5ddd9Scgd #endif
88c903851aSkleink 
89*af730bf1Sjoerg #if (!defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
90*af730bf1Sjoerg     !defined(_XOPEN_SOURCE)) || ((_POSIX_C_SOURCE - 0) >= 200112L || \
91*af730bf1Sjoerg      defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
92*af730bf1Sjoerg      (__cplusplus - 0) >= 201103L || (_XOPEN_SOURCE - 0) > 600 || \
93*af730bf1Sjoerg      defined(_NETBSD_SOURCE))
9419b7469aSperry int	isblank(int);
95c903851aSkleink #endif
96e6b5ddd9Scgd __END_DECLS
97e6b5ddd9Scgd 
98a74df2a3Sjoerg #if defined(_NETBSD_SOURCE) && !defined(_CTYPE_NOINLINE) && \
99a74df2a3Sjoerg     !defined(__cplusplus)
1009a35d797Stnozaki #include <sys/ctype_inline.h>
101668d06e9Sjoerg #else
102668d06e9Sjoerg #include <sys/ctype_bits.h>
103c903851aSkleink #endif
104c903851aSkleink 
105e6b5ddd9Scgd #endif /* !_CTYPE_H_ */
106