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 /*      Copyright (c) 1988 AT&T     */
  23 /*        All Rights Reserved   */
  24 
  25 
  26 /*
  27  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  28  * Use is subject to license terms.
  29  */
  30 /*
  31  * Copyright 2013 Garrett D'Amore <garrett@damore.org>
  32  */
  33 
  34 /*
  35  * An application should not include this header directly.  Instead it
  36  * should be included only through the inclusion of other Sun headers.
  37  *
  38  * The contents of this header is limited to identifiers specified in the
  39  * C Standard.  Any new identifiers specified in future amendments to the
  40  * C Standard must be placed in this header.  If these new identifiers
  41  * are required to also be in the C++ Standard "std" namespace, then for
  42  * anything other than macro definitions, corresponding "using" directives
  43  * must also be added to <ctype.h>.
  44  */
  45 
  46 #ifndef _ISO_CTYPE_ISO_H
  47 #define _ISO_CTYPE_ISO_H
  48 
  49 #include <sys/feature_tests.h>
  50 
  51 #ifdef  __cplusplus
  52 extern "C" {
  53 #endif
  54 
  55 #define _U      0x00000001      /* Upper case */
  56 #define _L      0x00000002      /* Lower case */
  57 #define _N      0x00000004      /* Numeral (digit) */
  58 #define _S      0x00000008      /* Spacing character */
  59 #define _P      0x00000010      /* Punctuation */
  60 #define _C      0x00000020      /* Control character */
  61 #define _B      0x00000040      /* Blank */
  62 #define _X      0x00000080      /* heXadecimal digit */
  63 
  64 #define _ISUPPER        _U
  65 #define _ISLOWER        _L
  66 #define _ISDIGIT        _N
  67 #define _ISSPACE        _S
  68 #define _ISPUNCT        _P
  69 #define _ISCNTRL        _C
  70 #define _ISBLANK        _B
  71 #define _ISXDIGIT       _X
  72 #define _ISGRAPH        0x00002000
  73 #define _ISALPHA        0x00004000
  74 #define _ISPRINT        0x00008000
  75 #define _ISALNUM        (_ISALPHA | _ISDIGIT)
  76 
  77 extern unsigned char    __ctype[];
  78 extern unsigned int     *__ctype_mask;
  79 extern int              *__trans_upper;
  80 extern int              *__trans_lower;
  81 
  82 #if defined(__STDC__)
  83 
  84 #if __cplusplus >= 199711L
  85 namespace std {
  86 #endif
  87 
  88 /*
  89  * These used to be macros, which while more efficient, precludes operation
  90  * with thread specific locales.  The old macros will still work, but new
  91  * code compiles to use functions.  This is specifically permitted by the
  92  * various standards.  Only _tolower and _toupper were required to be
  93  * delivered in macro form.
  94  */
  95 extern int isalnum(int);
  96 extern int isalpha(int);
  97 extern int iscntrl(int);
  98 extern int isdigit(int);
  99 extern int isgraph(int);
 100 extern int islower(int);
 101 extern int isprint(int);
 102 extern int ispunct(int);
 103 extern int isspace(int);
 104 extern int isupper(int);
 105 extern int isxdigit(int);
 106 #if defined(_XPG6) || defined(_STDC_C99) || !defined(_STRICT_SYMBOLS)
 107 extern int isblank(int);
 108 #endif
 109 
 110 extern int tolower(int);
 111 extern int toupper(int);
 112 
 113 #if __cplusplus >= 199711L
 114 } /* end of namespace std */
 115 #endif
 116 
 117 #else   /* defined(__STDC__) */
 118 
 119 #if !defined(__lint)
 120 
 121 extern int isalpha();
 122 extern int isupper();
 123 extern int islower();
 124 extern int isdigit();
 125 extern int isxdigit();
 126 extern int isalnum();
 127 extern int isspace();
 128 extern int ispunct();
 129 extern int isprint();
 130 extern int isgraph();
 131 extern int iscntrl();
 132 extern int isblank();
 133 
 134 #endif  /* !defined(__lint) */
 135 
 136 #endif  /* defined(__STDC__) */
 137 
 138 #ifdef  __cplusplus
 139 }
 140 #endif
 141 
 142 #endif  /* _ISO_CTYPE_ISO_H */