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.
5 Copyright (C) 2007-2011 Free Software Foundation, Inc.
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)
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.
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. */
21 /* Written by Eric Blake. */
24 * ISO C 99 <wchar.h> for platforms that have issues.
25 * <http://www.opengroup.org/susv3xbd/wchar.h.html>
27 * For now, this just ensures proper prerequisite inclusion order and
28 * the declaration of wcwidth().
32 @PRAGMA_SYSTEM_HEADER@
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. */
49 #@INCLUDE_NEXT@ @NEXT_WCHAR_H@
52 /* Normal invocation convention. */
56 #define _GL_ALREADY_INCLUDING_WCHAR_H
59 # include <features.h> /* for __GLIBC__ */
62 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
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. */
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. */
77 # @INCLUDE_NEXT@ @NEXT_WCHAR_H@
80 #undef _GL_ALREADY_INCLUDING_WCHAR_H
85 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
87 /* The definition of _GL_ARG_NONNULL is copied here. */
89 /* The definition of _GL_WARN_ON_USE is copied here. */
92 /* Define wint_t and WEOF. (Also done in wctype.in.h.) */
93 #if !@HAVE_WINT_T@ && !defined wint_t
100 # define WEOF ((wint_t) -1)
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;
112 # define mbstate_t rpl_mbstate_t
113 # define GNULIB_defined_mbstate_t 1
118 /* Convert a single-byte character to a wide character. */
121 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
123 # define btowc rpl_btowc
125 _GL_FUNCDECL_RPL (btowc, wint_t, (int c));
126 _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
129 _GL_FUNCDECL_SYS (btowc, wint_t, (int c));
131 _GL_CXXALIAS_SYS (btowc, wint_t, (int c));
133 _GL_CXXALIASWARN (btowc);
134 #elif defined GNULIB_POSIXCHECK
136 # if HAVE_RAW_DECL_BTOWC
137 _GL_WARN_ON_USE (btowc, "btowc is unportable - "
138 "use gnulib module btowc for portability");
143 /* Convert a wide character to a single-byte character. */
146 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
148 # define wctob rpl_wctob
150 _GL_FUNCDECL_RPL (wctob, int, (wint_t wc));
151 _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
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));
157 _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
159 _GL_CXXALIASWARN (wctob);
160 #elif defined GNULIB_POSIXCHECK
162 # if HAVE_RAW_DECL_WCTOB
163 _GL_WARN_ON_USE (wctob, "wctob is unportable - "
164 "use gnulib module wctob for portability");
169 /* Test whether *PS is in the initial state. */
171 # if @REPLACE_MBSINIT@
172 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
174 # define mbsinit rpl_mbsinit
176 _GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
177 _GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
180 _GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
182 _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
184 _GL_CXXALIASWARN (mbsinit);
185 #elif defined GNULIB_POSIXCHECK
187 # if HAVE_RAW_DECL_MBSINIT
188 _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
189 "use gnulib module mbsinit for portability");
194 /* Convert a multibyte character to a wide character. */
196 # if @REPLACE_MBRTOWC@
197 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
199 # define mbrtowc rpl_mbrtowc
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));
207 _GL_FUNCDECL_SYS (mbrtowc, size_t,
208 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
210 _GL_CXXALIAS_SYS (mbrtowc, size_t,
211 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
213 _GL_CXXALIASWARN (mbrtowc);
214 #elif defined GNULIB_POSIXCHECK
216 # if HAVE_RAW_DECL_MBRTOWC
217 _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
218 "use gnulib module mbrtowc for portability");
223 /* Recognize a multibyte character. */
225 # if @REPLACE_MBRLEN@
226 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
228 # define mbrlen rpl_mbrlen
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));
234 _GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
236 _GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
238 _GL_CXXALIASWARN (mbrlen);
239 #elif defined GNULIB_POSIXCHECK
241 # if HAVE_RAW_DECL_MBRLEN
242 _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
243 "use gnulib module mbrlen for portability");
248 /* Convert a string to a wide string. */
249 #if @GNULIB_MBSRTOWCS@
250 # if @REPLACE_MBSRTOWCS@
251 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
253 # define mbsrtowcs rpl_mbsrtowcs
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,
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)));
267 _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
268 (wchar_t *dest, const char **srcp, size_t len,
271 _GL_CXXALIASWARN (mbsrtowcs);
272 #elif defined GNULIB_POSIXCHECK
274 # if HAVE_RAW_DECL_MBSRTOWCS
275 _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
276 "use gnulib module mbsrtowcs for portability");
281 /* Convert a string to a wide string. */
282 #if @GNULIB_MBSNRTOWCS@
283 # if @REPLACE_MBSNRTOWCS@
284 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
286 # define mbsnrtowcs rpl_mbsnrtowcs
288 _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
289 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
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,
296 # if !@HAVE_MBSNRTOWCS@
297 _GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
298 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
300 _GL_ARG_NONNULL ((2)));
302 _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
303 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
306 _GL_CXXALIASWARN (mbsnrtowcs);
307 #elif defined GNULIB_POSIXCHECK
309 # if HAVE_RAW_DECL_MBSNRTOWCS
310 _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
311 "use gnulib module mbsnrtowcs for portability");
316 /* Convert a wide character to a multibyte character. */
318 # if @REPLACE_WCRTOMB@
319 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
321 # define wcrtomb rpl_wcrtomb
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));
327 _GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
329 _GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
331 _GL_CXXALIASWARN (wcrtomb);
332 #elif defined GNULIB_POSIXCHECK
334 # if HAVE_RAW_DECL_WCRTOMB
335 _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
336 "use gnulib module wcrtomb for portability");
341 /* Convert a wide string to a string. */
342 #if @GNULIB_WCSRTOMBS@
343 # if @REPLACE_WCSRTOMBS@
344 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
346 # define wcsrtombs rpl_wcsrtombs
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,
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)));
360 _GL_CXXALIAS_SYS (wcsrtombs, size_t,
361 (char *dest, const wchar_t **srcp, size_t len,
364 _GL_CXXALIASWARN (wcsrtombs);
365 #elif defined GNULIB_POSIXCHECK
367 # if HAVE_RAW_DECL_WCSRTOMBS
368 _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
369 "use gnulib module wcsrtombs for portability");
374 /* Convert a wide string to a string. */
375 #if @GNULIB_WCSNRTOMBS@
376 # if @REPLACE_WCSNRTOMBS@
377 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
379 # define wcsnrtombs rpl_wcsnrtombs
381 _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
382 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
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,
389 # if !@HAVE_WCSNRTOMBS@
390 _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
391 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
393 _GL_ARG_NONNULL ((2)));
395 _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
396 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
399 _GL_CXXALIASWARN (wcsnrtombs);
400 #elif defined GNULIB_POSIXCHECK
402 # if HAVE_RAW_DECL_WCSNRTOMBS
403 _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
404 "use gnulib module wcsnrtombs for portability");
409 /* Return the number of screen columns needed for WC. */
411 # if @REPLACE_WCWIDTH@
412 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
414 # define wcwidth rpl_wcwidth
416 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t));
417 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
419 # if !@HAVE_DECL_WCWIDTH@
420 /* wcwidth exists but is not declared. */
421 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t));
423 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
425 _GL_CXXALIASWARN (wcwidth);
426 #elif defined GNULIB_POSIXCHECK
428 # if HAVE_RAW_DECL_WCWIDTH
429 _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
430 "use gnulib module wcwidth for portability");
435 /* Search N wide characters of S for C. */
438 _GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n));
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
444 # if HAVE_RAW_DECL_WMEMCHR
445 _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
446 "use gnulib module wmemchr for portability");
451 /* Compare N wide characters of S1 and S2. */
454 _GL_FUNCDECL_SYS (wmemcmp, int,
455 (const wchar_t *s1, const wchar_t *s2, size_t n));
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
462 # if HAVE_RAW_DECL_WMEMCMP
463 _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
464 "use gnulib module wmemcmp for portability");
469 /* Copy N wide characters of SRC to DEST. */
472 _GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
473 (wchar_t *dest, const wchar_t *src, size_t n));
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
480 # if HAVE_RAW_DECL_WMEMCPY
481 _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
482 "use gnulib module wmemcpy for portability");
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));
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
499 # if HAVE_RAW_DECL_WMEMMOVE
500 _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
501 "use gnulib module wmemmove for portability");
506 /* Set N wide characters of S to C. */
509 _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
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
515 # if HAVE_RAW_DECL_WMEMSET
516 _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
517 "use gnulib module wmemset for portability");
522 /* Return the number of wide characters in S. */
525 _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s));
527 _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
528 _GL_CXXALIASWARN (wcslen);
529 #elif defined GNULIB_POSIXCHECK
531 # if HAVE_RAW_DECL_WCSLEN
532 _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
533 "use gnulib module wcslen for portability");
538 /* Return the number of wide characters in S, but at most MAXLEN. */
541 _GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
543 _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
544 _GL_CXXALIASWARN (wcsnlen);
545 #elif defined GNULIB_POSIXCHECK
547 # if HAVE_RAW_DECL_WCSNLEN
548 _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
549 "use gnulib module wcsnlen for portability");
554 /* Copy SRC to DEST. */
557 _GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
559 _GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
560 _GL_CXXALIASWARN (wcscpy);
561 #elif defined GNULIB_POSIXCHECK
563 # if HAVE_RAW_DECL_WCSCPY
564 _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
565 "use gnulib module wcscpy for portability");
570 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
573 _GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
575 _GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
576 _GL_CXXALIASWARN (wcpcpy);
577 #elif defined GNULIB_POSIXCHECK
579 # if HAVE_RAW_DECL_WCPCPY
580 _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
581 "use gnulib module wcpcpy for portability");
586 /* Copy no more than N wide characters of SRC to DEST. */
589 _GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
590 (wchar_t *dest, const wchar_t *src, size_t n));
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
597 # if HAVE_RAW_DECL_WCSNCPY
598 _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
599 "use gnulib module wcsncpy for portability");
604 /* Copy no more than N characters of SRC to DEST, returning the address of
605 the last character written into DEST. */
608 _GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
609 (wchar_t *dest, const wchar_t *src, size_t n));
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
616 # if HAVE_RAW_DECL_WCPNCPY
617 _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
618 "use gnulib module wcpncpy for portability");
623 /* Append SRC onto DEST. */
626 _GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
628 _GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
629 _GL_CXXALIASWARN (wcscat);
630 #elif defined GNULIB_POSIXCHECK
632 # if HAVE_RAW_DECL_WCSCAT
633 _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
634 "use gnulib module wcscat for portability");
639 /* Append no more than N wide characters of SRC onto DEST. */
642 _GL_FUNCDECL_SYS (wcsncat, wchar_t *,
643 (wchar_t *dest, const wchar_t *src, size_t n));
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
650 # if HAVE_RAW_DECL_WCSNCAT
651 _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
652 "use gnulib module wcsncat for portability");
657 /* Compare S1 and S2. */
660 _GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
662 _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
663 _GL_CXXALIASWARN (wcscmp);
664 #elif defined GNULIB_POSIXCHECK
666 # if HAVE_RAW_DECL_WCSCMP
667 _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
668 "use gnulib module wcscmp for portability");
673 /* Compare no more than N wide characters of S1 and S2. */
676 _GL_FUNCDECL_SYS (wcsncmp, int,
677 (const wchar_t *s1, const wchar_t *s2, size_t n));
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
684 # if HAVE_RAW_DECL_WCSNCMP
685 _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
686 "use gnulib module wcsncmp for portability");
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));
696 _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
697 _GL_CXXALIASWARN (wcscasecmp);
698 #elif defined GNULIB_POSIXCHECK
700 # if HAVE_RAW_DECL_WCSCASECMP
701 _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
702 "use gnulib module wcscasecmp for portability");
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));
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
718 # if HAVE_RAW_DECL_WCSNCASECMP
719 _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
720 "use gnulib module wcsncasecmp for portability");
725 /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
726 category of the current locale. */
729 _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
731 _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
732 _GL_CXXALIASWARN (wcscoll);
733 #elif defined GNULIB_POSIXCHECK
735 # if HAVE_RAW_DECL_WCSCOLL
736 _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
737 "use gnulib module wcscoll for portability");
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
747 _GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
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
753 # if HAVE_RAW_DECL_WCSXFRM
754 _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
755 "use gnulib module wcsxfrm for portability");
760 /* Duplicate S, returning an identical malloc'd string. */
763 _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
765 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
766 _GL_CXXALIASWARN (wcsdup);
767 #elif defined GNULIB_POSIXCHECK
769 # if HAVE_RAW_DECL_WCSDUP
770 _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
771 "use gnulib module wcsdup for portability");
776 /* Find the first occurrence of WC in WCS. */
779 _GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
781 _GL_CXXALIAS_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
782 _GL_CXXALIASWARN (wcschr);
783 #elif defined GNULIB_POSIXCHECK
785 # if HAVE_RAW_DECL_WCSCHR
786 _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
787 "use gnulib module wcschr for portability");
792 /* Find the last occurrence of WC in WCS. */
795 _GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
797 _GL_CXXALIAS_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc));
798 _GL_CXXALIASWARN (wcsrchr);
799 #elif defined GNULIB_POSIXCHECK
801 # if HAVE_RAW_DECL_WCSRCHR
802 _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
803 "use gnulib module wcsrchr for portability");
808 /* Return the length of the initial segmet of WCS which consists entirely
809 of wide characters not in REJECT. */
812 _GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
814 _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
815 _GL_CXXALIASWARN (wcscspn);
816 #elif defined GNULIB_POSIXCHECK
818 # if HAVE_RAW_DECL_WCSCSPN
819 _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
820 "use gnulib module wcscspn for portability");
825 /* Return the length of the initial segmet of WCS which consists entirely
826 of wide characters in ACCEPT. */
829 _GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
831 _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
832 _GL_CXXALIASWARN (wcsspn);
833 #elif defined GNULIB_POSIXCHECK
835 # if HAVE_RAW_DECL_WCSSPN
836 _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
837 "use gnulib module wcsspn for portability");
842 /* Find the first occurrence in WCS of any character in ACCEPT. */
845 _GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
846 (const wchar_t *wcs, const wchar_t *accept));
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
853 # if HAVE_RAW_DECL_WCSPBRK
854 _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
855 "use gnulib module wcspbrk for portability");
860 /* Find the first occurrence of NEEDLE in HAYSTACK. */
863 _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
864 (const wchar_t *haystack, const wchar_t *needle));
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
871 # if HAVE_RAW_DECL_WCSSTR
872 _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
873 "use gnulib module wcsstr for portability");
878 /* Divide WCS into tokens separated by characters in DELIM. */
881 _GL_FUNCDECL_SYS (wcstok, wchar_t *,
882 (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
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
889 # if HAVE_RAW_DECL_WCSTOK
890 _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
891 "use gnulib module wcstok for portability");
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)
902 # define wcswidth rpl_wcswidth
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));
907 # if !@HAVE_WCSWIDTH@
908 _GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n));
910 _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
912 _GL_CXXALIASWARN (wcswidth);
913 #elif defined GNULIB_POSIXCHECK
915 # if HAVE_RAW_DECL_WCSWIDTH
916 _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
917 "use gnulib module wcswidth for portability");
922 #endif /* _GL_WCHAR_H */
923 #endif /* _GL_WCHAR_H */