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 * 4. Neither the name of the University nor the names of its contributors 1952843Sphk * may be used to endorse or promote products derived from this software 2052843Sphk * without specific prior written permission. 2152843Sphk * 2252843Sphk * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2352843Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2452843Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2552843Sphk * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2652843Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2752843Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2852843Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2952843Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3052843Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3152843Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3252843Sphk * SUCH DAMAGE. 3352843Sphk * 3452843Sphk * $FreeBSD$ 3552843Sphk */ 3652843Sphk 3752843Sphk#ifndef _SYS_CTYPE_H_ 3852843Sphk#define _SYS_CTYPE_H_ 3952843Sphk 4055205Speter#ifdef _KERNEL 4152843Sphk 4252843Sphk#define isspace(c) ((c) == ' ' || ((c) >= '\t' && (c) <= '\r')) 4352843Sphk#define isascii(c) (((c) & ~0x7f) == 0) 4452843Sphk#define isupper(c) ((c) >= 'A' && (c) <= 'Z') 4552843Sphk#define islower(c) ((c) >= 'a' && (c) <= 'z') 4652843Sphk#define isalpha(c) (isupper(c) || islower(c)) 4752843Sphk#define isdigit(c) ((c) >= '0' && (c) <= '9') 4852843Sphk#define isxdigit(c) (isdigit(c) \ 4952843Sphk || ((c) >= 'A' && (c) <= 'F') \ 5052843Sphk || ((c) >= 'a' && (c) <= 'f')) 51107328Siwasaki#define isprint(c) ((c) >= ' ' && (c) <= '~') 5252843Sphk 5352843Sphk#define toupper(c) ((c) - 0x20 * (((c) >= 'a') && ((c) <= 'z'))) 5452843Sphk#define tolower(c) ((c) + 0x20 * (((c) >= 'A') && ((c) <= 'Z'))) 5552843Sphk 5655205Speter#endif 5752843Sphk#endif /* !_SYS_CTYPE_H_ */ 58