xref: /illumos-gate/usr/src/head/wchar.h (revision 7257d1b4d25bfac0c802847390e98a464fd787ac)
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
5*7257d1b4Sraf  * Common Development and Distribution License (the "License").
6*7257d1b4Sraf  * 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  */
21*7257d1b4Sraf 
227c478bd9Sstevel@tonic-gate /*
23*7257d1b4Sraf  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_WCHAR_H
287c478bd9Sstevel@tonic-gate #define	_WCHAR_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #include <iso/wchar_iso.h>
357c478bd9Sstevel@tonic-gate #include <iso/wchar_c99.h>
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate /*
387c478bd9Sstevel@tonic-gate  * Allow global visibility for symbols defined in
397c478bd9Sstevel@tonic-gate  * C++ "std" namespace in <iso/wchar_iso.h>.
407c478bd9Sstevel@tonic-gate  */
417c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
427c478bd9Sstevel@tonic-gate using std::FILE;
437c478bd9Sstevel@tonic-gate using std::wint_t;
447c478bd9Sstevel@tonic-gate using std::clock_t;
457c478bd9Sstevel@tonic-gate using std::size_t;
467c478bd9Sstevel@tonic-gate using std::time_t;
477c478bd9Sstevel@tonic-gate using std::tm;
487c478bd9Sstevel@tonic-gate using std::mbstate_t;
497c478bd9Sstevel@tonic-gate using std::fgetwc;
507c478bd9Sstevel@tonic-gate using std::fgetws;
517c478bd9Sstevel@tonic-gate using std::fputwc;
527c478bd9Sstevel@tonic-gate using std::fputws;
537c478bd9Sstevel@tonic-gate using std::ungetwc;
547c478bd9Sstevel@tonic-gate using std::getwc;
557c478bd9Sstevel@tonic-gate using std::getwchar;
567c478bd9Sstevel@tonic-gate using std::putwc;
577c478bd9Sstevel@tonic-gate using std::putwchar;
587c478bd9Sstevel@tonic-gate using std::wcstod;
597c478bd9Sstevel@tonic-gate using std::wcstol;
607c478bd9Sstevel@tonic-gate using std::wcstoul;
617c478bd9Sstevel@tonic-gate using std::wcscat;
627c478bd9Sstevel@tonic-gate using std::wcschr;
637c478bd9Sstevel@tonic-gate using std::wcscmp;
647c478bd9Sstevel@tonic-gate using std::wcscoll;
657c478bd9Sstevel@tonic-gate using std::wcscpy;
667c478bd9Sstevel@tonic-gate using std::wcscspn;
677c478bd9Sstevel@tonic-gate using std::wcslen;
687c478bd9Sstevel@tonic-gate using std::wcsncat;
697c478bd9Sstevel@tonic-gate using std::wcsncmp;
707c478bd9Sstevel@tonic-gate using std::wcsncpy;
717c478bd9Sstevel@tonic-gate using std::wcspbrk;
727c478bd9Sstevel@tonic-gate using std::wcsrchr;
737c478bd9Sstevel@tonic-gate using std::wcsspn;
747c478bd9Sstevel@tonic-gate using std::wcsxfrm;
757c478bd9Sstevel@tonic-gate using std::wcstok;
767c478bd9Sstevel@tonic-gate using std::wcsftime;
777c478bd9Sstevel@tonic-gate /* not XPG4 and not XPG4v2 */
787c478bd9Sstevel@tonic-gate #if (!defined(_XPG4) && !defined(_XPG4_2) || defined(_XPG5))
797c478bd9Sstevel@tonic-gate using std::btowc;
807c478bd9Sstevel@tonic-gate using std::fwprintf;
817c478bd9Sstevel@tonic-gate using std::fwscanf;
827c478bd9Sstevel@tonic-gate using std::fwide;
837c478bd9Sstevel@tonic-gate using std::mbsinit;
847c478bd9Sstevel@tonic-gate using std::mbrlen;
857c478bd9Sstevel@tonic-gate using std::mbrtowc;
867c478bd9Sstevel@tonic-gate using std::mbsrtowcs;
877c478bd9Sstevel@tonic-gate using std::swprintf;
887c478bd9Sstevel@tonic-gate using std::swscanf;
897c478bd9Sstevel@tonic-gate using std::vfwprintf;
907c478bd9Sstevel@tonic-gate using std::vwprintf;
917c478bd9Sstevel@tonic-gate using std::vswprintf;
927c478bd9Sstevel@tonic-gate using std::wcrtomb;
937c478bd9Sstevel@tonic-gate using std::wcsrtombs;
947c478bd9Sstevel@tonic-gate using std::wcsstr;
957c478bd9Sstevel@tonic-gate using std::wctob;
967c478bd9Sstevel@tonic-gate using std::wmemchr;
977c478bd9Sstevel@tonic-gate using std::wmemcmp;
987c478bd9Sstevel@tonic-gate using std::wmemcpy;
997c478bd9Sstevel@tonic-gate using std::wmemmove;
1007c478bd9Sstevel@tonic-gate using std::wmemset;
1017c478bd9Sstevel@tonic-gate using std::wprintf;
1027c478bd9Sstevel@tonic-gate using std::wscanf;
1037c478bd9Sstevel@tonic-gate #endif /* not XPG4 and not XPG4v2 */
1047c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */
1057c478bd9Sstevel@tonic-gate 
1067c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1077c478bd9Sstevel@tonic-gate extern "C" {
1087c478bd9Sstevel@tonic-gate #endif
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1117c478bd9Sstevel@tonic-gate #if !defined(_WCTYPE_T) || __cplusplus >= 199711L
1127c478bd9Sstevel@tonic-gate #define	_WCTYPE_T
1137c478bd9Sstevel@tonic-gate typedef	int	wctype_t;
1147c478bd9Sstevel@tonic-gate #endif
1157c478bd9Sstevel@tonic-gate #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
1167c478bd9Sstevel@tonic-gate 
1177c478bd9Sstevel@tonic-gate /*
1187c478bd9Sstevel@tonic-gate  * XPG6 requires that va_list be defined as defined in <stdarg.h>,
1197c478bd9Sstevel@tonic-gate  * however, inclusion of <stdarg.h> breaks Standard C namespace.
1207c478bd9Sstevel@tonic-gate  */
1217c478bd9Sstevel@tonic-gate #if defined(_XPG6) && !defined(_VA_LIST)
1227c478bd9Sstevel@tonic-gate #define	_VA_LIST
1237c478bd9Sstevel@tonic-gate typedef __va_list va_list;
1247c478bd9Sstevel@tonic-gate #endif  /* defined(_XPG6) && !defined(_VA_LIST) */
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate #ifdef __STDC__
1277c478bd9Sstevel@tonic-gate 
1287c478bd9Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1297c478bd9Sstevel@tonic-gate extern int iswalpha(wint_t);
1307c478bd9Sstevel@tonic-gate extern int iswupper(wint_t);
1317c478bd9Sstevel@tonic-gate extern int iswlower(wint_t);
1327c478bd9Sstevel@tonic-gate extern int iswdigit(wint_t);
1337c478bd9Sstevel@tonic-gate extern int iswxdigit(wint_t);
1347c478bd9Sstevel@tonic-gate extern int iswalnum(wint_t);
1357c478bd9Sstevel@tonic-gate extern int iswspace(wint_t);
1367c478bd9Sstevel@tonic-gate extern int iswpunct(wint_t);
1377c478bd9Sstevel@tonic-gate extern int iswprint(wint_t);
1387c478bd9Sstevel@tonic-gate extern int iswgraph(wint_t);
1397c478bd9Sstevel@tonic-gate extern int iswcntrl(wint_t);
1407c478bd9Sstevel@tonic-gate extern int iswctype(wint_t, wctype_t);
1417c478bd9Sstevel@tonic-gate extern wint_t towlower(wint_t);
1427c478bd9Sstevel@tonic-gate extern wint_t towupper(wint_t);
1437c478bd9Sstevel@tonic-gate extern wchar_t *wcswcs(const wchar_t *, const wchar_t *);
1447c478bd9Sstevel@tonic-gate extern int wcswidth(const wchar_t *, size_t);
145*7257d1b4Sraf extern int wcwidth(wchar_t);
1467c478bd9Sstevel@tonic-gate extern wctype_t wctype(const char *);
1477c478bd9Sstevel@tonic-gate #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
1487c478bd9Sstevel@tonic-gate 
1497c478bd9Sstevel@tonic-gate #else /* __STDC__ */
1507c478bd9Sstevel@tonic-gate 
1517c478bd9Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1527c478bd9Sstevel@tonic-gate extern  int iswalpha();
1537c478bd9Sstevel@tonic-gate extern  int iswupper();
1547c478bd9Sstevel@tonic-gate extern  int iswlower();
1557c478bd9Sstevel@tonic-gate extern  int iswdigit();
1567c478bd9Sstevel@tonic-gate extern  int iswxdigit();
1577c478bd9Sstevel@tonic-gate extern  int iswalnum();
1587c478bd9Sstevel@tonic-gate extern  int iswspace();
1597c478bd9Sstevel@tonic-gate extern  int iswpunct();
1607c478bd9Sstevel@tonic-gate extern  int iswprint();
1617c478bd9Sstevel@tonic-gate extern  int iswgraph();
1627c478bd9Sstevel@tonic-gate extern  int iswcntrl();
1637c478bd9Sstevel@tonic-gate extern  int iswctype();
1647c478bd9Sstevel@tonic-gate extern  wint_t towlower();
1657c478bd9Sstevel@tonic-gate extern  wint_t towupper();
1667c478bd9Sstevel@tonic-gate extern wchar_t *wcswcs();
1677c478bd9Sstevel@tonic-gate extern int wcswidth();
1687c478bd9Sstevel@tonic-gate extern int wcwidth();
1697c478bd9Sstevel@tonic-gate extern wctype_t wctype();
1707c478bd9Sstevel@tonic-gate #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
1717c478bd9Sstevel@tonic-gate 
1727c478bd9Sstevel@tonic-gate #endif /* __STDC__ */
1737c478bd9Sstevel@tonic-gate 
1747c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1757c478bd9Sstevel@tonic-gate }
1767c478bd9Sstevel@tonic-gate #endif
1777c478bd9Sstevel@tonic-gate 
1787c478bd9Sstevel@tonic-gate #endif	/* _WCHAR_H */
179