xref: /illumos-gate/usr/src/head/wchar.h (revision 23a1ccea)
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
57257d1b4Sraf  * Common Development and Distribution License (the "License").
67257d1b4Sraf  * 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  */
217257d1b4Sraf 
227c478bd9Sstevel@tonic-gate /*
23*23a1cceaSRoger A. Faulkner  * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_WCHAR_H
277c478bd9Sstevel@tonic-gate #define	_WCHAR_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
307c478bd9Sstevel@tonic-gate #include <iso/wchar_iso.h>
317c478bd9Sstevel@tonic-gate #include <iso/wchar_c99.h>
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate /*
347c478bd9Sstevel@tonic-gate  * Allow global visibility for symbols defined in
357c478bd9Sstevel@tonic-gate  * C++ "std" namespace in <iso/wchar_iso.h>.
367c478bd9Sstevel@tonic-gate  */
377c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
387c478bd9Sstevel@tonic-gate using std::FILE;
397c478bd9Sstevel@tonic-gate using std::wint_t;
407c478bd9Sstevel@tonic-gate using std::clock_t;
417c478bd9Sstevel@tonic-gate using std::size_t;
427c478bd9Sstevel@tonic-gate using std::time_t;
437c478bd9Sstevel@tonic-gate using std::tm;
447c478bd9Sstevel@tonic-gate using std::mbstate_t;
457c478bd9Sstevel@tonic-gate using std::fgetwc;
467c478bd9Sstevel@tonic-gate using std::fgetws;
477c478bd9Sstevel@tonic-gate using std::fputwc;
487c478bd9Sstevel@tonic-gate using std::fputws;
497c478bd9Sstevel@tonic-gate using std::ungetwc;
507c478bd9Sstevel@tonic-gate using std::getwc;
517c478bd9Sstevel@tonic-gate using std::getwchar;
527c478bd9Sstevel@tonic-gate using std::putwc;
537c478bd9Sstevel@tonic-gate using std::putwchar;
547c478bd9Sstevel@tonic-gate using std::wcstod;
557c478bd9Sstevel@tonic-gate using std::wcstol;
567c478bd9Sstevel@tonic-gate using std::wcstoul;
577c478bd9Sstevel@tonic-gate using std::wcscat;
587c478bd9Sstevel@tonic-gate using std::wcschr;
597c478bd9Sstevel@tonic-gate using std::wcscmp;
607c478bd9Sstevel@tonic-gate using std::wcscoll;
617c478bd9Sstevel@tonic-gate using std::wcscpy;
627c478bd9Sstevel@tonic-gate using std::wcscspn;
637c478bd9Sstevel@tonic-gate using std::wcslen;
647c478bd9Sstevel@tonic-gate using std::wcsncat;
657c478bd9Sstevel@tonic-gate using std::wcsncmp;
667c478bd9Sstevel@tonic-gate using std::wcsncpy;
677c478bd9Sstevel@tonic-gate using std::wcspbrk;
687c478bd9Sstevel@tonic-gate using std::wcsrchr;
697c478bd9Sstevel@tonic-gate using std::wcsspn;
707c478bd9Sstevel@tonic-gate using std::wcsxfrm;
717c478bd9Sstevel@tonic-gate using std::wcstok;
727c478bd9Sstevel@tonic-gate using std::wcsftime;
737c478bd9Sstevel@tonic-gate /* not XPG4 and not XPG4v2 */
747c478bd9Sstevel@tonic-gate #if (!defined(_XPG4) && !defined(_XPG4_2) || defined(_XPG5))
757c478bd9Sstevel@tonic-gate using std::btowc;
767c478bd9Sstevel@tonic-gate using std::fwprintf;
777c478bd9Sstevel@tonic-gate using std::fwscanf;
787c478bd9Sstevel@tonic-gate using std::fwide;
797c478bd9Sstevel@tonic-gate using std::mbsinit;
807c478bd9Sstevel@tonic-gate using std::mbrlen;
817c478bd9Sstevel@tonic-gate using std::mbrtowc;
827c478bd9Sstevel@tonic-gate using std::mbsrtowcs;
837c478bd9Sstevel@tonic-gate using std::swprintf;
847c478bd9Sstevel@tonic-gate using std::swscanf;
857c478bd9Sstevel@tonic-gate using std::vfwprintf;
867c478bd9Sstevel@tonic-gate using std::vwprintf;
877c478bd9Sstevel@tonic-gate using std::vswprintf;
887c478bd9Sstevel@tonic-gate using std::wcrtomb;
897c478bd9Sstevel@tonic-gate using std::wcsrtombs;
907c478bd9Sstevel@tonic-gate using std::wcsstr;
917c478bd9Sstevel@tonic-gate using std::wctob;
927c478bd9Sstevel@tonic-gate using std::wmemchr;
937c478bd9Sstevel@tonic-gate using std::wmemcmp;
947c478bd9Sstevel@tonic-gate using std::wmemcpy;
957c478bd9Sstevel@tonic-gate using std::wmemmove;
967c478bd9Sstevel@tonic-gate using std::wmemset;
977c478bd9Sstevel@tonic-gate using std::wprintf;
987c478bd9Sstevel@tonic-gate using std::wscanf;
997c478bd9Sstevel@tonic-gate #endif /* not XPG4 and not XPG4v2 */
1007c478bd9Sstevel@tonic-gate #endif /* __cplusplus >= 199711L */
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1037c478bd9Sstevel@tonic-gate extern "C" {
1047c478bd9Sstevel@tonic-gate #endif
1057c478bd9Sstevel@tonic-gate 
1067c478bd9Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1077c478bd9Sstevel@tonic-gate #if !defined(_WCTYPE_T) || __cplusplus >= 199711L
1087c478bd9Sstevel@tonic-gate #define	_WCTYPE_T
1097c478bd9Sstevel@tonic-gate typedef	int	wctype_t;
1107c478bd9Sstevel@tonic-gate #endif
1117c478bd9Sstevel@tonic-gate #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
1127c478bd9Sstevel@tonic-gate 
1137c478bd9Sstevel@tonic-gate /*
1147c478bd9Sstevel@tonic-gate  * XPG6 requires that va_list be defined as defined in <stdarg.h>,
1157c478bd9Sstevel@tonic-gate  * however, inclusion of <stdarg.h> breaks Standard C namespace.
1167c478bd9Sstevel@tonic-gate  */
1177c478bd9Sstevel@tonic-gate #if defined(_XPG6) && !defined(_VA_LIST)
1187c478bd9Sstevel@tonic-gate #define	_VA_LIST
1197c478bd9Sstevel@tonic-gate typedef __va_list va_list;
1207c478bd9Sstevel@tonic-gate #endif  /* defined(_XPG6) && !defined(_VA_LIST) */
1217c478bd9Sstevel@tonic-gate 
1227c478bd9Sstevel@tonic-gate #ifdef __STDC__
1237c478bd9Sstevel@tonic-gate 
1247c478bd9Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1257c478bd9Sstevel@tonic-gate extern int iswalpha(wint_t);
1267c478bd9Sstevel@tonic-gate extern int iswupper(wint_t);
1277c478bd9Sstevel@tonic-gate extern int iswlower(wint_t);
1287c478bd9Sstevel@tonic-gate extern int iswdigit(wint_t);
1297c478bd9Sstevel@tonic-gate extern int iswxdigit(wint_t);
1307c478bd9Sstevel@tonic-gate extern int iswalnum(wint_t);
1317c478bd9Sstevel@tonic-gate extern int iswspace(wint_t);
1327c478bd9Sstevel@tonic-gate extern int iswpunct(wint_t);
1337c478bd9Sstevel@tonic-gate extern int iswprint(wint_t);
1347c478bd9Sstevel@tonic-gate extern int iswgraph(wint_t);
1357c478bd9Sstevel@tonic-gate extern int iswcntrl(wint_t);
1367c478bd9Sstevel@tonic-gate extern int iswctype(wint_t, wctype_t);
1377c478bd9Sstevel@tonic-gate extern wint_t towlower(wint_t);
1387c478bd9Sstevel@tonic-gate extern wint_t towupper(wint_t);
1397c478bd9Sstevel@tonic-gate extern wchar_t *wcswcs(const wchar_t *, const wchar_t *);
1407c478bd9Sstevel@tonic-gate extern int wcswidth(const wchar_t *, size_t);
1417257d1b4Sraf extern int wcwidth(wchar_t);
1427c478bd9Sstevel@tonic-gate extern wctype_t wctype(const char *);
1437c478bd9Sstevel@tonic-gate #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
1447c478bd9Sstevel@tonic-gate 
145*23a1cceaSRoger A. Faulkner #if defined(__EXTENSIONS__) || \
146*23a1cceaSRoger A. Faulkner 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
147*23a1cceaSRoger A. Faulkner 	/* || defined(_XPG7) */
148*23a1cceaSRoger A. Faulkner extern wchar_t *wcsdup(const wchar_t *);
149*23a1cceaSRoger A. Faulkner extern size_t wcsnlen(const wchar_t *, size_t);
150*23a1cceaSRoger A. Faulkner extern wchar_t *wcpcpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD);
151*23a1cceaSRoger A. Faulkner extern wchar_t *wcpncpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
152*23a1cceaSRoger A. Faulkner     size_t);
153*23a1cceaSRoger A. Faulkner extern int wcscasecmp(const wchar_t *, const wchar_t *);
154*23a1cceaSRoger A. Faulkner extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
155*23a1cceaSRoger A. Faulkner #endif
156*23a1cceaSRoger A. Faulkner 
1577c478bd9Sstevel@tonic-gate #else /* __STDC__ */
1587c478bd9Sstevel@tonic-gate 
1597c478bd9Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1607c478bd9Sstevel@tonic-gate extern  int iswalpha();
1617c478bd9Sstevel@tonic-gate extern  int iswupper();
1627c478bd9Sstevel@tonic-gate extern  int iswlower();
1637c478bd9Sstevel@tonic-gate extern  int iswdigit();
1647c478bd9Sstevel@tonic-gate extern  int iswxdigit();
1657c478bd9Sstevel@tonic-gate extern  int iswalnum();
1667c478bd9Sstevel@tonic-gate extern  int iswspace();
1677c478bd9Sstevel@tonic-gate extern  int iswpunct();
1687c478bd9Sstevel@tonic-gate extern  int iswprint();
1697c478bd9Sstevel@tonic-gate extern  int iswgraph();
1707c478bd9Sstevel@tonic-gate extern  int iswcntrl();
1717c478bd9Sstevel@tonic-gate extern  int iswctype();
1727c478bd9Sstevel@tonic-gate extern  wint_t towlower();
1737c478bd9Sstevel@tonic-gate extern  wint_t towupper();
1747c478bd9Sstevel@tonic-gate extern wchar_t *wcswcs();
1757c478bd9Sstevel@tonic-gate extern int wcswidth();
1767c478bd9Sstevel@tonic-gate extern int wcwidth();
1777c478bd9Sstevel@tonic-gate extern wctype_t wctype();
1787c478bd9Sstevel@tonic-gate #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
1797c478bd9Sstevel@tonic-gate 
180*23a1cceaSRoger A. Faulkner #if defined(__EXTENSIONS__) || \
181*23a1cceaSRoger A. Faulkner 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
182*23a1cceaSRoger A. Faulkner 	/* || defined(_XPG7) */
183*23a1cceaSRoger A. Faulkner extern wchar_t *wcsdup();
184*23a1cceaSRoger A. Faulkner extern size_t wcsnlen();
185*23a1cceaSRoger A. Faulkner extern wchar_t *wcpcpy();
186*23a1cceaSRoger A. Faulkner extern wchar_t *wcpncpy();
187*23a1cceaSRoger A. Faulkner extern int wcscasecmp();
188*23a1cceaSRoger A. Faulkner extern int wcsncasecmp();
189*23a1cceaSRoger A. Faulkner #endif
190*23a1cceaSRoger A. Faulkner 
1917c478bd9Sstevel@tonic-gate #endif /* __STDC__ */
1927c478bd9Sstevel@tonic-gate 
1937c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1947c478bd9Sstevel@tonic-gate }
1957c478bd9Sstevel@tonic-gate #endif
1967c478bd9Sstevel@tonic-gate 
1977c478bd9Sstevel@tonic-gate #endif	/* _WCHAR_H */
198