Print this page
2964 need POSIX 2008 locale object support (more C++ fixes)
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/head/wchar.h
+++ new/usr/src/head/wchar.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 24 * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
25 25 */
26 26
27 27 #ifndef _WCHAR_H
28 28 #define _WCHAR_H
29 29
30 30 #include <sys/feature_tests.h>
31 31 #include <iso/wchar_iso.h>
32 32 #include <iso/wchar_c99.h>
33 33
34 34 /*
35 35 * Allow global visibility for symbols defined in
36 36 * C++ "std" namespace in <iso/wchar_iso.h>.
37 37 */
38 38 #if __cplusplus >= 199711L
39 39 using std::FILE;
40 40 using std::wint_t;
41 41 using std::clock_t;
42 42 using std::size_t;
43 43 using std::time_t;
44 44 using std::tm;
45 45 using std::mbstate_t;
46 46 using std::fgetwc;
47 47 using std::fgetws;
48 48 using std::fputwc;
49 49 using std::fputws;
50 50 using std::ungetwc;
51 51 using std::getwc;
52 52 using std::getwchar;
53 53 using std::putwc;
54 54 using std::putwchar;
55 55 using std::wcstod;
56 56 using std::wcstol;
57 57 using std::wcstoul;
58 58 using std::wcscat;
59 59 using std::wcschr;
60 60 using std::wcscmp;
61 61 using std::wcscoll;
62 62 using std::wcscpy;
63 63 using std::wcscspn;
64 64 using std::wcslen;
65 65 using std::wcsncat;
66 66 using std::wcsncmp;
67 67 using std::wcsncpy;
68 68 using std::wcspbrk;
69 69 using std::wcsrchr;
70 70 using std::wcsspn;
71 71 using std::wcsxfrm;
72 72 using std::wcstok;
73 73 using std::wcsftime;
74 74 /* not XPG4 and not XPG4v2 */
75 75 #if (!defined(_XPG4) && !defined(_XPG4_2) || defined(_XPG5))
76 76 using std::btowc;
77 77 using std::fwprintf;
78 78 using std::fwscanf;
79 79 using std::fwide;
80 80 using std::mbsinit;
81 81 using std::mbrlen;
82 82 using std::mbrtowc;
83 83 using std::mbsrtowcs;
84 84 using std::swprintf;
85 85 using std::swscanf;
86 86 using std::vfwprintf;
87 87 using std::vwprintf;
88 88 using std::vswprintf;
89 89 using std::wcrtomb;
90 90 using std::wcsrtombs;
91 91 using std::wcsstr;
92 92 using std::wctob;
93 93 using std::wmemchr;
94 94 using std::wmemcmp;
95 95 using std::wmemcpy;
96 96 using std::wmemmove;
97 97 using std::wmemset;
98 98 using std::wprintf;
99 99 using std::wscanf;
100 100 #endif /* not XPG4 and not XPG4v2 */
101 101 #endif /* __cplusplus >= 199711L */
102 102
103 103 #ifdef __cplusplus
104 104 extern "C" {
105 105 #endif
106 106
107 107 #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
108 108 #if !defined(_WCTYPE_T) || __cplusplus >= 199711L
109 109 #define _WCTYPE_T
110 110 typedef int wctype_t;
111 111 #endif
112 112 #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
113 113
114 114 /*
115 115 * XPG6 requires that va_list be defined as defined in <stdarg.h>,
116 116 * however, inclusion of <stdarg.h> breaks Standard C namespace.
117 117 */
118 118 #if defined(_XPG6) && !defined(_VA_LIST)
119 119 #define _VA_LIST
120 120 typedef __va_list va_list;
121 121 #endif /* defined(_XPG6) && !defined(_VA_LIST) */
122 122
123 123 #ifdef __STDC__
124 124
125 125 #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
126 126 #if __cplusplus >= 199711L
127 127 namespace std {
128 128 #endif
129 129 extern int iswalpha(wint_t);
130 130 extern int iswupper(wint_t);
131 131 extern int iswlower(wint_t);
132 132 extern int iswdigit(wint_t);
133 133 extern int iswxdigit(wint_t);
134 134 extern int iswalnum(wint_t);
135 135 extern int iswspace(wint_t);
136 136 extern int iswpunct(wint_t);
137 137 extern int iswprint(wint_t);
138 138 extern int iswgraph(wint_t);
139 139 extern int iswcntrl(wint_t);
140 140 extern int iswctype(wint_t, wctype_t);
141 141 extern wint_t towlower(wint_t);
142 142 extern wint_t towupper(wint_t);
143 143 extern wchar_t *wcswcs(const wchar_t *, const wchar_t *);
144 144 extern int wcswidth(const wchar_t *, size_t);
145 145 extern int wcwidth(wchar_t);
146 146 extern wctype_t wctype(const char *);
147 147 #if __cplusplus >= 199711L
148 148 } /* namespace std */
149 149
150 150 using std::iswalpha;
151 151 using std::iswupper;
152 152 using std::iswlower;
153 153 using std::iswdigit;
154 154 using std::iswxdigit;
155 155 using std::iswalnum;
156 156 using std::iswspace;
157 157 using std::iswpunct;
158 158 using std::iswprint;
159 159 using std::iswgraph;
160 160 using std::iswcntrl;
161 161 using std::iswctype;
162 162 using std::towlower;
163 163 using std::towupper;
164 164 using std::wcswcs;
|
↓ open down ↓ |
164 lines elided |
↑ open up ↑ |
165 165 using std::wcswidth;
166 166 using std::wcwidth;
167 167 using std::wctype;
168 168 #endif
169 169 #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
170 170
171 171 #if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
172 172
173 173 #ifndef _LOCALE_T
174 174 #define _LOCALE_T
175 -typedef struct locale *locale_t;
175 +typedef struct _locale *locale_t;
176 176 #endif
177 177
178 178 extern size_t wcsnlen(const wchar_t *, size_t);
179 179 extern wchar_t *wcpcpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD);
180 180 extern wchar_t *wcpncpy(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
181 181 size_t);
182 182 extern size_t wcsxfrm_l(wchar_t *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
183 183 size_t, locale_t);
184 184 extern int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
185 185 extern wchar_t *wcsdup(const wchar_t *);
186 186 extern int wcscasecmp(const wchar_t *, const wchar_t *);
187 187 extern int wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t);
188 188 extern int wcsncasecmp(const wchar_t *, const wchar_t *, size_t);
189 189 extern int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t, locale_t);
190 190 extern size_t mbsnrtowcs(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
191 191 size_t, size_t, mbstate_t *_RESTRICT_KYWD);
192 192
193 193 #endif /* defined(_XPG7) || !defined(_STRICT_SYMBOLS) */
194 194
195 195 #else /* __STDC__ */
196 196
197 197 #if !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
198 198 extern int iswalpha();
199 199 extern int iswupper();
200 200 extern int iswlower();
201 201 extern int iswdigit();
202 202 extern int iswxdigit();
203 203 extern int iswalnum();
204 204 extern int iswspace();
205 205 extern int iswpunct();
206 206 extern int iswprint();
207 207 extern int iswgraph();
208 208 extern int iswcntrl();
209 209 extern int iswctype();
210 210 extern wint_t towlower();
211 211 extern wint_t towupper();
212 212 extern wchar_t *wcswcs();
213 213 extern int wcswidth();
214 214 extern int wcwidth();
215 215 extern wctype_t wctype();
216 216 #endif /* !defined(_STRICT_STDC) || defined(_XOPEN_SOURCE)... */
217 217
218 218 #if defined(_XGP7) || !defined(_STRICT_SYMBOLS)
219 219 extern size_t wcsnlen();
220 220 extern wchar_t *wcpcpy();
221 221 extern wchar_t *wcpncpy();
222 222 extern size_t wcsxfrm_l();
223 223 extern int wcscoll_l();
224 224 extern wchar_t *wcsdup();
225 225 extern int wcscasecmp();
226 226 extern int wcscasecmp_l();
227 227 extern int wcsncasecmp();
228 228 extern int wcsncasecmp_l();
229 229 extern size_t mbsnrtowcs();
230 230 #endif
231 231
232 232 #endif /* __STDC__ */
233 233
234 234 #ifdef __cplusplus
235 235 }
236 236 #endif
237 237
238 238 #endif /* _WCHAR_H */
|
↓ open down ↓ |
53 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX