Import upstream version 1.26
[debian/tar] / gnu / wchar.in.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
4
5    Copyright (C) 2007-2011 Free Software Foundation, Inc.
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3, or (at your option)
10    any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software Foundation,
19    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
20
21 /* Written by Eric Blake.  */
22
23 /*
24  * ISO C 99 <wchar.h> for platforms that have issues.
25  * <http://www.opengroup.org/susv3xbd/wchar.h.html>
26  *
27  * For now, this just ensures proper prerequisite inclusion order and
28  * the declaration of wcwidth().
29  */
30
31 #if __GNUC__ >= 3
32 @PRAGMA_SYSTEM_HEADER@
33 #endif
34 @PRAGMA_COLUMNS@
35
36 #if defined __need_mbstate_t || defined __need_wint_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H
37 /* Special invocation convention:
38    - Inside glibc and uClibc header files.
39    - On HP-UX 11.00 we have a sequence of nested includes
40      <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
41      once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
42      and once directly.  In both situations 'wint_t' is not yet defined,
43      therefore we cannot provide the function overrides; instead include only
44      the system's <wchar.h>.
45    - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
46      the latter includes <wchar.h>.  But here, we have no way to detect whether
47      <wctype.h> is completely included or is still being included.  */
48
49 #@INCLUDE_NEXT@ @NEXT_WCHAR_H@
50
51 #else
52 /* Normal invocation convention.  */
53
54 #ifndef _GL_WCHAR_H
55
56 #define _GL_ALREADY_INCLUDING_WCHAR_H
57
58 #if @HAVE_FEATURES_H@
59 # include <features.h> /* for __GLIBC__ */
60 #endif
61
62 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
63    <wchar.h>.
64    BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
65    included before <wchar.h>.
66    But avoid namespace pollution on glibc systems.  */
67 #ifndef __GLIBC__
68 # include <stddef.h>
69 # include <stdio.h>
70 # include <time.h>
71 #endif
72
73 /* Include the original <wchar.h> if it exists.
74    Some builds of uClibc lack it.  */
75 /* The include_next requires a split double-inclusion guard.  */
76 #if @HAVE_WCHAR_H@
77 # @INCLUDE_NEXT@ @NEXT_WCHAR_H@
78 #endif
79
80 #undef _GL_ALREADY_INCLUDING_WCHAR_H
81
82 #ifndef _GL_WCHAR_H
83 #define _GL_WCHAR_H
84
85 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
86
87 /* The definition of _GL_ARG_NONNULL is copied here.  */
88
89 /* The definition of _GL_WARN_ON_USE is copied here.  */
90
91
92 /* Define wint_t and WEOF.  (Also done in wctype.in.h.)  */
93 #if !@HAVE_WINT_T@ && !defined wint_t
94 # define wint_t int
95 # ifndef WEOF
96 #  define WEOF -1
97 # endif
98 #else
99 # ifndef WEOF
100 #  define WEOF ((wint_t) -1)
101 # endif
102 #endif
103
104
105 /* Override mbstate_t if it is too small.
106    On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
107    implementing mbrtowc for encodings like UTF-8.  */
108 #if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
109 # if !GNULIB_defined_mbstate_t
110 typedef int rpl_mbstate_t;
111 #  undef mbstate_t
112 #  define mbstate_t rpl_mbstate_t
113 #  define GNULIB_defined_mbstate_t 1
114 # endif
115 #endif
116
117
118 /* Convert a single-byte character to a wide character.  */
119 #if @GNULIB_BTOWC@
120 # if @REPLACE_BTOWC@
121 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
122 #   undef btowc
123 #   define btowc rpl_btowc
124 #  endif
125 _GL_FUNCDECL_RPL (btowc, wint_t, (int c));
126 _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
127 # else
128 #  if !@HAVE_BTOWC@
129 _GL_FUNCDECL_SYS (btowc, wint_t, (int c));
130 #  endif
131 _GL_CXXALIAS_SYS (btowc, wint_t, (int c));
132 # endif
133 _GL_CXXALIASWARN (btowc);
134 #elif defined GNULIB_POSIXCHECK
135 # undef btowc
136 # if HAVE_RAW_DECL_BTOWC
137 _GL_WARN_ON_USE (btowc, "btowc is unportable - "
138                  "use gnulib module btowc for portability");
139 # endif
140 #endif
141
142
143 /* Convert a wide character to a single-byte character.  */
144 #if @GNULIB_WCTOB@
145 # if @REPLACE_WCTOB@
146 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
147 #   undef wctob
148 #   define wctob rpl_wctob
149 #  endif
150 _GL_FUNCDECL_RPL (wctob, int, (wint_t wc));
151 _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
152 # else
153 #  if !defined wctob && !@HAVE_DECL_WCTOB@
154 /* wctob is provided by gnulib, or wctob exists but is not declared.  */
155 _GL_FUNCDECL_SYS (wctob, int, (wint_t wc));
156 #  endif
157 _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
158 # endif
159 _GL_CXXALIASWARN (wctob);
160 #elif defined GNULIB_POSIXCHECK
161 # undef wctob
162 # if HAVE_RAW_DECL_WCTOB
163 _GL_WARN_ON_USE (wctob, "wctob is unportable - "
164                  "use gnulib module wctob for portability");
165 # endif
166 #endif
167
168
169 /* Test whether *PS is in the initial state.  */
170 #if @GNULIB_MBSINIT@
171 # if @REPLACE_MBSINIT@
172 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
173 #   undef mbsinit
174 #   define mbsinit rpl_mbsinit
175 #  endif
176 _GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
177 _GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
178 # else
179 #  if !@HAVE_MBSINIT@
180 _GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
181 #  endif
182 _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
183 # endif
184 _GL_CXXALIASWARN (mbsinit);
185 #elif defined GNULIB_POSIXCHECK
186 # undef mbsinit
187 # if HAVE_RAW_DECL_MBSINIT
188 _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
189                  "use gnulib module mbsinit for portability");
190 # endif
191 #endif
192
193
194 /* Convert a multibyte character to a wide character.  */
195 #if @GNULIB_MBRTOWC@
196 # if @REPLACE_MBRTOWC@
197 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
198 #   undef mbrtowc
199 #   define mbrtowc rpl_mbrtowc
200 #  endif
201 _GL_FUNCDECL_RPL (mbrtowc, size_t,
202                   (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
203 _GL_CXXALIAS_RPL (mbrtowc, size_t,
204                   (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
205 # else
206 #  if !@HAVE_MBRTOWC@
207 _GL_FUNCDECL_SYS (mbrtowc, size_t,
208                   (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
209 #  endif
210 _GL_CXXALIAS_SYS (mbrtowc, size_t,
211                   (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
212 # endif
213 _GL_CXXALIASWARN (mbrtowc);
214 #elif defined GNULIB_POSIXCHECK
215 # undef mbrtowc
216 # if HAVE_RAW_DECL_MBRTOWC
217 _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
218                  "use gnulib module mbrtowc for portability");
219 # endif
220 #endif
221
222
223 /* Recognize a multibyte character.  */
224 #if @GNULIB_MBRLEN@
225 # if @REPLACE_MBRLEN@
226 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
227 #   undef mbrlen
228 #   define mbrlen rpl_mbrlen
229 #  endif
230 _GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
231 _GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
232 # else
233 #  if !@HAVE_MBRLEN@
234 _GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
235 #  endif
236 _GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
237 # endif
238 _GL_CXXALIASWARN (mbrlen);
239 #elif defined GNULIB_POSIXCHECK
240 # undef mbrlen
241 # if HAVE_RAW_DECL_MBRLEN
242 _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
243                  "use gnulib module mbrlen for portability");
244 # endif
245 #endif
246
247
248 /* Convert a string to a wide string.  */
249 #if @GNULIB_MBSRTOWCS@
250 # if @REPLACE_MBSRTOWCS@
251 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
252 #   undef mbsrtowcs
253 #   define mbsrtowcs rpl_mbsrtowcs
254 #  endif
255 _GL_FUNCDECL_RPL (mbsrtowcs, size_t,
256                   (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
257                   _GL_ARG_NONNULL ((2)));
258 _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
259                   (wchar_t *dest, const char **srcp, size_t len,
260                    mbstate_t *ps));
261 # else
262 #  if !@HAVE_MBSRTOWCS@
263 _GL_FUNCDECL_SYS (mbsrtowcs, size_t,
264                   (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
265                   _GL_ARG_NONNULL ((2)));
266 #  endif
267 _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
268                   (wchar_t *dest, const char **srcp, size_t len,
269                    mbstate_t *ps));
270 # endif
271 _GL_CXXALIASWARN (mbsrtowcs);
272 #elif defined GNULIB_POSIXCHECK
273 # undef mbsrtowcs
274 # if HAVE_RAW_DECL_MBSRTOWCS
275 _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
276                  "use gnulib module mbsrtowcs for portability");
277 # endif
278 #endif
279
280
281 /* Convert a string to a wide string.  */
282 #if @GNULIB_MBSNRTOWCS@
283 # if @REPLACE_MBSNRTOWCS@
284 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
285 #   undef mbsnrtowcs
286 #   define mbsnrtowcs rpl_mbsnrtowcs
287 #  endif
288 _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
289                   (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
290                    mbstate_t *ps)
291                   _GL_ARG_NONNULL ((2)));
292 _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
293                   (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
294                    mbstate_t *ps));
295 # else
296 #  if !@HAVE_MBSNRTOWCS@
297 _GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
298                   (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
299                    mbstate_t *ps)
300                   _GL_ARG_NONNULL ((2)));
301 #  endif
302 _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
303                   (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
304                    mbstate_t *ps));
305 # endif
306 _GL_CXXALIASWARN (mbsnrtowcs);
307 #elif defined GNULIB_POSIXCHECK
308 # undef mbsnrtowcs
309 # if HAVE_RAW_DECL_MBSNRTOWCS
310 _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
311                  "use gnulib module mbsnrtowcs for portability");
312 # endif
313 #endif
314
315
316 /* Convert a wide character to a multibyte character.  */
317 #if @GNULIB_WCRTOMB@
318 # if @REPLACE_WCRTOMB@
319 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
320 #   undef wcrtomb
321 #   define wcrtomb rpl_wcrtomb
322 #  endif
323 _GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
324 _GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
325 # else
326 #  if !@HAVE_WCRTOMB@
327 _GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
328 #  endif
329 _GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
330 # endif
331 _GL_CXXALIASWARN (wcrtomb);
332 #elif defined GNULIB_POSIXCHECK
333 # undef wcrtomb
334 # if HAVE_RAW_DECL_WCRTOMB
335 _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
336                  "use gnulib module wcrtomb for portability");
337 # endif
338 #endif
339
340
341 /* Convert a wide string to a string.  */
342 #if @GNULIB_WCSRTOMBS@
343 # if @REPLACE_WCSRTOMBS@
344 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
345 #   undef wcsrtombs
346 #   define wcsrtombs rpl_wcsrtombs
347 #  endif
348 _GL_FUNCDECL_RPL (wcsrtombs, size_t,
349                   (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
350                   _GL_ARG_NONNULL ((2)));
351 _GL_CXXALIAS_RPL (wcsrtombs, size_t,
352                   (char *dest, const wchar_t **srcp, size_t len,
353                    mbstate_t *ps));
354 # else
355 #  if !@HAVE_WCSRTOMBS@
356 _GL_FUNCDECL_SYS (wcsrtombs, size_t,
357                   (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
358                   _GL_ARG_NONNULL ((2)));
359 #  endif
360 _GL_CXXALIAS_SYS (wcsrtombs, size_t,
361                   (char *dest, const wchar_t **srcp, size_t len,
362                    mbstate_t *ps));
363 # endif
364 _GL_CXXALIASWARN (wcsrtombs);
365 #elif defined GNULIB_POSIXCHECK
366 # undef wcsrtombs
367 # if HAVE_RAW_DECL_WCSRTOMBS
368 _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
369                  "use gnulib module wcsrtombs for portability");
370 # endif
371 #endif
372
373
374 /* Convert a wide string to a string.  */
375 #if @GNULIB_WCSNRTOMBS@
376 # if @REPLACE_WCSNRTOMBS@
377 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
378 #   undef wcsnrtombs
379 #   define wcsnrtombs rpl_wcsnrtombs
380 #  endif
381 _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
382                   (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
383                    mbstate_t *ps)
384                   _GL_ARG_NONNULL ((2)));
385 _GL_CXXALIAS_RPL (wcsnrtombs, size_t,
386                   (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
387                    mbstate_t *ps));
388 # else
389 #  if !@HAVE_WCSNRTOMBS@
390 _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
391                   (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
392                    mbstate_t *ps)
393                   _GL_ARG_NONNULL ((2)));
394 #  endif
395 _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
396                   (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
397                    mbstate_t *ps));
398 # endif
399 _GL_CXXALIASWARN (wcsnrtombs);
400 #elif defined GNULIB_POSIXCHECK
401 # undef wcsnrtombs
402 # if HAVE_RAW_DECL_WCSNRTOMBS
403 _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
404                  "use gnulib module wcsnrtombs for portability");
405 # endif
406 #endif
407
408
409 /* Return the number of screen columns needed for WC.  */
410 #if @GNULIB_WCWIDTH@
411 # if @REPLACE_WCWIDTH@
412 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
413 #   undef wcwidth
414 #   define wcwidth rpl_wcwidth
415 #  endif
416 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
417 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
418 # else
419 #  if !@HAVE_DECL_WCWIDTH@
420 /* wcwidth exists but is not declared.  */
421 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
422 #  endif
423 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
424 # endif
425 _GL_CXXALIASWARN (wcwidth);
426 #elif defined GNULIB_POSIXCHECK
427 # undef wcwidth
428 # if HAVE_RAW_DECL_WCWIDTH
429 _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
430                  "use gnulib module wcwidth for portability");
431 # endif
432 #endif
433
434
435 /* Search N wide characters of S for C.  */
436 #if @GNULIB_WMEMCHR@
437 # if !@HAVE_WMEMCHR@
438 _GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n));
439 # endif
440 _GL_CXXALIAS_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n));
441 _GL_CXXALIASWARN (wmemchr);
442 #elif defined GNULIB_POSIXCHECK
443 # undef wmemchr
444 # if HAVE_RAW_DECL_WMEMCHR
445 _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
446                  "use gnulib module wmemchr for portability");
447 # endif
448 #endif
449
450
451 /* Compare N wide characters of S1 and S2.  */
452 #if @GNULIB_WMEMCMP@
453 # if !@HAVE_WMEMCMP@
454 _GL_FUNCDECL_SYS (wmemcmp, int,
455                   (const wchar_t *s1, const wchar_t *s2, size_t n));
456 # endif
457 _GL_CXXALIAS_SYS (wmemcmp, int,
458                   (const wchar_t *s1, const wchar_t *s2, size_t n));
459 _GL_CXXALIASWARN (wmemcmp);
460 #elif defined GNULIB_POSIXCHECK
461 # undef wmemcmp
462 # if HAVE_RAW_DECL_WMEMCMP
463 _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
464                  "use gnulib module wmemcmp for portability");
465 # endif
466 #endif
467
468
469 /* Copy N wide characters of SRC to DEST.  */
470 #if @GNULIB_WMEMCPY@
471 # if !@HAVE_WMEMCPY@
472 _GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
473                   (wchar_t *dest, const wchar_t *src, size_t n));
474 # endif
475 _GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
476                   (wchar_t *dest, const wchar_t *src, size_t n));
477 _GL_CXXALIASWARN (wmemcpy);
478 #elif defined GNULIB_POSIXCHECK
479 # undef wmemcpy
480 # if HAVE_RAW_DECL_WMEMCPY
481 _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
482                  "use gnulib module wmemcpy for portability");
483 # endif
484 #endif
485
486
487 /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
488    overlapping memory areas.  */
489 #if @GNULIB_WMEMMOVE@
490 # if !@HAVE_WMEMMOVE@
491 _GL_FUNCDECL_SYS (wmemmove, wchar_t *,
492                   (wchar_t *dest, const wchar_t *src, size_t n));
493 # endif
494 _GL_CXXALIAS_SYS (wmemmove, wchar_t *,
495                   (wchar_t *dest, const wchar_t *src, size_t n));
496 _GL_CXXALIASWARN (wmemmove);
497 #elif defined GNULIB_POSIXCHECK
498 # undef wmemmove
499 # if HAVE_RAW_DECL_WMEMMOVE
500 _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
501                  "use gnulib module wmemmove for portability");
502 # endif
503 #endif
504
505
506 /* Set N wide characters of S to C.  */
507 #if @GNULIB_WMEMSET@
508 # if !@HAVE_WMEMSET@
509 _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
510 # endif
511 _GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
512 _GL_CXXALIASWARN (wmemset);
513 #elif defined GNULIB_POSIXCHECK
514 # undef wmemset
515 # if HAVE_RAW_DECL_WMEMSET
516 _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
517                  "use gnulib module wmemset for portability");
518 # endif
519 #endif
520
521
522 /* Return the number of wide characters in S.  */
523 #if @GNULIB_WCSLEN@
524 # if !@HAVE_WCSLEN@
525 _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s));
526 # endif
527 _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
528 _GL_CXXALIASWARN (wcslen);
529 #elif defined GNULIB_POSIXCHECK
530 # undef wcslen
531 # if HAVE_RAW_DECL_WCSLEN
532 _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
533                  "use gnulib module wcslen for portability");
534 # endif
535 #endif
536
537
538 /* Return the number of wide characters in S, but at most MAXLEN.  */
539 #if @GNULIB_WCSNLEN@
540 # if !@HAVE_WCSNLEN@
541 _GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
542 # endif
543 _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
544 _GL_CXXALIASWARN (wcsnlen);
545 #elif defined GNULIB_POSIXCHECK
546 # undef wcsnlen
547 # if HAVE_RAW_DECL_WCSNLEN
548 _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
549                  "use gnulib module wcsnlen for portability");
550 # endif
551 #endif
552
553
554 /* Copy SRC to DEST.  */
555 #if @GNULIB_WCSCPY@
556 # if !@HAVE_WCSCPY@
557 _GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
558 # endif
559 _GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
560 _GL_CXXALIASWARN (wcscpy);
561 #elif defined GNULIB_POSIXCHECK
562 # undef wcscpy
563 # if HAVE_RAW_DECL_WCSCPY
564 _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
565                  "use gnulib module wcscpy for portability");
566 # endif
567 #endif
568
569
570 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST.  */
571 #if @GNULIB_WCPCPY@
572 # if !@HAVE_WCPCPY@
573 _GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
574 # endif
575 _GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
576 _GL_CXXALIASWARN (wcpcpy);
577 #elif defined GNULIB_POSIXCHECK
578 # undef wcpcpy
579 # if HAVE_RAW_DECL_WCPCPY
580 _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
581                  "use gnulib module wcpcpy for portability");
582 # endif
583 #endif
584
585
586 /* Copy no more than N wide characters of SRC to DEST.  */
587 #if @GNULIB_WCSNCPY@
588 # if !@HAVE_WCSNCPY@
589 _GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
590                   (wchar_t *dest, const wchar_t *src, size_t n));
591 # endif
592 _GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
593                   (wchar_t *dest, const wchar_t *src, size_t n));
594 _GL_CXXALIASWARN (wcsncpy);
595 #elif defined GNULIB_POSIXCHECK
596 # undef wcsncpy
597 # if HAVE_RAW_DECL_WCSNCPY
598 _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
599                  "use gnulib module wcsncpy for portability");
600 # endif
601 #endif
602
603
604 /* Copy no more than N characters of SRC to DEST, returning the address of
605    the last character written into DEST.  */
606 #if @GNULIB_WCPNCPY@
607 # if !@HAVE_WCPNCPY@
608 _GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
609                   (wchar_t *dest, const wchar_t *src, size_t n));
610 # endif
611 _GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
612                   (wchar_t *dest, const wchar_t *src, size_t n));
613 _GL_CXXALIASWARN (wcpncpy);
614 #elif defined GNULIB_POSIXCHECK
615 # undef wcpncpy
616 # if HAVE_RAW_DECL_WCPNCPY
617 _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
618                  "use gnulib module wcpncpy for portability");
619 # endif
620 #endif
621
622
623 /* Append SRC onto DEST.  */
624 #if @GNULIB_WCSCAT@
625 # if !@HAVE_WCSCAT@
626 _GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
627 # endif
628 _GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
629 _GL_CXXALIASWARN (wcscat);
630 #elif defined GNULIB_POSIXCHECK
631 # undef wcscat
632 # if HAVE_RAW_DECL_WCSCAT
633 _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
634                  "use gnulib module wcscat for portability");
635 # endif
636 #endif
637
638
639 /* Append no more than N wide characters of SRC onto DEST.  */
640 #if @GNULIB_WCSNCAT@
641 # if !@HAVE_WCSNCAT@
642 _GL_FUNCDECL_SYS (wcsncat, wchar_t *,
643                   (wchar_t *dest, const wchar_t *src, size_t n));
644 # endif
645 _GL_CXXALIAS_SYS (wcsncat, wchar_t *,
646                   (wchar_t *dest, const wchar_t *src, size_t n));
647 _GL_CXXALIASWARN (wcsncat);
648 #elif defined GNULIB_POSIXCHECK
649 # undef wcsncat
650 # if HAVE_RAW_DECL_WCSNCAT
651 _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
652                  "use gnulib module wcsncat for portability");
653 # endif
654 #endif
655
656
657 /* Compare S1 and S2.  */
658 #if @GNULIB_WCSCMP@
659 # if !@HAVE_WCSCMP@
660 _GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
661 # endif
662 _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
663 _GL_CXXALIASWARN (wcscmp);
664 #elif defined GNULIB_POSIXCHECK
665 # undef wcscmp
666 # if HAVE_RAW_DECL_WCSCMP
667 _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
668                  "use gnulib module wcscmp for portability");
669 # endif
670 #endif
671
672
673 /* Compare no more than N wide characters of S1 and S2.  */
674 #if @GNULIB_WCSNCMP@
675 # if !@HAVE_WCSNCMP@
676 _GL_FUNCDECL_SYS (wcsncmp, int,
677                   (const wchar_t *s1, const wchar_t *s2, size_t n));
678 # endif
679 _GL_CXXALIAS_SYS (wcsncmp, int,
680                   (const wchar_t *s1, const wchar_t *s2, size_t n));
681 _GL_CXXALIASWARN (wcsncmp);
682 #elif defined GNULIB_POSIXCHECK
683 # undef wcsncmp
684 # if HAVE_RAW_DECL_WCSNCMP
685 _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
686                  "use gnulib module wcsncmp for portability");
687 # endif
688 #endif
689
690
691 /* Compare S1 and S2, ignoring case.  */
692 #if @GNULIB_WCSCASECMP@
693 # if !@HAVE_WCSCASECMP@
694 _GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
695 # endif
696 _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
697 _GL_CXXALIASWARN (wcscasecmp);
698 #elif defined GNULIB_POSIXCHECK
699 # undef wcscasecmp
700 # if HAVE_RAW_DECL_WCSCASECMP
701 _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
702                  "use gnulib module wcscasecmp for portability");
703 # endif
704 #endif
705
706
707 /* Compare no more than N chars of S1 and S2, ignoring case.  */
708 #if @GNULIB_WCSNCASECMP@
709 # if !@HAVE_WCSNCASECMP@
710 _GL_FUNCDECL_SYS (wcsncasecmp, int,
711                   (const wchar_t *s1, const wchar_t *s2, size_t n));
712 # endif
713 _GL_CXXALIAS_SYS (wcsncasecmp, int,
714                   (const wchar_t *s1, const wchar_t *s2, size_t n));
715 _GL_CXXALIASWARN (wcsncasecmp);
716 #elif defined GNULIB_POSIXCHECK
717 # undef wcsncasecmp
718 # if HAVE_RAW_DECL_WCSNCASECMP
719 _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
720                  "use gnulib module wcsncasecmp for portability");
721 # endif
722 #endif
723
724
725 /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
726    category of the current locale.  */
727 #if @GNULIB_WCSCOLL@
728 # if !@HAVE_WCSCOLL@
729 _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
730 # endif
731 _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
732 _GL_CXXALIASWARN (wcscoll);
733 #elif defined GNULIB_POSIXCHECK
734 # undef wcscoll
735 # if HAVE_RAW_DECL_WCSCOLL
736 _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
737                  "use gnulib module wcscoll for portability");
738 # endif
739 #endif
740
741
742 /* Transform S2 into array pointed to by S1 such that if wcscmp is applied
743    to two transformed strings the result is the as applying 'wcscoll' to the
744    original strings.  */
745 #if @GNULIB_WCSXFRM@
746 # if !@HAVE_WCSXFRM@
747 _GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
748 # endif
749 _GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
750 _GL_CXXALIASWARN (wcsxfrm);
751 #elif defined GNULIB_POSIXCHECK
752 # undef wcsxfrm
753 # if HAVE_RAW_DECL_WCSXFRM
754 _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
755                  "use gnulib module wcsxfrm for portability");
756 # endif
757 #endif
758
759
760 /* Duplicate S, returning an identical malloc'd string.  */
761 #if @GNULIB_WCSDUP@
762 # if !@HAVE_WCSDUP@
763 _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
764 # endif
765 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
766 _GL_CXXALIASWARN (wcsdup);
767 #elif defined GNULIB_POSIXCHECK
768 # undef wcsdup
769 # if HAVE_RAW_DECL_WCSDUP
770 _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
771                  "use gnulib module wcsdup for portability");
772 # endif
773 #endif
774
775
776 /* Find the first occurrence of WC in WCS.  */
777 #if @GNULIB_WCSCHR@
778 # if !@HAVE_WCSCHR@
779 _GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
780 # endif
781 _GL_CXXALIAS_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
782 _GL_CXXALIASWARN (wcschr);
783 #elif defined GNULIB_POSIXCHECK
784 # undef wcschr
785 # if HAVE_RAW_DECL_WCSCHR
786 _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
787                  "use gnulib module wcschr for portability");
788 # endif
789 #endif
790
791
792 /* Find the last occurrence of WC in WCS.  */
793 #if @GNULIB_WCSRCHR@
794 # if !@HAVE_WCSRCHR@
795 _GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
796 # endif
797 _GL_CXXALIAS_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
798 _GL_CXXALIASWARN (wcsrchr);
799 #elif defined GNULIB_POSIXCHECK
800 # undef wcsrchr
801 # if HAVE_RAW_DECL_WCSRCHR
802 _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
803                  "use gnulib module wcsrchr for portability");
804 # endif
805 #endif
806
807
808 /* Return the length of the initial segmet of WCS which consists entirely
809    of wide characters not in REJECT.  */
810 #if @GNULIB_WCSCSPN@
811 # if !@HAVE_WCSCSPN@
812 _GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
813 # endif
814 _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
815 _GL_CXXALIASWARN (wcscspn);
816 #elif defined GNULIB_POSIXCHECK
817 # undef wcscspn
818 # if HAVE_RAW_DECL_WCSCSPN
819 _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
820                  "use gnulib module wcscspn for portability");
821 # endif
822 #endif
823
824
825 /* Return the length of the initial segmet of WCS which consists entirely
826    of wide characters in ACCEPT.  */
827 #if @GNULIB_WCSSPN@
828 # if !@HAVE_WCSSPN@
829 _GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
830 # endif
831 _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
832 _GL_CXXALIASWARN (wcsspn);
833 #elif defined GNULIB_POSIXCHECK
834 # undef wcsspn
835 # if HAVE_RAW_DECL_WCSSPN
836 _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
837                  "use gnulib module wcsspn for portability");
838 # endif
839 #endif
840
841
842 /* Find the first occurrence in WCS of any character in ACCEPT.  */
843 #if @GNULIB_WCSPBRK@
844 # if !@HAVE_WCSPBRK@
845 _GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
846                   (const wchar_t *wcs, const wchar_t *accept));
847 # endif
848 _GL_CXXALIAS_SYS (wcspbrk, wchar_t *,
849                   (const wchar_t *wcs, const wchar_t *accept));
850 _GL_CXXALIASWARN (wcspbrk);
851 #elif defined GNULIB_POSIXCHECK
852 # undef wcspbrk
853 # if HAVE_RAW_DECL_WCSPBRK
854 _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
855                  "use gnulib module wcspbrk for portability");
856 # endif
857 #endif
858
859
860 /* Find the first occurrence of NEEDLE in HAYSTACK.  */
861 #if @GNULIB_WCSSTR@
862 # if !@HAVE_WCSSTR@
863 _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
864                   (const wchar_t *haystack, const wchar_t *needle));
865 # endif
866 _GL_CXXALIAS_SYS (wcsstr, wchar_t *,
867                   (const wchar_t *haystack, const wchar_t *needle));
868 _GL_CXXALIASWARN (wcsstr);
869 #elif defined GNULIB_POSIXCHECK
870 # undef wcsstr
871 # if HAVE_RAW_DECL_WCSSTR
872 _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
873                  "use gnulib module wcsstr for portability");
874 # endif
875 #endif
876
877
878 /* Divide WCS into tokens separated by characters in DELIM.  */
879 #if @GNULIB_WCSTOK@
880 # if !@HAVE_WCSTOK@
881 _GL_FUNCDECL_SYS (wcstok, wchar_t *,
882                   (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
883 # endif
884 _GL_CXXALIAS_SYS (wcstok, wchar_t *,
885                   (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
886 _GL_CXXALIASWARN (wcstok);
887 #elif defined GNULIB_POSIXCHECK
888 # undef wcstok
889 # if HAVE_RAW_DECL_WCSTOK
890 _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
891                  "use gnulib module wcstok for portability");
892 # endif
893 #endif
894
895
896 /* Determine number of column positions required for first N wide
897    characters (or fewer if S ends before this) in S.  */
898 #if @GNULIB_WCSWIDTH@
899 # if @REPLACE_WCSWIDTH@
900 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
901 #   undef wcswidth
902 #   define wcswidth rpl_wcswidth
903 #  endif
904 _GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n));
905 _GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
906 # else
907 #  if !@HAVE_WCSWIDTH@
908 _GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n));
909 #  endif
910 _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
911 # endif
912 _GL_CXXALIASWARN (wcswidth);
913 #elif defined GNULIB_POSIXCHECK
914 # undef wcswidth
915 # if HAVE_RAW_DECL_WCSWIDTH
916 _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
917                  "use gnulib module wcswidth for portability");
918 # endif
919 #endif
920
921
922 #endif /* _GL_WCHAR_H */
923 #endif /* _GL_WCHAR_H */
924 #endif