#ifndef __WCTYPE_LOADED #define __WCTYPE_LOADED #ifndef __WCTYPE_PROCESSED #define __WCTYPE_PROCESSED /**************************************************************************** ** ** - Wide Character classification and mapping utilities ** ***************************************************************************** ** ** Header introduced by Amendment 1 of the ISO C Standard ** ** Definitions in this header file may not be available on all versions of ** OpenVMS. See the DEC C Runtime Library reference manual for specifics. ** ***************************************************************************** ** ** Copyright 2005 Hewlett-Packard Development Company, L.P. ** ** Confidential computer software. Valid license from HP and/or ** its subsidiaries required for possession, use, or copying. ** ** Consistent with FAR 12.211 and 12.212, Commercial Computer Software, ** Computer Software Documentation, and Technical Data for Commercial ** Items are licensed to the U.S. Government under vendor's standard ** commercial license. ** ** Neither HP nor any of its subsidiaries shall be liable for technical ** or editorial errors or omissions contained herein. The information ** in this document is provided "as is" without warranty of any kind and ** is subject to change without notice. The warranties for HP products ** are set forth in the express limited warranty statements accompanying ** such products. Nothing herein should be construed as constituting an ** additional warranty. ** ***************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif /* ** For inline isw*() functions, this header is using some macros defined ** in header. For C++ compilation, instead of inclusion ** header, provide definitions here. */ #ifndef __NAMESPACE_STD /* ** All includes of other header files must be done prior to altering the ** pointer size mode. */ #include #elif !defined(__ctypet) # define __ctypet (decc$$ga___ctypet) # pragma __extern_model __save # pragma __extern_model __strict_refdef extern const unsigned int * __ctypet ; # pragma __extern_model __restore # define __UPPER 0x1 # define __LOWER 0x2 # define __DIGIT 0x4 # define __SPACE 0x8 # define __PUNCT 0x10 # define __CNTRL 0x20 # define __XDIGIT 0x40 # define __PRINT 0x80 # define __ALPHABET 0x100 # define __ALNUM 0x104 # define __GRAPH 0x200 # define __BLANK 0X400 #endif /* __NAMESPACE_STD */ /* ** If the user has used /pointer_size=short or /pointer_size=long, we will ** begin in a 32-bit pointer size context. */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 64 #endif #ifdef __NAMESPACE_STD namespace std { #endif /* ** Define typedefs only once per compilation */ #ifndef __WINT_T # define __WINT_T typedef __wint_t wint_t; #endif #ifndef __WCTRANS_T # define __WCTRANS_T typedef __wctrans_t wctrans_t; #endif #ifndef __WCTYPE_T # define __WCTYPE_T typedef __wctype_t wctype_t; #endif #ifdef __NAMESPACE_STD } /* namespace std */ #endif #ifndef WEOF # define WEOF ((__wint_t) -1) #endif /* ** According to XPG4, the following functions are defined in the ** header. Although the header doesn't exist in XPG4, we put these ** prototypes under "No strict XPG4" condition for the sake of a user, which ** includes both and (in header these ** declarations are placed under "strict XPG4 mode" condition). Also prevent ** macro expansion of isw* prototypes in cases where both and ** are included. */ #if (!defined _XOPEN_SOURCE || defined __HIDE_FORBIDDEN_NAMES) #ifdef __NAMESPACE_STD namespace std { #endif #ifdef __NAMESPACE_STD # pragma __extern_prefix __save # pragma __extern_prefix "CXXL$" #endif int (iswalnum) (__wint_t __wc); int (iswalpha) (__wint_t __wc); int (iswcntrl) (__wint_t __wc); int (iswdigit) (__wint_t __wc); int (iswgraph) (__wint_t __wc); int (iswlower) (__wint_t __wc); int (iswprint) (__wint_t __wc); int (iswpunct) (__wint_t __wc); int (iswspace) (__wint_t __wc); int (iswupper) (__wint_t __wc); int (iswxdigit) (__wint_t __wc); #ifdef __NAMESPACE_STD # pragma __extern_prefix __restore #endif __wctype_t wctype (const char *__property); int iswctype (__wint_t __wc, __wctype_t __desc); __wint_t towlower (__wint_t __wc); __wint_t towupper (__wint_t __wc); #ifdef __NAMESPACE_STD } /* namespace std */ #endif #endif /* (!defined _XOPEN_SOURCE || defined __HIDE_FORBIDDEN_NAMES) */ /* ** Throughout this header file, for a C++ compilation with __NAMESPACE_STD ** enabled, functions from ANSI C standard that are defined as macros in this ** header file, are defined as inline functions instead of macros. ** ** This is to comply with clause 17.4.1.2 Headers [lib.headers] of the C++ ** standard which says, in particular: -6- Names that are defined as functions in C shall be defined as functions in the C++ Standard Library.*) *) This disallows the practice, allowed in C, of providing a "masking macro" in addition to the function prototype. The only way to achieve equivalent "inline" behavior in C++ is to provide a definition as an extern inline function. */ # define __ISWALPHABET (iswalpha) # define __ISWCNTRL (iswcntrl) # define __ISWUPPER (iswupper) # define __ISWLOWER (iswlower) # define __ISWDIGIT (iswdigit) # define __ISWSPACE (iswspace) # define __ISWPUNCT (iswpunct) # define __ISWXDIGIT (iswxdigit) # define __ISWPRINT (iswprint) # define __ISWGRAPH (iswgraph) # define __ISWALNUM (iswalnum) #ifndef __NAMESPACE_STD /* ** Macro definitions */ # define __ISWFUNCTION(c,p) (__ctypea?__ctypet[(__wint_t)(c)]&__##p:__ISW##p(c)) # define iswcntrl(c) __ISWFUNCTION(c, CNTRL) # define iswalnum(c) __ISWFUNCTION(c, ALNUM) # define iswalpha(c) __ISWFUNCTION(c, ALPHABET) # define iswdigit(c) __ISWFUNCTION(c, DIGIT) # define iswgraph(c) __ISWFUNCTION(c, GRAPH) # define iswlower(c) __ISWFUNCTION(c, LOWER) # define iswprint(c) __ISWFUNCTION(c, PRINT) # define iswpunct(c) __ISWFUNCTION(c, PUNCT) # define iswspace(c) __ISWFUNCTION(c, SPACE) # define iswxdigit(c) __ISWFUNCTION(c, XDIGIT) # define iswupper(c) __ISWFUNCTION(c, UPPER) #else /* ** Inline functions */ /* ** isw*() functions are defined as macros in header. ** Undefine them, just in case. */ #undef iswalnum #undef iswalpha #undef iswcntrl #undef iswdigit #undef iswgraph #undef iswlower #undef iswprint #undef iswpunct #undef iswspace #undef iswupper #undef iswxdigit namespace std { #define __INLINE_ISWFUNCTION(c,p) { \ /* no need to check __ctypea on VMS V6.2 and above */ \ return (c == WEOF ? 0 : __ctypet[(unsigned int)(c)] & __##p); \ } inline int iswcntrl(wint_t c) __INLINE_ISWFUNCTION(c, CNTRL) inline int iswalnum(wint_t c) __INLINE_ISWFUNCTION(c, ALNUM) inline int iswalpha(wint_t c) __INLINE_ISWFUNCTION(c, ALPHABET) inline int iswdigit(wint_t c) __INLINE_ISWFUNCTION(c, DIGIT) inline int iswgraph(wint_t c) __INLINE_ISWFUNCTION(c, GRAPH) inline int iswlower(wint_t c) __INLINE_ISWFUNCTION(c, LOWER) inline int iswprint(wint_t c) __INLINE_ISWFUNCTION(c, PRINT) inline int iswpunct(wint_t c) __INLINE_ISWFUNCTION(c, PUNCT) inline int iswspace(wint_t c) __INLINE_ISWFUNCTION(c, SPACE) inline int iswxdigit(wint_t c) __INLINE_ISWFUNCTION(c, XDIGIT) inline int iswupper(wint_t c) __INLINE_ISWFUNCTION(c, UPPER) } /* namespace std */ #endif /* __NAMESPACE_STD */ #ifdef __NAMESPACE_STD namespace std { #endif __wctrans_t wctrans (const char *__property); __wint_t towctrans (__wint_t __wc, __wctrans_t __desc); #ifdef __NAMESPACE_STD } /* namespace std */ #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __WCTYPE_PROCESSED */ #if defined(__NAMESPACE_STD) && !defined(__NAMESPACE_STD_ONLY) # ifndef __USING_WCTYPE_NAMES # define __USING_WCTYPE_NAMES #if (!defined _XOPEN_SOURCE || defined __HIDE_FORBIDDEN_NAMES) using std::iswctype; using std::towlower; using std::towupper; using std::wctype; #endif using std::iswalnum; using std::iswalpha; using std::iswcntrl; using std::iswdigit; using std::iswgraph; using std::iswlower; using std::iswprint; using std::iswpunct; using std::iswspace; using std::iswupper; using std::iswxdigit; using std::towctrans; using std::wctrans; using std::wctrans_t; using std::wctype_t; using std::wint_t; # endif #endif #endif /* __WCTYPE_LOADED */