#ifndef __WCHAR_LOADED #define __WCHAR_LOADED 1 #pragma __nostandard #include #if __CRTL_VER >= 60200000 /* Only OpenVMS V6.2 or later */ /**************************************************************************** ** ** - Wide Character ** ***************************************************************************** ** Header introduced by Amendment 1 of the ISO 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. ** ****************************************************************************** */ #ifdef __cplusplus extern "C" { #endif #include #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 #endif /* ** Declarations required both by XPG4 and ISO C Amendment */ #ifndef __SIZE_T # define __SIZE_T 1 typedef __size_t size_t; #endif #ifndef __WINT_T # define __WINT_T typedef __wint_t wint_t; #endif #ifndef __WCHAR_T # define __WCHAR_T typedef __wchar_t wchar_t; #endif #ifndef WEOF # define WEOF ((__wint_t) -1) #endif struct tm; /* ** Declarations required only by ISO C Amendment. Conflicts arising ** by compiling for both X/OPEN and the ISO C Amendment 1 resolve in ** favor of ISO C Amendment 1. */ #if __STDC_VERSION__ == 199409 || \ (__CRTL_VER >= 70000000 && !defined _XOPEN_SOURCE && !defined _DECC_V4_SOURCE) # ifndef WCHAR_MAX # define WCHAR_MAX ((__wchar_t)~0) # endif # ifndef WCHAR_MIN # define WCHAR_MIN 0 # endif # ifndef __MBSTATE_T # define __MBSTATE_T typedef struct { unsigned __f0 : 32; unsigned __f1 : 32; unsigned __f2 : 32; unsigned __f3 : 32; unsigned __f4 : 32; unsigned __f5 : 32; } mbstate_t; # endif #endif /* ** Create typedefs which are guaranteed to be short pointers. These same ** declarations may appear in other headers files and are protected. */ #ifndef NULL # define NULL __NULL #endif /* ** When compiling with /POINTER_SIZE, change to long pointers so that ** prototypes reflect the implementation for widened pointers. */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size 64 #endif /* ** Create 'private' typedefs that are sensitive to pointer size and must use ** long pointers. */ #if __STDC_VERSION__ == 199409 || \ (__CRTL_VER >= 70000000 && !defined _XOPEN_SOURCE && !defined _DECC_V4_SOURCE) # ifndef __MBSTATE_PTR64 # define __MBSTATE_PTR64 1 typedef mbstate_t * __mbstate_ptr64; # endif #endif /* ** According to the ISO C Amendment, the wide character classification ** functions and wide character mapping functions are defined in the new ** header, so the prototypes below are under "strict XPG4" ** condition. Prevent macro expansion of isw* prototypes in cases ** where both and are included. */ #if __CRTL_VER < 70000000 || defined _DECC_V4_SOURCE || \ defined _XOPEN_SOURCE || __STDC_VERSION__ != 199409 # ifndef __WCTYPE_T # define __WCTYPE_T typedef __wctype_t wctype_t; # 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); __wctype_t wctype(const char *__property); int iswctype(__wint_t __wc, __wctype_t __prop); __wint_t towlower(__wint_t __wc); __wint_t towupper(__wint_t __wc); # 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) # 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) #endif /* ** Functions which support both 32 bit and 64 bit pointers */ __wint_t fgetwc (__FILE * __stream); __wint_t fputwc (__wchar_t __c, __FILE * __stream); int fputws (const __wchar_t *__s, __FILE * __stream); __wint_t getwc (__FILE * __stream); __wint_t getwchar (void); __wint_t putwc (__wchar_t __c, __FILE * __stream); __wint_t putwchar (__wchar_t __c); __wint_t ungetwc (__wint_t __c, __FILE * __stream); int wcscmp (const __wchar_t *__ws1, const __wchar_t *__ws2); int wcscoll (const __wchar_t *__ws1, const __wchar_t *__ws2); __size_t wcscspn (const __wchar_t *__ws1, const __wchar_t *__ws2); __size_t wcslen (const __wchar_t *__ws); int wcsncmp (const __wchar_t *__ws1, const __wchar_t *__ws2, __size_t __n); __size_t wcsspn (const __wchar_t *__ws1, const __wchar_t *__ws2); __size_t wcsxfrm (__wchar_t *__ws1, const __wchar_t *__ws2, __size_t n); /* ** These two functions are defined by X/OPEN and not by the ** ISO C Amendment 1. Compiling for X/OPEN or on pre-OpenVMS 7.0 ** systems or for compatibility with pre-DEC C V5.2 provides ** these definitions. */ #if __CRTL_VER < 70000000 || defined _DECC_V4_SOURCE || \ defined _XOPEN_SOURCE || __STDC_VERSION__ != 199409 int wcswidth (const __wchar_t *__pwcs, __size_t __n); int wcwidth (__wchar_t __wc); #endif /* ** The following functions have interfaces of XXX, _XXX32, and _XXX64 due only ** to the fact that the return argument is a pointer that is relative to one ** of the arguments. */ #if __INITIAL_POINTER_SIZE == 32 #pragma __pointer_size 32 #endif __wchar_t *fgetws (__wchar_t *__s, int __n, __FILE * __stream); __wchar_t *wcscat (__wchar_t *__ws1, __const_wchar_ptr64 __ws2); __wchar_t *wcschr (const __wchar_t *__ws, __wchar_t __wc); __wchar_t *wcscpy (__wchar_t *__ws1, __const_wchar_ptr64 __ws2); __wchar_t *wcsncat (__wchar_t *__ws1, __const_wchar_ptr64 __ws2, __size_t __n); __wchar_t *wcsncpy (__wchar_t *__ws1, __const_wchar_ptr64 __ws2, __size_t __n); __wchar_t *wcspbrk (const __wchar_t *__ws1, __const_wchar_ptr64 __ws2); __wchar_t *wcsrchr (const __wchar_t *__ws, __wchar_t __wc); __wchar_t *wcswcs (const __wchar_t *__ws1, __const_wchar_ptr64 __ws2); double wcstod (const __wchar_t *__nptr, __wchar_t **__endptr); long int wcstol (const __wchar_t *__nptr, __wchar_t **__endptr, int __base); unsigned long wcstoul(const __wchar_t *__nptr, __wchar_t **__endptr, int __base); #if __INITIAL_POINTER_SIZE == 32 #pragma __pointer_size 64 #endif #if __INITIAL_POINTER_SIZE && !defined _ANSI_C_SOURCE # pragma __pointer_size 32 __wchar_t *_fgetws32 (__wchar_t *, int, __FILE *); __wchar_t *_wcscat32 (__wchar_t *, __const_wchar_ptr64); __wchar_t *_wcschr32 (const __wchar_t *, __wchar_t); __wchar_t *_wcscpy32 (__wchar_t *, __const_wchar_ptr64); __wchar_t *_wcsncat32 (__wchar_t *, __const_wchar_ptr64, __size_t); __wchar_t *_wcsncpy32 (__wchar_t *, __const_wchar_ptr64, __size_t); __wchar_t *_wcspbrk32 (const __wchar_t *, __const_wchar_ptr64); __wchar_t *_wcsrchr32 (const __wchar_t *, __wchar_t); __wchar_t *_wcswcs32 (const __wchar_t *, __const_wchar_ptr64); double _wcstod32 (const __wchar_t *, __wchar_t **); long int _wcstol32 (const __wchar_t *, __wchar_t **, int); unsigned long _wcstoul32 (const __wchar_t *, __wchar_t **, int); # pragma __pointer_size 64 __wchar_t *_fgetws64 (__wchar_t *, int, __FILE *); __wchar_t *_wcscat64 (__wchar_t *, const __wchar_t *); __wchar_t *_wcschr64 (const __wchar_t *, __wchar_t); __wchar_t *_wcscpy64 (__wchar_t *, const __wchar_t *); __wchar_t *_wcsncat64 (__wchar_t *, const __wchar_t *, __size_t); __wchar_t *_wcsncpy64 (__wchar_t *, const __wchar_t *, __size_t); __wchar_t *_wcspbrk64 (const __wchar_t *, const __wchar_t *); __wchar_t *_wcsrchr64 (const __wchar_t *, __wchar_t); __wchar_t *_wcswcs64 (const __wchar_t *, const __wchar_t *); double _wcstod64 (const __wchar_t *, __wchar_t **); long int _wcstol64 (const __wchar_t *, __wchar_t **, int); unsigned long _wcstoul64 (const __wchar_t *, __wchar_t **, int); #endif /* ** The ISO C Amendment 1 and XPG4 specification define wcsftime() and ** wcstok() slightly differently. The default or compiling for the ** ISO C Amendment 1 provide the ISO C Amendment 1 definitions. Compiling ** for X/OPEN or on pre-OpenVMS 7.0 systems or for compatibility with ** pre-DEC C Version 5.2 provides the XPG4 definitions. Conflicts arising ** by compiling for both X/OPEN and the ISO C Amendment 1 resolve in favor ** of ISO C Amendment 1. */ #if (__CRTL_VER >= 70000000 && __STDC_VERSION__ == 199409) || \ (__CRTL_VER >= 70000000 && !defined _XOPEN_SOURCE && !defined _DECC_V4_SOURCE) /* ** ISO C Amendment definitions */ # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__pdam_" # else # define wcstok __pdam_wcstok # endif # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 32 # endif __wchar_t * wcstok (__wchar_t *__ws1, __const_wchar_ptr64 __ws2, __wchar_t **__ws3); # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 64 # endif # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif # if __INITIAL_POINTER_SIZE && !defined _ANSI_C_SOURCE # pragma __pointer_size 32 __wchar_t *___pdam_wcstok32(__wchar_t *__ws1, __const_wchar_ptr64 __ws2, __wchar_t **__ws3); # pragma __pointer_size 64 __wchar_t *___pdam_wcstok64(__wchar_t *__ws1, __const_wchar_ptr64 __ws2, __wchar_t **__ws3); # endif #else /* ** XPG4 definitions */ # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 32 # endif __wchar_t * wcstok (__wchar_t *__ws1, __const_wchar_ptr64 __ws2); # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 64 # endif # if __INITIAL_POINTER_SIZE && !defined _ANSI_C_SOURCE # pragma __pointer_size 32 __wchar_t *_wcstok32(__wchar_t *__ws1, __const_wchar_ptr64 __ws2); # pragma __pointer_size 64 __wchar_t *_wcstok64(__wchar_t *__ws1, __const_wchar_ptr64 __ws2); # endif #endif /* wcstok() ISO/XPG4 definitions */ #if (__CRTL_VER >= 70000000 && __STDC_VERSION__ == 199409) || \ (__CRTL_VER >= 70000000 && !defined _XOPEN_SOURCE && !defined _DECC_V4_SOURCE) /* ** ISO C Amendment definitions */ # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__utc_pdam_" # else # define wcsftime(__p1,__p2,__p3,__p4) __utc_pdam_wcsftime(__p1,__p2,__p3,__p4) # endif # else # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__pdam_" # else # define wcsftime(__p1,__p2,__p3,__p4) __pdam_wcsftime(__p1,__p2,__p3,__p4) # endif # endif __size_t wcsftime (__wchar_t *__wcs, __size_t __maxsize, const __wchar_t *__fmt, const struct tm *__timptr); # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif #else /* ** XPG4 definitions */ #if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __save # pragma __extern_prefix "__utc_" # else # define wcsftime(__p1,__p2,__p3,__p4) __utc_wcsftime(__p1,__p2,__p3,__p4) # endif # endif #endif /* __CRTL_VER >= 70000000 */ __size_t wcsftime (__wchar_t *__wcs, __size_t __maxsize, const char *__fmt, const struct tm *__timptr); #if __CRTL_VER >= 70000000 # if !defined _VMS_V6_SOURCE # ifdef __CAN_USE_EXTERN_PREFIX # pragma __extern_prefix __restore # endif # endif #endif #endif /* wcsftime() ISO/XPG4 definitions */ /* ** Macro definitions */ #define getwc(fp) fgetwc(fp) #define getwchar() fgetwc(stdin) #define putwc(c,fp) fputwc(c,fp) #define putwchar(c) fputwc(c,stdout) /* ** The following function prototypes are new with the ISO C Amendment. ** Conflicts arising by compiling for both X/OPEN and the ISO C Amendment 1 ** resolve in favor of ISO C Amendment 1. */ #if __CRTL_VER >= 70000000 # if __STDC_VERSION__ == 199409 || \ (!defined _XOPEN_SOURCE && !defined _DECC_V4_SOURCE) int fwide (__FILE * __stream, int mode); int fwprintf (__FILE * __stream, const __wchar_t *__format, ...); int fwscanf (__FILE * __stream, const __wchar_t *__format, ...); int swprintf (__wchar_t *s, __size_t n, const __wchar_t *__format, ...); int swscanf (const __wchar_t *__s, const __wchar_t *__format, ...); int vfwprintf (__FILE * __stream, const __wchar_t *__format, __va_list __arg); int vwprintf (const __wchar_t *__format, __va_list __arg); int vswprintf (__wchar_t *s, __size_t n, const __wchar_t *__format, __va_list __arg); int wprintf (const __wchar_t *__format, ...); int wscanf (const __wchar_t *__format, ...); __wint_t btowc (int __c); int wctob (__wint_t __c); int mbsinit (const mbstate_t *__ps); __size_t mbrlen (const char *__s, __size_t __n, mbstate_t *__ps); __size_t mbrtowc (__wchar_t *__pwc, const char *__s, __size_t __n, mbstate_t *__ps); __size_t wcrtomb (char *__s, __wchar_t __wc, mbstate_t *__ps); int wmemcmp (const __wchar_t *__s1, const __wchar_t *__s2, __size_t __n); /* ** The following functions have interfaces of XXX, _XXX32, and _XXX64 due ** only to the fact that the return argument is a pointer that is relative ** to one of the arguments. */ # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 32 # endif __wchar_t *wcsstr (const __wchar_t *__ws1, __const_wchar_ptr64 __ws2); __wchar_t *wmemchr (const __wchar_t *__s, __wchar_t __c, __size_t __n); __wchar_t *wmemcpy (__wchar_t *__s1, __const_wchar_ptr64 __s2, __size_t __n); __wchar_t *wmemmove (__wchar_t *__s1, __const_wchar_ptr64 __s2, __size_t __n); __wchar_t *wmemset (__wchar_t *__s1, __wchar_t __c, __size_t __n); __size_t mbsrtowcs (__wchar_ptr64 __dst, const char **__src, __size_t __len, __mbstate_ptr64 __ps); __size_t wcsrtombs ( __char_ptr64 __dst, const __wchar_t **__src, __size_t __len, __mbstate_ptr64 __ps); # if __INITIAL_POINTER_SIZE == 32 # pragma __pointer_size 64 # endif # if __INITIAL_POINTER_SIZE && !defined _ANSI_C_SOURCE # pragma __pointer_size 32 __wchar_t *_wcsstr32 (const __wchar_t *, __const_wchar_ptr64); __wchar_t *_wmemchr32 (const __wchar_t *, __wchar_t, __size_t); __wchar_t *_wmemcpy32 (__wchar_t *, __const_wchar_ptr64, __size_t); __wchar_t *_wmemmove32 (__wchar_t *, __const_wchar_ptr64, __size_t); __wchar_t *_wmemset32 (__wchar_t *, __wchar_t, __size_t); __size_t _mbsrtowcs32 (__wchar_ptr64, const char **, __size_t, __mbstate_ptr64); __size_t _wcsrtombs32 (__char_ptr64, const __wchar_t **, __size_t, __mbstate_ptr64); # pragma __pointer_size 64 __wchar_t *_wcsstr64 (const __wchar_t *, const __wchar_t *); __wchar_t *_wmemchr64 (const __wchar_t *, __wchar_t, __size_t); __wchar_t *_wmemcpy64 (__wchar_t *, const __wchar_t *, __size_t); __wchar_t *_wmemmove64 (__wchar_t *, const __wchar_t *, __size_t); __wchar_t *_wmemset64 (__wchar_t *, __wchar_t, __size_t); __size_t _mbsrtowcs64 (__wchar_t *, const char **, __size_t, mbstate_t *); __size_t _wcsrtombs64 (char *, const __wchar_t **, __size_t, mbstate_t *); # endif # endif #endif /* ** Restore the users pointer context */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __restore #endif #ifdef __cplusplus } #endif #endif /* OpenVMS V6.2 or later */ #pragma __standard #endif /* __WCHAR_LOADED */