1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22/* wctype.h 1.13 89/11/02 SMI; JLE */ 23/* from AT&T JAE 2.1 */ 24/* definitions for international functions */ 25 26/* 27 * Copyright 2003 Sun Microsystems, Inc. All rights reserved. 28 * Use is subject to license terms. 29 */ 30 31#ifndef _WCTYPE_H 32#define _WCTYPE_H 33 34#pragma ident "%Z%%M% %I% %E% SMI" 35 36#include <iso/wctype_iso.h> 37#if !defined(__XOPEN_OR_POSIX) && !defined(_STRICT_STDC) || \ 38 defined(__EXTENSIONS__) 39#include <ctype.h> 40#include <wchar.h> 41#endif 42 43/* 44 * Allow global visibility for symbols defined in 45 * C++ "std" namespace in <iso/wctype_iso.h>. 46 */ 47#if __cplusplus >= 199711L 48using std::wint_t; 49using std::wctrans_t; 50using std::iswalnum; 51using std::iswalpha; 52using std::iswcntrl; 53using std::iswdigit; 54using std::iswgraph; 55using std::iswlower; 56using std::iswprint; 57using std::iswpunct; 58using std::iswspace; 59using std::iswupper; 60using std::iswxdigit; 61using std::towlower; 62using std::towupper; 63using std::wctrans; 64using std::towctrans; 65using std::iswctype; 66using std::wctype; 67#endif 68 69/* 70 * This header needs to be included here because it relies on the global 71 * visibility of wint_t in the C++ environment. 72 */ 73 74#include <iso/wctype_c99.h> 75 76#ifdef __cplusplus 77extern "C" { 78#endif 79 80/* do not allow any of the following in a strictly conforming application */ 81#if !defined(__XOPEN_OR_POSIX) && !defined(_STRICT_STDC) || \ 82 defined(__EXTENSIONS__) 83 84/* 85 * data structure for supplementary code set 86 * for character class and conversion 87 */ 88struct _wctype { 89 wchar_t tmin; /* minimum code for wctype */ 90 wchar_t tmax; /* maximum code for wctype */ 91 unsigned char *index; /* class index */ 92 unsigned int *type; /* class type */ 93 wchar_t cmin; /* minimum code for conversion */ 94 wchar_t cmax; /* maximum code for conversion */ 95 wchar_t *code; /* conversion code */ 96}; 97 98/* character classification functions */ 99 100/* iswascii is still a macro */ 101#define iswascii(c) isascii(c) 102 103/* isw*, except iswascii(), are not macros any more. They become functions */ 104#ifdef __STDC__ 105 106extern unsigned _iswctype(wchar_t, int); 107extern wchar_t _trwctype(wchar_t, int); 108/* is* also become functions */ 109extern int isphonogram(wint_t); 110extern int isideogram(wint_t); 111extern int isenglish(wint_t); 112extern int isnumber(wint_t); 113extern int isspecial(wint_t); 114#else 115 116extern unsigned _iswctype(); 117extern wchar_t _trwctype(); 118/* is* also become functions */ 119extern int isphonogram(); 120extern int isideogram(); 121extern int isenglish(); 122extern int isnumber(); 123extern int isspecial(); 124#endif 125 126#define iscodeset0(c) isascii(c) 127#define iscodeset1(c) (((c) & WCHAR_CSMASK) == WCHAR_CS1) 128#define iscodeset2(c) (((c) & WCHAR_CSMASK) == WCHAR_CS2) 129#define iscodeset3(c) (((c) & WCHAR_CSMASK) == WCHAR_CS3) 130 131#endif /* !defined(__XOPEN_OR_POSIX)... */ 132 133#ifdef __cplusplus 134} 135#endif 136 137#endif /* _WCTYPE_H */ 138