17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
57257d1braf * Common Development and Distribution License (the "License").
67257d1braf * You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate *
87c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate * See the License for the specific language governing permissions
117c478bdstevel@tonic-gate * and limitations under the License.
127c478bdstevel@tonic-gate *
137c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate *
197c478bdstevel@tonic-gate * CDDL HEADER END
207c478bdstevel@tonic-gate */
217257d1braf
227c478bdstevel@tonic-gate/*
232d08521Garrett D'Amore * Copyright 2014 Garrett D'Amore <garrett@damore.org>
2423a1cceRoger A. Faulkner * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
257c478bdstevel@tonic-gate */
267c478bdstevel@tonic-gate
277c478bdstevel@tonic-gate#ifndef	_WCHAR_H
287c478bdstevel@tonic-gate#define	_WCHAR_H
297c478bdstevel@tonic-gate
307c478bdstevel@tonic-gate#include <sys/feature_tests.h>
317c478bdstevel@tonic-gate#include <iso/wchar_iso.h>
327c478bdstevel@tonic-gate#include <iso/wchar_c99.h>
337c478bdstevel@tonic-gate
347c478bdstevel@tonic-gate/*
357c478bdstevel@tonic-gate * Allow global visibility for symbols defined in
367c478bdstevel@tonic-gate * C++ "std" namespace in <iso/wchar_iso.h>.
377c478bdstevel@tonic-gate */
387c478bdstevel@tonic-gate#if __cplusplus >= 199711L
397c478bdstevel@tonic-gateusing std::FILE;
407c478bdstevel@tonic-gateusing std::wint_t;
417c478bdstevel@tonic-gateusing std::clock_t;
427c478bdstevel@tonic-gateusing std::size_t;
437c478bdstevel@tonic-gateusing std::time_t;
447c478bdstevel@tonic-gateusing std::tm;
457c478bdstevel@tonic-gateusing std::mbstate_t;
467c478bdstevel@tonic-gateusing std::fgetwc;
477c478bdstevel@tonic-gateusing std::fgetws;
487c478bdstevel@tonic-gateusing std::fputwc;
497c478bdstevel@tonic-gateusing std::fputws;
507c478bdstevel@tonic-gateusing std::ungetwc;
517c478bdstevel@tonic-gateusing std::getwc;
527c478bdstevel@tonic-gateusing std::getwchar;
537c478bdstevel@tonic-gateusing std::putwc;
547c478bdstevel@tonic-gateusing std::putwchar;
557c478bdstevel@tonic-gateusing std::wcstod;
567c478bdstevel@tonic-gateusing std::wcstol;
577c478bdstevel@tonic-gateusing std::wcstoul;
587c478bdstevel@tonic-gateusing std::wcscat;
597c478bdstevel@tonic-gateusing std::wcschr;
607c478bdstevel@tonic-gateusing std::wcscmp;
617c478bdstevel@tonic-gateusing std::wcscoll;
627c478bdstevel@tonic-gateusing std::wcscpy;
637c478bdstevel@tonic-gateusing std::wcscspn;
647c478bdstevel@tonic-gateusing std::wcslen;
657c478bdstevel@tonic-gateusing std::wcsncat;
667c478bdstevel@tonic-gateusing std::wcsncmp;
677c478bdstevel@tonic-gateusing std::wcsncpy;
687c478bdstevel@tonic-gateusing std::wcspbrk;
697c478bdstevel@tonic-gateusing std::wcsrchr;
707c478bdstevel@tonic-gateusing std::wcsspn;
717c478bdstevel@tonic-gateusing std::wcsxfrm;
727c478bdstevel@tonic-gateusing std::wcstok;
737c478bdstevel@tonic-gateusing std::wcsftime;
747c478bdstevel@tonic-gate/* not XPG4 and not XPG4v2 */
757c478bdstevel@tonic-gate#if (!defined(_XPG4) && !defined(_XPG4_2) || defined(_XPG5))
767c478bdstevel@tonic-gateusing std::btowc;
777c478bdstevel@tonic-gateusing std::fwprintf;
787c478bdstevel@tonic-gateusing std::fwscanf;
797c478bdstevel@tonic-gateusing std::fwide;
807c478bdstevel@tonic-gateusing std::mbsinit;
817c478bdstevel@tonic-gateusing std::mbrlen;
827c478bdstevel@tonic-gateusing std::mbrtowc;
837c478bdstevel@tonic-gateusing std::mbsrtowcs;
847c478bdstevel@tonic-gateusing std::swprintf;
857c478bdstevel@tonic-gateusing std::swscanf;
867c478bdstevel@tonic-gateusing std::vfwprintf;
877c478bdstevel@tonic-gateusing std::vwprintf;
887c478bdstevel@tonic-gateusing std::vswprintf;
897c478bdstevel@tonic-gateusing std::wcrtomb;
907c478bdstevel@tonic-gateusing std::wcsrtombs;
917c478bdstevel@tonic-gateusing std::wcsstr;
927c478bdstevel@tonic-gateusing std::wctob;
937c478bdstevel@tonic-gateusing std::wmemchr;
947c478bdstevel@tonic-gateusing std::wmemcmp;
957c478bdstevel@tonic-gateusing std::wmemcpy;
967c478bdstevel@tonic-gateusing std::wmemmove;
977c478bdstevel@tonic-gateusing std::wmemset;
987c478bdstevel@tonic-gateusing std::wprintf;
997c478bdstevel@tonic-gateusing std::wscanf;
1007c478bdstevel@tonic-gate#endif /* not XPG4 and not XPG4v2 */
1017c478bdstevel@tonic-gate#endif /* __cplusplus >= 199711L */
1027c478bdstevel@tonic-gate
1037c478bdstevel@tonic-gate#ifdef	__cplusplus
1047c478bdstevel@tonic-gateextern "C" {
1057c478bdstevel@tonic-gate#endif
1067c478bdstevel@tonic-gate
1077c478bdstevel@tonic-gate#if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1087c478bdstevel@tonic-gate#if !defined(_WCTYPE_T) || __cplusplus >= 199711L
1097c478bdstevel@tonic-gate#define	_WCTYPE_T
1107c478bdstevel@tonic-gatetypedef	int	wctype_t;
1117c478bdstevel@tonic-gate#endif
1127c478bdstevel@tonic-gate#endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
1137c478bdstevel@tonic-gate
1147c478bdstevel@tonic-gate/*
1157c478bdstevel@tonic-gate * XPG6 requires that va_list be defined as defined in <stdarg.h>,
1167c478bdstevel@tonic-gate * however, inclusion of <stdarg.h> breaks Standard C namespace.
1177c478bdstevel@tonic-gate */
1187c478bdstevel@tonic-gate#if defined(_XPG6) && !defined(_VA_LIST)
1197c478bdstevel@tonic-gate#define	_VA_LIST
1207c478bdstevel@tonic-gatetypedef __va_list va_list;
1217c478bdstevel@tonic-gate#endif  /* defined(_XPG6) && !defined(_VA_LIST) */
1227c478bdstevel@tonic-gate
1237c478bdstevel@tonic-gate#if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
124693e4d8Alexander Pyhalov#if __cplusplus >= 199711L
125693e4d8Alexander Pyhalovnamespace std {
126693e4d8Alexander Pyhalov#endif
1277c478bdstevel@tonic-gateextern int iswalpha(wint_t);
1287c478bdstevel@tonic-gateextern int iswupper(wint_t);
1297c478bdstevel@tonic-gateextern int iswlower(wint_t);
1307c478bdstevel@tonic-gateextern int iswdigit(wint_t);
1317c478bdstevel@tonic-gateextern int iswxdigit(wint_t);
1327c478bdstevel@tonic-gateextern int iswalnum(wint_t);
1337c478bdstevel@tonic-gateextern int iswspace(wint_t);
1347c478bdstevel@tonic-gateextern int iswpunct(wint_t);
1357c478bdstevel@tonic-gateextern int iswprint(wint_t);
1367c478bdstevel@tonic-gateextern int iswgraph(wint_t);
1377c478bdstevel@tonic-gateextern int iswcntrl(wint_t);
1387c478bdstevel@tonic-gateextern int iswctype(wint_t, wctype_t);
1397c478bdstevel@tonic-gateextern wint_t towlower(wint_t);
1407c478bdstevel@tonic-gateextern wint_t towupper(wint_t);
1417c478bdstevel@tonic-gateextern wchar_t *wcswcs(const wchar_t *, const wchar_t *);
1427c478bdstevel@tonic-gateextern int wcswidth(const wchar_t *, size_t);
1437257d1brafextern int wcwidth(wchar_t);
1447c478bdstevel@tonic-gateextern wctype_t wctype(const char *);
145693e4d8Alexander Pyhalov#if __cplusplus >= 199711L
146693e4d8Alexander Pyhalov} /* namespace std */
147693e4d8Alexander Pyhalov
148693e4d8Alexander Pyhalovusing std::iswalpha;
149693e4d8Alexander Pyhalovusing std::iswupper;
150693e4d8Alexander Pyhalovusing std::iswlower;
151693e4d8Alexander Pyhalovusing std::iswdigit;
152693e4d8Alexander Pyhalovusing std::iswxdigit;
153693e4d8Alexander Pyhalovusing std::iswalnum;
154693e4d8Alexander Pyhalovusing std::iswspace;
155693e4d8Alexander Pyhalovusing std::iswpunct;
156693e4d8Alexander Pyhalovusing std::iswprint;
157693e4d8Alexander Pyhalovusing std::iswgraph;
158693e4d8Alexander Pyhalovusing std::iswcntrl;
159693e4d8Alexander Pyhalovusing std::iswctype;
160693e4d8Alexander Pyhalovusing std::towlower;
161693e4d8Alexander Pyhalovusing std::towupper;
162693e4d8Alexander Pyhalovusing std::wcswcs;
163693e4d8Alexander Pyhalovusing std::wcswidth;
164693e4d8Alexander Pyhalovusing std::wcwidth;
165693e4d8Alexander Pyhalovusing std::wctype;
166693e4d8Alexander Pyhalov#endif
1677c478bdstevel@tonic-gate#endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
1687c478bdstevel@tonic-gate
1692d08521Garrett D'Amore#if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
1702d08521Garrett D'Amore
1712d08521Garrett D'Amore#ifndef _LOCALE_T
1722d08521Garrett D'Amore#define	_LOCALE_T
173732efd5Dan McDonaldtypedef struct _locale *locale_t;
1742d08521Garrett D'Amore#endif
1752d08521Garrett D'Amore
17623a1cceRoger A. Faulknerextern size_t wcsnlen(const wchar_t *, size_t);
17723a1cceRoger A. Faulknerextern wchar_t *wcpcpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD);
17823a1cceRoger A. Faulknerextern wchar_t *wcpncpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
17923a1cceRoger A. Faulkner    size_t);
1802d08521Garrett D'Amoreextern size_t wcsxfrm_l(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
1812d08521Garrett D'Amore    size_t, locale_t);
1822d08521Garrett D'Amoreextern int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
1832d08521Garrett D'Amoreextern wchar_t *wcsdup(const wchar_t *);
18423a1cceRoger A. Faulknerextern int wcscasecmp(const wchar_t *, const wchar_t *);
1852d08521Garrett D'Amoreextern int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
18623a1cceRoger A. Faulknerextern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
1872d08521Garrett D'Amoreextern int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t);
1882d08521Garrett D'Amoreextern size_t mbsnrtowcs(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
1892d08521Garrett D'Amore    size_t, size_t, mbstate_t *_RESTRICT_KYWD);
1902d08521Garrett D'Amore
191cd62a92Robert Mustacchiextern FILE	*open_wmemstream(wchar_t **, size_t *);
192cd62a92Robert Mustacchi
1932d08521Garrett D'Amore#endif	/* defined(_XPG7) || !defined(_STRICT_SYMBOLS) */
19423a1cceRoger A. Faulkner
1957c478bdstevel@tonic-gate#ifdef	__cplusplus
1967c478bdstevel@tonic-gate}
1977c478bdstevel@tonic-gate#endif
1987c478bdstevel@tonic-gate
1997c478bdstevel@tonic-gate#endif	/* _WCHAR_H */
200