14f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta/*-
24f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * Copyright (c) 1982, 1988, 1991, 1993
34f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta *	The Regents of the University of California.  All rights reserved.
44f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * (c) UNIX System Laboratories, Inc.
54f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * All or some portions of this file are derived from material licensed
64f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * to the University of California by American Telephone and Telegraph
74f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * Co. or Unix System Laboratories, Inc. and are reproduced herein with
84f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * the permission of UNIX System Laboratories, Inc.
94f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta *
104f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * Redistribution and use in source and binary forms, with or without
114f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * modification, are permitted provided that the following conditions
124f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * are met:
134f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * 1. Redistributions of source code must retain the above copyright
144f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta *    notice, this list of conditions and the following disclaimer.
154f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * 2. Redistributions in binary form must reproduce the above copyright
164f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta *    notice, this list of conditions and the following disclaimer in the
174f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta *    documentation and/or other materials provided with the distribution.
184f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * 4. Neither the name of the University nor the names of its contributors
194f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta *    may be used to endorse or promote products derived from this software
204f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta *    without specific prior written permission.
214f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta *
224f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
234f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
244f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
254f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
264f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
274f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
284f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
294f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
304f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
314f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
324f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * SUCH DAMAGE.
334f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta *
344f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta * $FreeBSD$
354f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta */
364f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta
374f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta/*
38e83b0cadc67882c1ba7f430d16dab80c9b3a0228Dan Handley * Portions copyright (c) 2009-2014, ARM Limited and Contributors.
39c81b1d0f0333eca2bc01e718bd2a1b091647afbaHarry Liebel * All rights reserved.
404f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta */
414f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta
424f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#ifndef _SYS_CTYPE_H_
434f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#define	_SYS_CTYPE_H_
444f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta
454f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#define isspace(c)	((c) == ' ' || ((c) >= '\t' && (c) <= '\r'))
464f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#define isascii(c)	(((c) & ~0x7f) == 0)
474f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#define isupper(c)	((c) >= 'A' && (c) <= 'Z')
484f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#define islower(c)	((c) >= 'a' && (c) <= 'z')
494f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#define isalpha(c)	(isupper(c) || islower(c))
504f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#define isdigit(c)	((c) >= '0' && (c) <= '9')
514f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#define isxdigit(c)	(isdigit(c) \
524f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta			  || ((c) >= 'A' && (c) <= 'F') \
534f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta			  || ((c) >= 'a' && (c) <= 'f'))
544f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#define isprint(c)	((c) >= ' ' && (c) <= '~')
554f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta
564f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#define toupper(c)	((c) - 0x20 * (((c) >= 'a') && ((c) <= 'z')))
574f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#define tolower(c)	((c) + 0x20 * (((c) >= 'A') && ((c) <= 'Z')))
584f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta
594f6ad66ae9fcc8bcb3b0fcee10b7ab1ffcaf1a5Achin Gupta#endif /* !_SYS_CTYPE_H_ */
60