xref: /illumos-gate/usr/src/head/iso/wchar_iso.h (revision ba3594ba)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5eec1faa8Sdamico  * Common Development and Distribution License (the "License").
6eec1faa8Sdamico  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21eec1faa8Sdamico 
227c478bd9Sstevel@tonic-gate /*
23*ba3594baSGarrett D'Amore  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24*ba3594baSGarrett D'Amore  *
25eec1faa8Sdamico  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
267c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
277c478bd9Sstevel@tonic-gate  */
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate /*
307c478bd9Sstevel@tonic-gate  * An application should not include this header directly.  Instead it
317c478bd9Sstevel@tonic-gate  * should be included only through the inclusion of other Sun headers.
327c478bd9Sstevel@tonic-gate  *
337c478bd9Sstevel@tonic-gate  * The contents of this header is limited to identifiers specified in the
347c478bd9Sstevel@tonic-gate  * C Standard.  Any new identifiers specified in future amendments to the
357c478bd9Sstevel@tonic-gate  * C Standard must be placed in this header.  If these new identifiers
367c478bd9Sstevel@tonic-gate  * are required to also be in the C++ Standard "std" namespace, then for
377c478bd9Sstevel@tonic-gate  * anything other than macro definitions, corresponding "using" directives
387c478bd9Sstevel@tonic-gate  * must also be added to <wchar.h>.
397c478bd9Sstevel@tonic-gate  */
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate #ifndef	_ISO_WCHAR_ISO_H
427c478bd9Sstevel@tonic-gate #define	_ISO_WCHAR_ISO_H
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
457c478bd9Sstevel@tonic-gate #include <stdio_tag.h>
467c478bd9Sstevel@tonic-gate #include <wchar_impl.h>
477c478bd9Sstevel@tonic-gate #include <iso/time_iso.h>
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate #if (defined(__cplusplus) && (__cplusplus - 0 < 54321L)) || \
507c478bd9Sstevel@tonic-gate 	(!defined(__cplusplus) && !defined(_STRICT_STDC)) || \
517c478bd9Sstevel@tonic-gate 	defined(__EXTENSIONS__)
527c478bd9Sstevel@tonic-gate #include <stdio.h>
537c478bd9Sstevel@tonic-gate #endif  /*  (defined(__cplusplus) && (__cplusplus - 0 < 54321L)) ... */
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(__EXTENSIONS__)
567c478bd9Sstevel@tonic-gate #include <ctype.h>
577c478bd9Sstevel@tonic-gate #include <stddef.h>
587c478bd9Sstevel@tonic-gate #endif /* !defined(_STRICT_STDC) || defined(__EXTENSIONS__) */
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate #include <sys/va_list.h>
617c478bd9Sstevel@tonic-gate 
627c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
637c478bd9Sstevel@tonic-gate extern "C" {
647c478bd9Sstevel@tonic-gate #endif
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
677c478bd9Sstevel@tonic-gate namespace std {
687c478bd9Sstevel@tonic-gate #endif
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate /*
717c478bd9Sstevel@tonic-gate  * wchar_t is a built-in type in standard C++ and as such is not
727c478bd9Sstevel@tonic-gate  * defined here when using standard C++. However, the GNU compiler
73159cf8a6Swesolows  * fixincludes utility nonetheless creates its own version of this
747c478bd9Sstevel@tonic-gate  * header for use by gcc and g++. In that version it adds a redundant
757c478bd9Sstevel@tonic-gate  * guard for __cplusplus. To avoid the creation of a gcc/g++ specific
767c478bd9Sstevel@tonic-gate  * header we need to include the following magic comment:
777c478bd9Sstevel@tonic-gate  *
787c478bd9Sstevel@tonic-gate  * we must use the C++ compiler's type
797c478bd9Sstevel@tonic-gate  *
807c478bd9Sstevel@tonic-gate  * The above comment should not be removed or changed until GNU
817c478bd9Sstevel@tonic-gate  * gcc/fixinc/inclhack.def is updated to bypass this header.
827c478bd9Sstevel@tonic-gate  */
837c478bd9Sstevel@tonic-gate #if !defined(__cplusplus) || (__cplusplus < 199711L && !defined(__GNUG__))
847c478bd9Sstevel@tonic-gate #ifndef _WCHAR_T
857c478bd9Sstevel@tonic-gate #define	_WCHAR_T
867c478bd9Sstevel@tonic-gate #if defined(_LP64)
877c478bd9Sstevel@tonic-gate typedef	int	wchar_t;
887c478bd9Sstevel@tonic-gate #else
897c478bd9Sstevel@tonic-gate typedef	long	wchar_t;
907c478bd9Sstevel@tonic-gate #endif
917c478bd9Sstevel@tonic-gate #endif	/* !_WCHAR_T */
927c478bd9Sstevel@tonic-gate #endif	/* !defined(__cplusplus) ... */
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate #if !defined(_WINT_T) || __cplusplus >= 199711L
957c478bd9Sstevel@tonic-gate #define	_WINT_T
967c478bd9Sstevel@tonic-gate #if defined(_LP64)
977c478bd9Sstevel@tonic-gate typedef	int	wint_t;
987c478bd9Sstevel@tonic-gate #else
997c478bd9Sstevel@tonic-gate typedef	long	wint_t;
1007c478bd9Sstevel@tonic-gate #endif
1017c478bd9Sstevel@tonic-gate #endif	/* !defined(_WINT_T) || __cplusplus >= 199711L */
1027c478bd9Sstevel@tonic-gate 
1037c478bd9Sstevel@tonic-gate #if !defined(_SIZE_T) || __cplusplus >= 199711L
1047c478bd9Sstevel@tonic-gate #define	_SIZE_T
1057c478bd9Sstevel@tonic-gate #if defined(_LP64) || defined(_I32LPx)
1067c478bd9Sstevel@tonic-gate typedef	unsigned long	size_t;		/* size of something in bytes */
1077c478bd9Sstevel@tonic-gate #else
1087c478bd9Sstevel@tonic-gate typedef unsigned int	size_t;		/* (historical version) */
1097c478bd9Sstevel@tonic-gate #endif
1107c478bd9Sstevel@tonic-gate #endif  /* !defined(_SIZE_T) || __cplusplus >= 199711L */
1117c478bd9Sstevel@tonic-gate 
1127c478bd9Sstevel@tonic-gate #ifndef NULL
1137c478bd9Sstevel@tonic-gate #if defined(_LP64)
1147c478bd9Sstevel@tonic-gate #define	NULL	0L
1157c478bd9Sstevel@tonic-gate #else
1167c478bd9Sstevel@tonic-gate #define	NULL	0
1177c478bd9Sstevel@tonic-gate #endif
1187c478bd9Sstevel@tonic-gate #endif /* !NULL */
1197c478bd9Sstevel@tonic-gate 
1207c478bd9Sstevel@tonic-gate #ifndef WEOF
121eec1faa8Sdamico #if __cplusplus >= 199711L
122eec1faa8Sdamico #define	WEOF	((std::wint_t)(-1))
123eec1faa8Sdamico #else
1247c478bd9Sstevel@tonic-gate #define	WEOF	((wint_t)(-1))
1257c478bd9Sstevel@tonic-gate #endif
126eec1faa8Sdamico #endif /* WEOF */
1277c478bd9Sstevel@tonic-gate 
1287c478bd9Sstevel@tonic-gate /* not XPG4 and not XPG4v2 */
1297c478bd9Sstevel@tonic-gate #if !defined(_XPG4) || defined(_XPG5)
1307c478bd9Sstevel@tonic-gate #ifndef	WCHAR_MAX
1317c478bd9Sstevel@tonic-gate #define	WCHAR_MAX	2147483647
1327c478bd9Sstevel@tonic-gate #endif
1337c478bd9Sstevel@tonic-gate #ifndef	WCHAR_MIN
1347c478bd9Sstevel@tonic-gate #define	WCHAR_MIN	(-2147483647-1)
1357c478bd9Sstevel@tonic-gate #endif
1367c478bd9Sstevel@tonic-gate #endif /* not XPG4 and not XPG4v2 */
1377c478bd9Sstevel@tonic-gate 
1387c478bd9Sstevel@tonic-gate #if !defined(_MBSTATE_T) || __cplusplus >= 199711L
1397c478bd9Sstevel@tonic-gate #define	_MBSTATE_T
1407c478bd9Sstevel@tonic-gate typedef __mbstate_t	mbstate_t;
1417c478bd9Sstevel@tonic-gate #endif	/* _MBSTATE_T */
1427c478bd9Sstevel@tonic-gate 
1437c478bd9Sstevel@tonic-gate #if defined(_XPG4) && !defined(_FILEDEFED) || __cplusplus >= 199711L
1447c478bd9Sstevel@tonic-gate #define	_FILEDEFED
1457c478bd9Sstevel@tonic-gate typedef __FILE FILE;
1467c478bd9Sstevel@tonic-gate #endif
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate #if !defined(_LP64) && !defined(_LONGLONG_TYPE)
1497c478bd9Sstevel@tonic-gate 
1507c478bd9Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME
1517c478bd9Sstevel@tonic-gate #pragma	redefine_extname fwprintf	_fwprintf_c89
1527c478bd9Sstevel@tonic-gate #pragma	redefine_extname swprintf	_swprintf_c89
1537c478bd9Sstevel@tonic-gate #pragma	redefine_extname vfwprintf	_vfwprintf_c89
1547c478bd9Sstevel@tonic-gate #pragma	redefine_extname vswprintf	_vswprintf_c89
1557c478bd9Sstevel@tonic-gate #pragma	redefine_extname vwprintf	_vwprintf_c89
1567c478bd9Sstevel@tonic-gate #pragma	redefine_extname wprintf	_wprintf_c89
1577c478bd9Sstevel@tonic-gate #pragma	redefine_extname fwscanf	_fwscanf_c89
1587c478bd9Sstevel@tonic-gate #pragma	redefine_extname swscanf	_swscanf_c89
1597c478bd9Sstevel@tonic-gate #pragma	redefine_extname wscanf		_wscanf_c89
1607c478bd9Sstevel@tonic-gate #else
1617c478bd9Sstevel@tonic-gate #define	fwprintf	_fwprintf_c89
1627c478bd9Sstevel@tonic-gate #define	swprintf	_swprintf_c89
1637c478bd9Sstevel@tonic-gate #define	vfwprintf	_vfwprintf_c89
1647c478bd9Sstevel@tonic-gate #define	vswprintf	_vswprintf_c89
1657c478bd9Sstevel@tonic-gate #define	vwprintf	_vwprintf_c89
1667c478bd9Sstevel@tonic-gate #define	wprintf		_wprintf_c89
1677c478bd9Sstevel@tonic-gate #define	fwscanf		_fwscanf_c89
1687c478bd9Sstevel@tonic-gate #define	swscanf		_swscanf_c89
1697c478bd9Sstevel@tonic-gate #define	wscanf		_wscanf_c89
1707c478bd9Sstevel@tonic-gate #endif
1717c478bd9Sstevel@tonic-gate 
1727c478bd9Sstevel@tonic-gate #endif /* !defined(_LP64) && !defined(_LONGLONG_TYPE) */
1737c478bd9Sstevel@tonic-gate 
1747c478bd9Sstevel@tonic-gate #if (!defined(_MSE_INT_H))
1757c478bd9Sstevel@tonic-gate /* not XPG4 and not XPG4v2 */
1767c478bd9Sstevel@tonic-gate #if !defined(_XPG4) || defined(_XPG5)
1777c478bd9Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME
1787c478bd9Sstevel@tonic-gate #pragma redefine_extname fgetwc	__fgetwc_xpg5
1797c478bd9Sstevel@tonic-gate #pragma redefine_extname getwc	__getwc_xpg5
1807c478bd9Sstevel@tonic-gate #pragma redefine_extname getwchar	__getwchar_xpg5
1817c478bd9Sstevel@tonic-gate #pragma redefine_extname fputwc	__fputwc_xpg5
1827c478bd9Sstevel@tonic-gate #pragma redefine_extname putwc	__putwc_xpg5
1837c478bd9Sstevel@tonic-gate #pragma redefine_extname putwchar	__putwchar_xpg5
1847c478bd9Sstevel@tonic-gate #pragma redefine_extname fgetws	__fgetws_xpg5
1857c478bd9Sstevel@tonic-gate #pragma redefine_extname fputws	__fputws_xpg5
1867c478bd9Sstevel@tonic-gate #pragma redefine_extname ungetwc	__ungetwc_xpg5
1877c478bd9Sstevel@tonic-gate #else	/* __PRAGMA_REDEFINE_EXTNAME */
1887c478bd9Sstevel@tonic-gate extern wint_t __fgetwc_xpg5(__FILE *);
1897c478bd9Sstevel@tonic-gate extern wint_t __getwc_xpg5(__FILE *);
1907c478bd9Sstevel@tonic-gate extern wint_t __getwchar_xpg5(void);
1917c478bd9Sstevel@tonic-gate extern wint_t __fputwc_xpg5(wint_t, __FILE *);
1927c478bd9Sstevel@tonic-gate extern wint_t __putwc_xpg5(wint_t, __FILE *);
1937c478bd9Sstevel@tonic-gate extern wint_t __putwchar_xpg5(wint_t);
1947c478bd9Sstevel@tonic-gate extern wchar_t *__fgetws_xpg5(wchar_t *_RESTRICT_KYWD, int,
1957c478bd9Sstevel@tonic-gate 			__FILE *_RESTRICT_KYWD);
1967c478bd9Sstevel@tonic-gate extern int __fputws_xpg5(const wchar_t *_RESTRICT_KYWD, __FILE *_RESTRICT_KYWD);
1977c478bd9Sstevel@tonic-gate extern wint_t __ungetwc_xpg5(wint_t, __FILE *);
1987c478bd9Sstevel@tonic-gate #define	fgetwc	__fgetwc_xpg5
1997c478bd9Sstevel@tonic-gate #define	getwc	__getwc_xpg5
2007c478bd9Sstevel@tonic-gate #define	getwchar	__getwchar_xpg5
2017c478bd9Sstevel@tonic-gate #define	fputwc	__fputwc_xpg5
2027c478bd9Sstevel@tonic-gate #define	putwc	__putwc_xpg5
2037c478bd9Sstevel@tonic-gate #define	putwchar	__putwchar_xpg5
2047c478bd9Sstevel@tonic-gate #define	fgetws	__fgetws_xpg5
2057c478bd9Sstevel@tonic-gate #define	fputws	__fputws_xpg5
2067c478bd9Sstevel@tonic-gate #define	ungetwc	__ungetwc_xpg5
2077c478bd9Sstevel@tonic-gate #endif	/* __PRAGMA_REDEFINE_EXTNAME */
2087c478bd9Sstevel@tonic-gate #endif /* not XPG4 and not XPG4v2 */
2097c478bd9Sstevel@tonic-gate #endif /* defined(_MSE_INT_H) */
2107c478bd9Sstevel@tonic-gate 
2117c478bd9Sstevel@tonic-gate extern wint_t fgetwc(__FILE *);
2127c478bd9Sstevel@tonic-gate extern wchar_t *fgetws(wchar_t *_RESTRICT_KYWD, int, __FILE *_RESTRICT_KYWD);
2137c478bd9Sstevel@tonic-gate extern wint_t fputwc(wint_t, __FILE *);
2147c478bd9Sstevel@tonic-gate extern int fputws(const wchar_t *_RESTRICT_KYWD, __FILE *_RESTRICT_KYWD);
2157c478bd9Sstevel@tonic-gate extern wint_t ungetwc(wint_t, __FILE *);
2167c478bd9Sstevel@tonic-gate extern wint_t getwc(__FILE *);
2177c478bd9Sstevel@tonic-gate extern wint_t getwchar(void);
2187c478bd9Sstevel@tonic-gate extern wint_t putwc(wint_t, __FILE *);
2197c478bd9Sstevel@tonic-gate extern wint_t putwchar(wint_t);
2207c478bd9Sstevel@tonic-gate extern double wcstod(const wchar_t *_RESTRICT_KYWD, wchar_t **_RESTRICT_KYWD);
2217c478bd9Sstevel@tonic-gate extern long wcstol(const wchar_t *_RESTRICT_KYWD, wchar_t **_RESTRICT_KYWD,
2227c478bd9Sstevel@tonic-gate 	int);
2237c478bd9Sstevel@tonic-gate extern unsigned long wcstoul(const wchar_t *_RESTRICT_KYWD,
2247c478bd9Sstevel@tonic-gate 	wchar_t **_RESTRICT_KYWD, int);
2257c478bd9Sstevel@tonic-gate extern wchar_t *wcscat(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD);
2267c478bd9Sstevel@tonic-gate extern int wcscmp(const wchar_t *, const wchar_t *);
2277c478bd9Sstevel@tonic-gate extern int wcscoll(const wchar_t *, const wchar_t *);
2287c478bd9Sstevel@tonic-gate extern wchar_t *wcscpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD);
2297c478bd9Sstevel@tonic-gate extern size_t wcscspn(const wchar_t *, const wchar_t *);
2307c478bd9Sstevel@tonic-gate extern size_t wcslen(const wchar_t *);
2317c478bd9Sstevel@tonic-gate extern wchar_t *wcsncat(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
2327c478bd9Sstevel@tonic-gate 	size_t);
2337c478bd9Sstevel@tonic-gate extern int wcsncmp(const wchar_t *, const wchar_t *, size_t);
2347c478bd9Sstevel@tonic-gate extern wchar_t *wcsncpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
2357c478bd9Sstevel@tonic-gate 	size_t);
2367c478bd9Sstevel@tonic-gate extern size_t wcsspn(const wchar_t *, const wchar_t *);
2377c478bd9Sstevel@tonic-gate extern size_t wcsxfrm(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
2387c478bd9Sstevel@tonic-gate 	size_t);
2397c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
2407c478bd9Sstevel@tonic-gate extern const wchar_t *wcschr(const wchar_t *, wchar_t);
2417c478bd9Sstevel@tonic-gate extern "C++" {
2427c478bd9Sstevel@tonic-gate 	inline wchar_t *wcschr(wchar_t *__ws, wchar_t __wc) {
2437c478bd9Sstevel@tonic-gate 		return (wchar_t *)wcschr((const wchar_t *)__ws, __wc);
2447c478bd9Sstevel@tonic-gate 	}
2457c478bd9Sstevel@tonic-gate }
2467c478bd9Sstevel@tonic-gate extern const wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
2477c478bd9Sstevel@tonic-gate extern "C++" {
2487c478bd9Sstevel@tonic-gate 	inline wchar_t *wcspbrk(wchar_t *__ws1, const wchar_t *__ws2) {
2497c478bd9Sstevel@tonic-gate 		return (wchar_t *)wcspbrk((const wchar_t *)__ws1, __ws2);
2507c478bd9Sstevel@tonic-gate 	}
2517c478bd9Sstevel@tonic-gate }
2527c478bd9Sstevel@tonic-gate extern const wchar_t *wcsrchr(const wchar_t *, wchar_t);
2537c478bd9Sstevel@tonic-gate extern "C++" {
2547c478bd9Sstevel@tonic-gate 	inline wchar_t *wcsrchr(wchar_t *__ws, wchar_t __wc) {
2557c478bd9Sstevel@tonic-gate 		return (wchar_t *)wcsrchr((const wchar_t *)__ws, __wc);
2567c478bd9Sstevel@tonic-gate 	}
2577c478bd9Sstevel@tonic-gate }
2587c478bd9Sstevel@tonic-gate #else /* __cplusplus >= 199711L */
2597c478bd9Sstevel@tonic-gate extern wchar_t *wcschr(const wchar_t *, wchar_t);
2607c478bd9Sstevel@tonic-gate extern wchar_t *wcspbrk(const wchar_t *, const wchar_t *);
2617c478bd9Sstevel@tonic-gate extern wchar_t *wcsrchr(const wchar_t *, wchar_t);
2627c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */
2637c478bd9Sstevel@tonic-gate 
2647c478bd9Sstevel@tonic-gate #if (!defined(_MSE_INT_H))
2657c478bd9Sstevel@tonic-gate #if defined(_XPG4) && !defined(_XPG5) /* XPG4 or XPG4v2 */
2667c478bd9Sstevel@tonic-gate extern wchar_t *wcstok(wchar_t *, const wchar_t *);
2677c478bd9Sstevel@tonic-gate extern size_t wcsftime(wchar_t *, size_t, const char *, const struct tm *);
2687c478bd9Sstevel@tonic-gate #else	/* XPG4 or XPG4v2 */
2697c478bd9Sstevel@tonic-gate #ifdef __PRAGMA_REDEFINE_EXTNAME
2707c478bd9Sstevel@tonic-gate #pragma redefine_extname wcstok	__wcstok_xpg5
2717c478bd9Sstevel@tonic-gate #pragma redefine_extname wcsftime	__wcsftime_xpg5
2727c478bd9Sstevel@tonic-gate extern wchar_t *wcstok(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
2737c478bd9Sstevel@tonic-gate 	wchar_t **_RESTRICT_KYWD);
2747c478bd9Sstevel@tonic-gate extern size_t wcsftime(wchar_t *_RESTRICT_KYWD, size_t,
2757c478bd9Sstevel@tonic-gate 	const wchar_t *_RESTRICT_KYWD, const struct tm *_RESTRICT_KYWD);
2767c478bd9Sstevel@tonic-gate #else	/* __PRAGMA_REDEFINE_EXTNAME */
2777c478bd9Sstevel@tonic-gate extern wchar_t *__wcstok_xpg5(wchar_t *_RESTRICT_KYWD,
2787c478bd9Sstevel@tonic-gate 	const wchar_t *_RESTRICT_KYWD, wchar_t **_RESTRICT_KYWD);
2797c478bd9Sstevel@tonic-gate extern size_t __wcsftime_xpg5(wchar_t *_RESTRICT_KYWD, size_t,
2807c478bd9Sstevel@tonic-gate 	const wchar_t *_RESTRICT_KYWD, const struct tm *_RESTRICT_KYWD);
2817c478bd9Sstevel@tonic-gate #define	wcstok	__wcstok_xpg5
2827c478bd9Sstevel@tonic-gate #define	wcsftime	__wcsftime_xpg5
2837c478bd9Sstevel@tonic-gate #endif	/* __PRAGMA_REDEFINE_EXTNAME */
2847c478bd9Sstevel@tonic-gate #endif	/* XPG4 or XPG4v2 */
2857c478bd9Sstevel@tonic-gate #endif	/* !defined(_MSE_INT_H) */
2867c478bd9Sstevel@tonic-gate 
2877c478bd9Sstevel@tonic-gate /* not XPG4 and not XPG4v2 */
2887c478bd9Sstevel@tonic-gate #if !defined(_XPG4) || defined(_XPG5)
2897c478bd9Sstevel@tonic-gate extern wint_t	btowc(int);
2907c478bd9Sstevel@tonic-gate extern int	fwprintf(__FILE *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
2917c478bd9Sstevel@tonic-gate 			...);
2927c478bd9Sstevel@tonic-gate extern int	fwscanf(__FILE *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
2937c478bd9Sstevel@tonic-gate 			...);
2947c478bd9Sstevel@tonic-gate extern int	fwide(__FILE *, int);
2957c478bd9Sstevel@tonic-gate extern int	mbsinit(const mbstate_t *);
2967c478bd9Sstevel@tonic-gate extern size_t	mbrlen(const char *_RESTRICT_KYWD, size_t,
2977c478bd9Sstevel@tonic-gate 			mbstate_t *_RESTRICT_KYWD);
2987c478bd9Sstevel@tonic-gate extern size_t	mbrtowc(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
2997c478bd9Sstevel@tonic-gate 			size_t, mbstate_t *_RESTRICT_KYWD);
3007c478bd9Sstevel@tonic-gate extern size_t	mbsrtowcs(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
3017c478bd9Sstevel@tonic-gate 			size_t, mbstate_t *_RESTRICT_KYWD);
3027c478bd9Sstevel@tonic-gate extern int	swprintf(wchar_t *_RESTRICT_KYWD, size_t,
3037c478bd9Sstevel@tonic-gate 			const wchar_t *_RESTRICT_KYWD, ...);
3047c478bd9Sstevel@tonic-gate extern int	swscanf(const wchar_t *_RESTRICT_KYWD,
3057c478bd9Sstevel@tonic-gate 			const wchar_t *_RESTRICT_KYWD, ...);
3067c478bd9Sstevel@tonic-gate extern int	vfwprintf(__FILE *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
3077c478bd9Sstevel@tonic-gate 			__va_list);
3087c478bd9Sstevel@tonic-gate extern int	vwprintf(const wchar_t *_RESTRICT_KYWD, __va_list);
3097c478bd9Sstevel@tonic-gate extern int	vswprintf(wchar_t *_RESTRICT_KYWD, size_t,
3107c478bd9Sstevel@tonic-gate 			const wchar_t *_RESTRICT_KYWD, __va_list);
3117c478bd9Sstevel@tonic-gate extern size_t	wcrtomb(char *_RESTRICT_KYWD, wchar_t,
3127c478bd9Sstevel@tonic-gate 			mbstate_t *_RESTRICT_KYWD);
3137c478bd9Sstevel@tonic-gate extern size_t	wcsrtombs(char *_RESTRICT_KYWD, const wchar_t **_RESTRICT_KYWD,
3147c478bd9Sstevel@tonic-gate 			size_t, mbstate_t *_RESTRICT_KYWD);
315538aa54dSGarrett D'Amore #if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
316538aa54dSGarrett D'Amore extern size_t	wcsnrtombs(char *_RESTRICT_KYWD, const wchar_t **_RESTRICT_KYWD,
317538aa54dSGarrett D'Amore 			size_t, size_t, mbstate_t *_RESTRICT_KYWD);
318538aa54dSGarrett D'Amore #endif
3197c478bd9Sstevel@tonic-gate extern int	wctob(wint_t);
3207c478bd9Sstevel@tonic-gate extern int	wmemcmp(const wchar_t *, const wchar_t *, size_t);
3217c478bd9Sstevel@tonic-gate extern wchar_t	*wmemcpy(wchar_t *_RESTRICT_KYWD,
3227c478bd9Sstevel@tonic-gate 			const wchar_t *_RESTRICT_KYWD, size_t);
3237c478bd9Sstevel@tonic-gate extern wchar_t	*wmemmove(wchar_t *, const wchar_t *, size_t);
3247c478bd9Sstevel@tonic-gate extern wchar_t	*wmemset(wchar_t *, wchar_t, size_t);
3257c478bd9Sstevel@tonic-gate extern int	wprintf(const wchar_t *_RESTRICT_KYWD, ...);
3267c478bd9Sstevel@tonic-gate extern int	wscanf(const wchar_t *_RESTRICT_KYWD, ...);
3277c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
3287c478bd9Sstevel@tonic-gate extern const wchar_t *wcsstr(const wchar_t *, const wchar_t *);
3297c478bd9Sstevel@tonic-gate extern "C++" {
3307c478bd9Sstevel@tonic-gate 	inline wchar_t *wcsstr(wchar_t *__ws1, const wchar_t *__ws2) {
3317c478bd9Sstevel@tonic-gate 		return (wchar_t *)wcsstr((const wchar_t *)__ws1, __ws2);
3327c478bd9Sstevel@tonic-gate 	}
3337c478bd9Sstevel@tonic-gate }
3347c478bd9Sstevel@tonic-gate extern const wchar_t *wmemchr(const wchar_t *, wchar_t, size_t);
3357c478bd9Sstevel@tonic-gate extern "C++" {
3367c478bd9Sstevel@tonic-gate 	inline wchar_t *wmemchr(wchar_t *__ws, wchar_t __wc, size_t __n) {
3377c478bd9Sstevel@tonic-gate 		return (wchar_t *)wmemchr((const wchar_t *)__ws, __wc, __n);
3387c478bd9Sstevel@tonic-gate 	}
3397c478bd9Sstevel@tonic-gate }
3407c478bd9Sstevel@tonic-gate #else /* __cplusplus >= 199711L */
3417c478bd9Sstevel@tonic-gate extern wchar_t	*wcsstr(const wchar_t *_RESTRICT_KYWD,
3427c478bd9Sstevel@tonic-gate 	const wchar_t *_RESTRICT_KYWD);
3437c478bd9Sstevel@tonic-gate extern wchar_t	*wmemchr(const wchar_t *, wchar_t, size_t);
3447c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */
3457c478bd9Sstevel@tonic-gate #endif /* not XPG4 and not XPG4v2 */
3467c478bd9Sstevel@tonic-gate 
3477c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
3487c478bd9Sstevel@tonic-gate }
3497c478bd9Sstevel@tonic-gate #endif /* end of namespace std */
3507c478bd9Sstevel@tonic-gate 
3517c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3527c478bd9Sstevel@tonic-gate }
3537c478bd9Sstevel@tonic-gate #endif
3547c478bd9Sstevel@tonic-gate 
3557c478bd9Sstevel@tonic-gate #endif	/* _ISO_WCHAR_ISO_H */
356