ctype.h revision 107328
152843Sphk/*- 252843Sphk * Copyright (c) 1982, 1988, 1991, 1993 352843Sphk * The Regents of the University of California. All rights reserved. 452843Sphk * (c) UNIX System Laboratories, Inc. 552843Sphk * All or some portions of this file are derived from material licensed 652843Sphk * to the University of California by American Telephone and Telegraph 752843Sphk * Co. or Unix System Laboratories, Inc. and are reproduced herein with 852843Sphk * the permission of UNIX System Laboratories, Inc. 952843Sphk * 1052843Sphk * Redistribution and use in source and binary forms, with or without 1152843Sphk * modification, are permitted provided that the following conditions 1252843Sphk * are met: 1352843Sphk * 1. Redistributions of source code must retain the above copyright 1452843Sphk * notice, this list of conditions and the following disclaimer. 1552843Sphk * 2. Redistributions in binary form must reproduce the above copyright 1652843Sphk * notice, this list of conditions and the following disclaimer in the 1752843Sphk * documentation and/or other materials provided with the distribution. 1852843Sphk * 3. All advertising materials mentioning features or use of this software 1952843Sphk * must display the following acknowledgement: 2052843Sphk * This product includes software developed by the University of 2152843Sphk * California, Berkeley and its contributors. 2252843Sphk * 4. Neither the name of the University nor the names of its contributors 2352843Sphk * may be used to endorse or promote products derived from this software 2452843Sphk * without specific prior written permission. 2552843Sphk * 2652843Sphk * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2752843Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2852843Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2952843Sphk * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 3052843Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3152843Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3252843Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3352843Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3452843Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3552843Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3652843Sphk * SUCH DAMAGE. 3752843Sphk * 3852843Sphk * $FreeBSD: head/sys/sys/ctype.h 107328 2002-11-27 18:09:20Z iwasaki $ 3952843Sphk */ 4052843Sphk 4152843Sphk#ifndef _SYS_CTYPE_H_ 4252843Sphk#define _SYS_CTYPE_H_ 4352843Sphk 4455205Speter#ifdef _KERNEL 4552843Sphk 4652843Sphk#define isspace(c) ((c) == ' ' || ((c) >= '\t' && (c) <= '\r')) 4752843Sphk#define isascii(c) (((c) & ~0x7f) == 0) 4852843Sphk#define isupper(c) ((c) >= 'A' && (c) <= 'Z') 4952843Sphk#define islower(c) ((c) >= 'a' && (c) <= 'z') 5052843Sphk#define isalpha(c) (isupper(c) || islower(c)) 5152843Sphk#define isdigit(c) ((c) >= '0' && (c) <= '9') 5252843Sphk#define isxdigit(c) (isdigit(c) \ 5352843Sphk || ((c) >= 'A' && (c) <= 'F') \ 5452843Sphk || ((c) >= 'a' && (c) <= 'f')) 55107328Siwasaki#define isprint(c) ((c) >= ' ' && (c) <= '~') 5652843Sphk 5752843Sphk#define toupper(c) ((c) - 0x20 * (((c) >= 'a') && ((c) <= 'z'))) 5852843Sphk#define tolower(c) ((c) + 0x20 * (((c) >= 'A') && ((c) <= 'Z'))) 5952843Sphk 6055205Speter#endif 6152843Sphk#endif /* !_SYS_CTYPE_H_ */ 62