xref: /illumos-gate/usr/src/head/wchar.h (revision 693e4d84)
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 /*
2323a1cceaSRoger 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__)
125*693e4d84SAlexander Pyhalov #if __cplusplus >= 199711L
126*693e4d84SAlexander Pyhalov namespace std {
127*693e4d84SAlexander Pyhalov #endif
1287c478bd9Sstevel@tonic-gate extern int iswalpha(wint_t);
1297c478bd9Sstevel@tonic-gate extern int iswupper(wint_t);
1307c478bd9Sstevel@tonic-gate extern int iswlower(wint_t);
1317c478bd9Sstevel@tonic-gate extern int iswdigit(wint_t);
1327c478bd9Sstevel@tonic-gate extern int iswxdigit(wint_t);
1337c478bd9Sstevel@tonic-gate extern int iswalnum(wint_t);
1347c478bd9Sstevel@tonic-gate extern int iswspace(wint_t);
1357c478bd9Sstevel@tonic-gate extern int iswpunct(wint_t);
1367c478bd9Sstevel@tonic-gate extern int iswprint(wint_t);
1377c478bd9Sstevel@tonic-gate extern int iswgraph(wint_t);
1387c478bd9Sstevel@tonic-gate extern int iswcntrl(wint_t);
1397c478bd9Sstevel@tonic-gate extern int iswctype(wint_t, wctype_t);
1407c478bd9Sstevel@tonic-gate extern wint_t towlower(wint_t);
1417c478bd9Sstevel@tonic-gate extern wint_t towupper(wint_t);
1427c478bd9Sstevel@tonic-gate extern wchar_t *wcswcs(const wchar_t *, const wchar_t *);
1437c478bd9Sstevel@tonic-gate extern int wcswidth(const wchar_t *, size_t);
1447257d1b4Sraf extern int wcwidth(wchar_t);
1457c478bd9Sstevel@tonic-gate extern wctype_t wctype(const char *);
146*693e4d84SAlexander Pyhalov #if __cplusplus >= 199711L
147*693e4d84SAlexander Pyhalov } /* namespace std */
148*693e4d84SAlexander Pyhalov 
149*693e4d84SAlexander Pyhalov using std::iswalpha;
150*693e4d84SAlexander Pyhalov using std::iswupper;
151*693e4d84SAlexander Pyhalov using std::iswlower;
152*693e4d84SAlexander Pyhalov using std::iswdigit;
153*693e4d84SAlexander Pyhalov using std::iswxdigit;
154*693e4d84SAlexander Pyhalov using std::iswalnum;
155*693e4d84SAlexander Pyhalov using std::iswspace;
156*693e4d84SAlexander Pyhalov using std::iswpunct;
157*693e4d84SAlexander Pyhalov using std::iswprint;
158*693e4d84SAlexander Pyhalov using std::iswgraph;
159*693e4d84SAlexander Pyhalov using std::iswcntrl;
160*693e4d84SAlexander Pyhalov using std::iswctype;
161*693e4d84SAlexander Pyhalov using std::towlower;
162*693e4d84SAlexander Pyhalov using std::towupper;
163*693e4d84SAlexander Pyhalov using std::wcswcs;
164*693e4d84SAlexander Pyhalov using std::wcswidth;
165*693e4d84SAlexander Pyhalov using std::wcwidth;
166*693e4d84SAlexander Pyhalov using std::wctype;
167*693e4d84SAlexander Pyhalov #endif
1687c478bd9Sstevel@tonic-gate #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
1697c478bd9Sstevel@tonic-gate 
17023a1cceaSRoger A. Faulkner #if defined(__EXTENSIONS__) || \
17123a1cceaSRoger A. Faulkner 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
17223a1cceaSRoger A. Faulkner 	/* || defined(_XPG7) */
17323a1cceaSRoger A. Faulkner extern wchar_t *wcsdup(const wchar_t *);
17423a1cceaSRoger A. Faulkner extern size_t wcsnlen(const wchar_t *, size_t);
17523a1cceaSRoger A. Faulkner extern wchar_t *wcpcpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD);
17623a1cceaSRoger A. Faulkner extern wchar_t *wcpncpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
17723a1cceaSRoger A. Faulkner     size_t);
17823a1cceaSRoger A. Faulkner extern int wcscasecmp(const wchar_t *, const wchar_t *);
17923a1cceaSRoger A. Faulkner extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
18023a1cceaSRoger A. Faulkner #endif
18123a1cceaSRoger A. Faulkner 
1827c478bd9Sstevel@tonic-gate #else /* __STDC__ */
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1857c478bd9Sstevel@tonic-gate extern  int iswalpha();
1867c478bd9Sstevel@tonic-gate extern  int iswupper();
1877c478bd9Sstevel@tonic-gate extern  int iswlower();
1887c478bd9Sstevel@tonic-gate extern  int iswdigit();
1897c478bd9Sstevel@tonic-gate extern  int iswxdigit();
1907c478bd9Sstevel@tonic-gate extern  int iswalnum();
1917c478bd9Sstevel@tonic-gate extern  int iswspace();
1927c478bd9Sstevel@tonic-gate extern  int iswpunct();
1937c478bd9Sstevel@tonic-gate extern  int iswprint();
1947c478bd9Sstevel@tonic-gate extern  int iswgraph();
1957c478bd9Sstevel@tonic-gate extern  int iswcntrl();
1967c478bd9Sstevel@tonic-gate extern  int iswctype();
1977c478bd9Sstevel@tonic-gate extern  wint_t towlower();
1987c478bd9Sstevel@tonic-gate extern  wint_t towupper();
1997c478bd9Sstevel@tonic-gate extern wchar_t *wcswcs();
2007c478bd9Sstevel@tonic-gate extern int wcswidth();
2017c478bd9Sstevel@tonic-gate extern int wcwidth();
2027c478bd9Sstevel@tonic-gate extern wctype_t wctype();
2037c478bd9Sstevel@tonic-gate #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
2047c478bd9Sstevel@tonic-gate 
20523a1cceaSRoger A. Faulkner #if defined(__EXTENSIONS__) || \
20623a1cceaSRoger A. Faulkner 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
20723a1cceaSRoger A. Faulkner 	/* || defined(_XPG7) */
20823a1cceaSRoger A. Faulkner extern wchar_t *wcsdup();
20923a1cceaSRoger A. Faulkner extern size_t wcsnlen();
21023a1cceaSRoger A. Faulkner extern wchar_t *wcpcpy();
21123a1cceaSRoger A. Faulkner extern wchar_t *wcpncpy();
21223a1cceaSRoger A. Faulkner extern int wcscasecmp();
21323a1cceaSRoger A. Faulkner extern int wcsncasecmp();
21423a1cceaSRoger A. Faulkner #endif
21523a1cceaSRoger A. Faulkner 
2167c478bd9Sstevel@tonic-gate #endif /* __STDC__ */
2177c478bd9Sstevel@tonic-gate 
2187c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
2197c478bd9Sstevel@tonic-gate }
2207c478bd9Sstevel@tonic-gate #endif
2217c478bd9Sstevel@tonic-gate 
2227c478bd9Sstevel@tonic-gate #endif	/* _WCHAR_H */
223