_ctype.h revision 4297a3b0d0a35d80f86fff155e288e885a100e6d
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens/*
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Copyright (c) 1989, 1993
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * The Regents of the University of California. All rights reserved.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * (c) UNIX System Laboratories, Inc.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * All or some portions of this file are derived from material licensed
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * to the University of California by American Telephone and Telegraph
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Co. or Unix System Laboratories, Inc. and are reproduced herein with
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * the permission of UNIX System Laboratories, Inc.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens *
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * This code is derived from software contributed to Berkeley by
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Paul Borman at Krystal Technologies.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens *
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Redistribution and use in source and binary forms, with or without
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * modification, are permitted provided that the following conditions
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * are met:
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * 1. Redistributions of source code must retain the above copyright
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * notice, this list of conditions and the following disclaimer.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * 2. Redistributions in binary form must reproduce the above copyright
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * notice, this list of conditions and the following disclaimer in the
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * documentation and/or other materials provided with the distribution.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * 3. Neither the name of the University nor the names of its contributors
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * may be used to endorse or promote products derived from this software
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * without specific prior written permission.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens *
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * SUCH DAMAGE.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens */
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens/*
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Copyright 2010 Nexenta Systems, Inc. All rights reserved.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Use is subject to license terms.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens */
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens#ifndef __CTYPE_H_
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens#define __CTYPE_H_
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens/*
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Please take careful note. It turns out that the _ISxxx macros
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * occupy the lower order byte, except for _ISGRAPH, _ISALPHA, and _ISPRINT.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * Those occupt 0x2000, 0x4000, and 0x8000. Now, noting *very* carefully,
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * it turns out that this leaves some gaps in the extended bits, which
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * are occupied by _E1 = phonogram, _E2 = ideogram, and _E3 = English.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * The *other* _Ex bits are reserved. We don't think these higher order
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * bits are baked into applications (because they haven't been used before),
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * so we believe it is safe to reuse them how we see fit.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens *
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * This makes it possible to define a single space which overlaps both the
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens * wctype types, and the ctype types.
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens */
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens#define _CTYPE_A _ISALPHA /* Alpha */
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens#define _CTYPE_C _ISCNTRL /* Control */
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens#define _CTYPE_D _ISDIGIT /* Digit */
45818ee124adeaaf947698996b4f4c722afc6d1fMatthew Ahrens#define _CTYPE_G _ISGRAPH /* Graph */
#define _CTYPE_L _ISLOWER /* Lower */
#define _CTYPE_P _ISPUNCT /* Punct */
#define _CTYPE_S _ISSPACE /* Space */
#define _CTYPE_U _ISUPPER /* Upper */
#define _CTYPE_X _ISXDIGIT /* X digit */
#define _CTYPE_B _ISBLANK /* Blank */
#define _CTYPE_R _ISPRINT /* Print */
#define _CTYPE_Q _E1 /* Phonogram */
#define _CTYPE_I _E2 /* Ideogram */
#define _CTYPE_E _E3 /* English (Solaris) */
#define _CTYPE_N _E4 /* Number */
#define _CTYPE_T _E5 /* Special */
/* These high order bits were never used for anything at all. */
#define _CTYPE_SW0 0x20000000U /* 0 width character */
#define _CTYPE_SW1 0x40000000U /* 1 width character */
#define _CTYPE_SW2 0x80000000U /* 2 width character */
#define _CTYPE_SW3 0xc0000000U /* 3 width character */
#define _CTYPE_SWM 0xe0000000U /* Mask for screen width data */
#define _CTYPE_SWS 30 /* Bits to shift to get width */
unsigned long ___runetype(int);
#endif /* !__CTYPE_H_ */