/* Copyright 07/20/98 Sun Microsystems, Inc. All Rights Reserved */ #if !defined(__STD_CWCHAR) && !defined(__STD_WCHAR_H) #define __STD_CWCHAR #include #include #include #if (!defined(_MSE_INT_H)) /* not XPG4 and not XPG4v2 */ #if (!(defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4))) #ifdef __PRAGMA_REDEFINE_EXTNAME #pragma redefine_extname fgetwc __fgetwc_xpg5 #pragma redefine_extname getwc __getwc_xpg5 #pragma redefine_extname getwchar __getwchar_xpg5 #pragma redefine_extname fputwc __fputwc_xpg5 #pragma redefine_extname putwc __putwc_xpg5 #pragma redefine_extname putwchar __putwchar_xpg5 #pragma redefine_extname fgetws __fgetws_xpg5 #pragma redefine_extname fputws __fputws_xpg5 #pragma redefine_extname ungetwc __ungetwc_xpg5 #else /* __PRAGMA_REDEFINE_EXTNAME */ extern wint_t __fgetwc_xpg5(__FILE *); extern wint_t __getwc_xpg5(__FILE *); extern wint_t __getwchar_xpg5(void); extern wint_t __fputwc_xpg5(wint_t, __FILE *); extern wint_t __putwc_xpg5(wint_t, __FILE *); extern wint_t __putwchar_xpg5(wint_t); extern wchar_t *__fgetws_xpg5(wchar_t *, int, __FILE *); extern int __fputws_xpg5(const wchar_t *, __FILE *); extern wint_t __ungetwc_xpg5(wint_t, __FILE *); #define fgetwc __fgetwc_xpg5 #define getwc __getwc_xpg5 #define getwchar __getwchar_xpg5 #define fputwc __fputwc_xpg5 #define putwc __putwc_xpg5 #define putwchar __putwchar_xpg5 #define fgetws __fgetws_xpg5 #define fputws __fputws_xpg5 #define ungetwc __ungetwc_xpg5 #endif /* __PRAGMA_REDEFINE_EXTNAME */ #endif /* not XPG4 and not XPG4v2 */ #endif /* defined(_MSE_INT_H) */ #ifndef NULL #if defined(_LP64) && !defined(__cplusplus) #define NULL 0L #else #define NULL 0 #endif #endif /* !NULL */ #ifndef WEOF #define WEOF ((wint_t) (-1)) #endif /* not XPG4 and not XPG4v2 */ #if (!(defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4))) #ifndef WCHAR_MAX #define WCHAR_MAX 2147483647 #endif #ifndef WCHAR_MIN #define WCHAR_MIN (-2147483647-1) #endif #endif /* not XPG4 and not XPG4v2 */ namespace std { // C++ Standard functions and types extern "C" { #if defined(_LP64) typedef int wint_t; #else typedef long wint_t; #endif #if defined(_LP64) || defined(_I32LPx) typedef unsigned long size_t; /* size of something in bytes */ #else typedef unsigned int size_t; /* (historical version) */ #endif #if !defined(__SunOS_5_4) && !defined(__SunOS_5_5) && !defined(__SunOS_5_5_1) && !defined(__SunOS_5_6) #ifndef _MBSTATET_H typedef struct { #if defined(_LP64) long __filler[4]; #else int __filler[6]; #endif } __mbstate_t; #endif /* __MBSTATET_H */ #ifndef _MBSTATE_T #define _MBSTATE_T typedef __mbstate_t mbstate_t; #endif /* _MBSTATE_T */ #endif /* !defined(__SunOS_5_5_1) && !defined(__SunOS_5_6) */ // from time.h #ifndef _STRUCT_TM #define _STRUCT_TM struct tm { /* see ctime(3) */ int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; #endif // from stdio.h #ifndef _STRUCT_FILE #define _STRUCT_FILE struct __FILE /* needs to be binary-compatible with old versions */ { #ifdef _STDIO_REVERSE unsigned char *_ptr; /* next character from/to here in buffer */ int _cnt; /* number of available characters in buffer */ #else int _cnt; /* number of available characters in buffer */ unsigned char *_ptr; /* next character from/to here in buffer */ #endif unsigned char *_base; /* the buffer */ unsigned char _flag; /* the state of the stream */ unsigned char _file; /* UNIX System file descriptor */ }; typedef __FILE FILE; #endif #if !defined(__SunOS_5_4) && !defined(__SunOS_5_5) && !defined(__SunOS_5_5_1) && !defined(__SunOS_5_6) int fprintf(FILE *, const char *, ...); int fscanf(FILE *, const char *, ...); #endif /* !defined(__SunOS_5_5_1) && !defined(__SunOS_5_6) */ wint_t fgetwc(__FILE *); wchar_t *fgetws(wchar_t *, int, __FILE *); wint_t fputwc(wint_t, __FILE *); int fputws(const wchar_t *, __FILE *); wint_t ungetwc(wint_t, __FILE *); wint_t getwc(__FILE *); wint_t getwchar(void); wint_t putwc(wint_t, __FILE *); wint_t putwchar(wint_t); double wcstod(const wchar_t *, wchar_t **); long wcstol(const wchar_t *, wchar_t **, int); unsigned long wcstoul(const wchar_t *, wchar_t **, int); wchar_t *wcscat(wchar_t *, const wchar_t *); wchar_t *wcschr(wchar_t *, wchar_t); int wcscmp(const wchar_t *, const wchar_t *); int wcscoll(const wchar_t *, const wchar_t *); wchar_t *wcscpy(wchar_t *, const wchar_t *); size_t wcscspn(const wchar_t *, const wchar_t *); size_t wcslen(const wchar_t *); wchar_t *wcsncat(wchar_t *, const wchar_t *, size_t); int wcsncmp(const wchar_t *, const wchar_t *, size_t); wchar_t *wcsncpy(wchar_t *, const wchar_t *, size_t); wchar_t *wcspbrk(wchar_t *, const wchar_t *); wchar_t *wcsrchr(wchar_t *, wchar_t); size_t wcsspn(const wchar_t *, const wchar_t *); wchar_t *wcswcs(const wchar_t *, const wchar_t *); int wcswidth(const wchar_t *, size_t); size_t wcsxfrm(wchar_t *, const wchar_t *, size_t); int wcwidth(const wchar_t); //wctype_t wctype(const char *); #if (!defined(_MSE_INT_H)) #if (defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4)) /* XPG4 or XPG4v2 */ wchar_t *wcstok(wchar_t *, const wchar_t *); size_t wcsftime(wchar_t *, size_t, const char *, const struct tm *); #else /* XPG4 or XPG4v2 */ #ifdef __PRAGMA_REDEFINE_EXTNAME wchar_t *wcstok(wchar_t *, const wchar_t *, wchar_t **); size_t wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *); #pragma redefine_extname wcstok __wcstok_xpg5 #pragma redefine_extname wcsftime __wcsftime_xpg5 #else /* __PRAGMA_REDEFINE_EXTNAME */ wchar_t *__wcstok_xpg5(wchar_t *, const wchar_t *, wchar_t **); size_t __wcsftime_xpg5(wchar_t *, size_t, const wchar_t *, const struct tm *); #define wcstok __wcstok_xpg5 #define wcsftime __wcsftime_xpg5 #endif /* __PRAGMA_REDEFINE_EXTNAME */ #endif /* XPG4 or XPG4v2 */ #endif /* !defined(_MSE_INT_H) */ #if !defined(__SunOS_5_4) && !defined(__SunOS_5_5) && !defined(__SunOS_5_5_1) && !defined(__SunOS_5_6) /* not XPG4 and not XPG4v2 */ #if (!(defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4))) wint_t btowc(int); int fwprintf(__FILE *, const wchar_t *, ...); int fwscanf(__FILE *, const wchar_t *, ...); int fwide(__FILE *, int); int mbsinit(const mbstate_t *); size_t mbrlen(const char *, size_t, mbstate_t *); size_t mbrtowc(wchar_t *, const char *, size_t, mbstate_t *); size_t mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *); int swprintf(wchar_t *, size_t, const wchar_t *, ...); int swscanf(const wchar_t *, const wchar_t *, ...); int vfwprintf(__FILE *, const wchar_t *, __va_list); int vwprintf(const wchar_t *, __va_list); int vswprintf(wchar_t *, size_t, const wchar_t *, __va_list); size_t wcrtomb(char *, wchar_t, mbstate_t *); size_t wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *); wchar_t *wcsstr(wchar_t *, const wchar_t *); int wctob(wint_t); wchar_t *wmemchr(wchar_t *, wchar_t, size_t); int wmemcmp(const wchar_t *, const wchar_t *, size_t); wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t); wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); wchar_t *wmemset(wchar_t *, wchar_t, size_t); int wprintf(const wchar_t *, ...); int wscanf(const wchar_t *, ...); #endif /* not XPG4 and not XPG4v2 */ #endif /* !defined(__SunOS_5_5_1) && !defined(__SunOS_5_6) */ } /* extern "C" */ // required by the C++ standard extern const wchar_t *wcschr(const wchar_t *, wchar_t); extern const wchar_t *wcspbrk(const wchar_t *, const wchar_t *); extern const wchar_t *wcsrchr(const wchar_t *, wchar_t); #if (!(defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4))) && !defined(__SunOS_5_4) && !defined(__SunOS_5_5) && !defined(__SunOS_5_5_1) && !defined(__SunOS_5_6) extern const wchar_t *wcsstr(const wchar_t *, const wchar_t *); extern const wchar_t *wmemchr(const wchar_t *, wchar_t, size_t); #endif } /* namespace std */ #endif /* __STD_wchar */