#ifndef __CTYPE_LOADED #define __CTYPE_LOADED /**************************************************************************** ** ** - Character Type Classification Macros/Routines ** ***************************************************************************** ** Header introduced by the ANSI C Standard ***************************************************************************** ** ** Copyright 2000 Compaq Computer Corporation ** ** Compaq and the Compaq logo Registered in U.S. Patent and Trademark Office. ** ** Confidential computer software. Valid license from Compaq 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. ** ****************************************************************************** */ #pragma __nostandard #include #ifdef __cplusplus extern "C" { #endif /* ** 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 32 #endif /* ** 4.3.1 Character Testing Functions */ int isalnum (int); int isalpha (int); int iscntrl (int); int isdigit (int); int isgraph (int); int islower (int); int isprint (int); int ispunct (int); int isspace (int); int isupper (int); int isxdigit (int); /* ** 4.3.2 Character Case Mapping Functions */ int tolower (int); int toupper (int); /****************************************************************************** ** ** OpenVMS V6.2 and later ** ******************************************************************************/ #if __CRTL_VER >= 60200000 # define __ctypet (decc$$ga___ctypet) # define __ctypea (decc$$gl___ctypea) # define __isclocale (decc$$gl___isclocale) # pragma __extern_model __save # pragma __extern_model __strict_refdef /* ** Classmask array __ctypet is declared as a pointer in order ** to prevent BADSUBSCRIPT message which otherwise would be ** issued by the compiler when one of the is* functions is called ** with EOF and, accordingly, __ISFUNCTION macro below expands ** into __ctypet[-1] */ extern const unsigned int * __ctypet ; extern int __ctypea ; extern int __isclocale ; # 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 # define __ISALPHABET (isalpha) # define __ISCNTRL (iscntrl) # define __ISUPPER (isupper) # define __ISLOWER (islower) # define __ISDIGIT (isdigit) # define __ISSPACE (isspace) # define __ISPUNCT (ispunct) # define __ISXDIGIT (isxdigit) # define __ISPRINT (isprint) # define __ISGRAPH (isgraph) # define __ISALNUM (isalnum) # define __ISFUNCTION(c,p) (__ctypea?__ctypet[(int)(c)]&__##p:__IS##p(c)) # define iscntrl(c) __ISFUNCTION(c, CNTRL) # define isalnum(c) __ISFUNCTION(c, ALNUM) # define isalpha(c) __ISFUNCTION(c, ALPHABET) # define isdigit(c) __ISFUNCTION(c, DIGIT) # define isgraph(c) __ISFUNCTION(c, GRAPH) # define islower(c) __ISFUNCTION(c, LOWER) # define isprint(c) __ISFUNCTION(c, PRINT) # define ispunct(c) __ISFUNCTION(c, PUNCT) # define isspace(c) __ISFUNCTION(c, SPACE) # define isxdigit(c) __ISFUNCTION(c, XDIGIT) # define isupper(c) __ISFUNCTION(c, UPPER) # define __IS_LOWER(c) (((c) >= 'a' && (c) <= 'z')?1:0) # define __IS_UPPER(c) (((c) >= 'A' && (c) <= 'Z')?1:0) /* ** X/Open extensions */ # if defined(_XOPEN_SOURCE) || !defined(_ANSI_C_SOURCE) # define _toupper(c) (__isclocale? (__IS_LOWER(c) ? (c) & 0xDF: (c)): (toupper)(c)) # define _tolower(c) (__isclocale? (__IS_UPPER(c) ? (c) | 0x20: (c)): (tolower)(c)) int isascii (int); int toascii (int); # define isascii(c) ((unsigned)(c) <= 0x7F) # define toascii(c) ((c) & 0x7F) # endif #endif /****************************************************************************** ** ** Prior to OpenVMS V6.2 ** ******************************************************************************/ #if __CRTL_VER < 60200000 # define __ctype (*decc$ga___ctype) # pragma __extern_model __save # pragma __extern_model __strict_refdef extern const char __ctype []; # pragma __extern_model __restore # define _U 0x1 # define _L 0x2 # define _D 0x4 # define _S 0x8 # define _P 0x10 # define _C 0x20 # define _X 0x40 # define _B 0x80 # ifdef __DECC # pragma __message __save # pragma __message __disable (__CHECK) # endif static int __iscntrl (int __c) { /* Check explicitly for EOF */ return __c < 0 ? 0 : __ctype [__c & 0xFF] & _C; } # define iscntrl __iscntrl # ifdef __DECC # pragma __message __restore # endif # define isalnum(c) (__ctype [(c) & 0xFF] & (_U | _L | _D)) # define isalpha(c) (__ctype [(c) & 0xFF] & (_U | _L)) # define isdigit(c) (__ctype [(c) & 0xFF] & _D) # define isgraph(c) (__ctype [(c) & 0xFF] & (_P | _U | _L | _D)) # define islower(c) (__ctype [(c) & 0xFF] & _L) # define isprint(c) (__ctype [(c) & 0xFF] & (_P | _U | _L | _D | _B)) # define ispunct(c) (__ctype [(c) & 0xFF] & _P) # define isspace(c) (__ctype [(c) & 0xFF] & _S) # define isupper(c) (__ctype [(c) & 0xFF] & _U) # define isxdigit(c) (__ctype [(c) & 0xFF] & _X) /* ** X/Open extensions */ # if defined(_XOPEN_SOURCE) || !defined(_ANSI_C_SOURCE) # define _ctype_ __ctype int isascii (int); # define isascii(c) ((unsigned)(c) <= 0x7F) # define toascii(c) ((c) & 0x7F) # define _toupper(c) (((c) >= 'a' && (c) <= 'z') ? (c) & 0xDF : (c)) # define _tolower(c) (((c) >= 'A' && (c) <= 'Z') ? (c) | 0x20 : (c)) # endif #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __CTYPE_LOADED */