annotate lib/wchar.in.h @ 17935:0ad1f4c9eed5 default tip

tests: support stderr verification with returns_() * tests/init.sh (returns_): Disable tracing for this wrapper function, so that stderr of the wrapped command is unchanged, allowing for verification of the contents.
author Pádraig Brady <P@draigBrady.com>
date Mon, 16 Feb 2015 17:20:39 +0000 (2015-02-16)
parents ab58d4870664
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2
17848
ab58d4870664 version-etc: new year
Paul Eggert <eggert@cs.ucla.edu>
parents: 17587
diff changeset
3 Copyright (C) 2007-2015 Free Software Foundation, Inc.
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 the Free Software Foundation; either version 2, or (at your option)
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 any later version.
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 GNU General Public License for more details.
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
16366
bb182ee4a09d maint: replace FSF snail-mail addresses with URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 16201
diff changeset
16 along with this program; if not, see <http://www.gnu.org/licenses/>. */
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 /* Written by Eric Blake. */
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 /*
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 * ISO C 99 <wchar.h> for platforms that have issues.
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 * <http://www.opengroup.org/susv3xbd/wchar.h.html>
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 *
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 * For now, this just ensures proper prerequisite inclusion order and
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 * the declaration of wcwidth().
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 */
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
10655
8668b19a7032 Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents: 10454
diff changeset
28 #if __GNUC__ >= 3
10375
f96e845fc36d Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents: 9888
diff changeset
29 @PRAGMA_SYSTEM_HEADER@
10655
8668b19a7032 Avoid gcc warnings because of #pragma GCC system_header on older gcc.
Bruno Haible <bruno@clisp.org>
parents: 10454
diff changeset
30 #endif
13761
a19ace3ba849 Avoid line length limitation from HP NonStop system header files.
Bruno Haible <bruno@clisp.org>
parents: 13301
diff changeset
31 @PRAGMA_COLUMNS@
10375
f96e845fc36d Avoid some "gcc -pedantic" warnings.
Bruno Haible <bruno@clisp.org>
parents: 9888
diff changeset
32
12620
c2fcdc831f5b wchar: Fix compilation error when <wchar.h> is used from coreutils.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
33 #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
11013
1a96d7fec8d0 Fix a syntax error due to recursive inclusion of wchar.h on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents: 10977
diff changeset
34 /* Special invocation convention:
12620
c2fcdc831f5b wchar: Fix compilation error when <wchar.h> is used from coreutils.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
35 - Inside glibc and uClibc header files.
11013
1a96d7fec8d0 Fix a syntax error due to recursive inclusion of wchar.h on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents: 10977
diff changeset
36 - On HP-UX 11.00 we have a sequence of nested includes
1a96d7fec8d0 Fix a syntax error due to recursive inclusion of wchar.h on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents: 10977
diff changeset
37 <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
1a96d7fec8d0 Fix a syntax error due to recursive inclusion of wchar.h on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents: 10977
diff changeset
38 once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
1a96d7fec8d0 Fix a syntax error due to recursive inclusion of wchar.h on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents: 10977
diff changeset
39 and once directly. In both situations 'wint_t' is not yet defined,
1a96d7fec8d0 Fix a syntax error due to recursive inclusion of wchar.h on HP-UX 11.00.
Bruno Haible <bruno@clisp.org>
parents: 10977
diff changeset
40 therefore we cannot provide the function overrides; instead include only
11029
10f80546fa7e Attempt to avoid a recursive include of wchar.h on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 11013
diff changeset
41 the system's <wchar.h>.
10f80546fa7e Attempt to avoid a recursive include of wchar.h on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 11013
diff changeset
42 - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
10f80546fa7e Attempt to avoid a recursive include of wchar.h on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 11013
diff changeset
43 the latter includes <wchar.h>. But here, we have no way to detect whether
10f80546fa7e Attempt to avoid a recursive include of wchar.h on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 11013
diff changeset
44 <wctype.h> is completely included or is still being included. */
9842
5a6c62d69d18 * lib/wchar.in.h [defined __need_mbstate_t]: Just include <wchar.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9272
diff changeset
45
5a6c62d69d18 * lib/wchar.in.h [defined __need_mbstate_t]: Just include <wchar.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9272
diff changeset
46 #@INCLUDE_NEXT@ @NEXT_WCHAR_H@
5a6c62d69d18 * lib/wchar.in.h [defined __need_mbstate_t]: Just include <wchar.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9272
diff changeset
47
5a6c62d69d18 * lib/wchar.in.h [defined __need_mbstate_t]: Just include <wchar.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9272
diff changeset
48 #else
5a6c62d69d18 * lib/wchar.in.h [defined __need_mbstate_t]: Just include <wchar.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9272
diff changeset
49 /* Normal invocation convention. */
5a6c62d69d18 * lib/wchar.in.h [defined __need_mbstate_t]: Just include <wchar.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9272
diff changeset
50
14840
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14581
diff changeset
51 #ifndef _@GUARD_PREFIX@_WCHAR_H
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52
11029
10f80546fa7e Attempt to avoid a recursive include of wchar.h on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 11013
diff changeset
53 #define _GL_ALREADY_INCLUDING_WCHAR_H
10f80546fa7e Attempt to avoid a recursive include of wchar.h on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 11013
diff changeset
54
13887
ff73aa93842c Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents: 13761
diff changeset
55 #if @HAVE_FEATURES_H@
ff73aa93842c Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents: 13761
diff changeset
56 # include <features.h> /* for __GLIBC__ */
ff73aa93842c Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents: 13761
diff changeset
57 #endif
ff73aa93842c Ensure that <features.h> is included before __GLIBC__ is tested.
Bruno Haible <bruno@clisp.org>
parents: 13761
diff changeset
58
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 <wchar.h>.
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
12548
efe1df275da6 Avoid namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 12422
diff changeset
62 included before <wchar.h>.
14581
a1d4fafd50b6 wchar: Ensure that wchar_t gets defined on uClibc.
Bruno Haible <bruno@clisp.org>
parents: 14519
diff changeset
63 In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
a1d4fafd50b6 wchar: Ensure that wchar_t gets defined on uClibc.
Bruno Haible <bruno@clisp.org>
parents: 14519
diff changeset
64 by <stddef.h>.
12548
efe1df275da6 Avoid namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 12422
diff changeset
65 But avoid namespace pollution on glibc systems. */
14581
a1d4fafd50b6 wchar: Ensure that wchar_t gets defined on uClibc.
Bruno Haible <bruno@clisp.org>
parents: 14519
diff changeset
66 #if !(defined __GLIBC__ && !defined __UCLIBC__)
a1d4fafd50b6 wchar: Ensure that wchar_t gets defined on uClibc.
Bruno Haible <bruno@clisp.org>
parents: 14519
diff changeset
67 # include <stddef.h>
a1d4fafd50b6 wchar: Ensure that wchar_t gets defined on uClibc.
Bruno Haible <bruno@clisp.org>
parents: 14519
diff changeset
68 #endif
12548
efe1df275da6 Avoid namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 12422
diff changeset
69 #ifndef __GLIBC__
efe1df275da6 Avoid namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 12422
diff changeset
70 # include <stdio.h>
efe1df275da6 Avoid namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 12422
diff changeset
71 # include <time.h>
efe1df275da6 Avoid namespace pollution on glibc systems.
Bruno Haible <bruno@clisp.org>
parents: 12422
diff changeset
72 #endif
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 /* Include the original <wchar.h> if it exists.
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 Some builds of uClibc lack it. */
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 /* The include_next requires a split double-inclusion guard. */
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 #if @HAVE_WCHAR_H@
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 # @INCLUDE_NEXT@ @NEXT_WCHAR_H@
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79 #endif
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80
11029
10f80546fa7e Attempt to avoid a recursive include of wchar.h on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 11013
diff changeset
81 #undef _GL_ALREADY_INCLUDING_WCHAR_H
10f80546fa7e Attempt to avoid a recursive include of wchar.h on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 11013
diff changeset
82
14840
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14581
diff changeset
83 #ifndef _@GUARD_PREFIX@_WCHAR_H
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14581
diff changeset
84 #define _@GUARD_PREFIX@_WCHAR_H
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
86 /* The __attribute__ feature is available in gcc versions 2.5 and later.
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
87 The attribute __pure__ was added in gcc 2.96. */
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
88 #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
89 # define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
90 #else
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
91 # define _GL_ATTRIBUTE_PURE /* empty */
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
92 #endif
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
93
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
94 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
95
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
96 /* The definition of _GL_ARG_NONNULL is copied here. */
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
98 /* The definition of _GL_WARN_ON_USE is copied here. */
12422
f7842310a565 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible <bruno@clisp.org>
parents: 11527
diff changeset
99
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100
13152
587fde43ef73 wchar: Port to NetBSD 1.5.
Hauke Fath <hauke@espresso.rhein-neckar.de>
parents: 12950
diff changeset
101 /* Define wint_t and WEOF. (Also done in wctype.in.h.) */
10454
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
102 #if !@HAVE_WINT_T@ && !defined wint_t
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
103 # define wint_t int
10977
6183b030f375 wchar.h: supply WEOF on Irix 5.3
Eric Blake <ebb9@byu.net>
parents: 10958
diff changeset
104 # ifndef WEOF
6183b030f375 wchar.h: supply WEOF on Irix 5.3
Eric Blake <ebb9@byu.net>
parents: 10958
diff changeset
105 # define WEOF -1
6183b030f375 wchar.h: supply WEOF on Irix 5.3
Eric Blake <ebb9@byu.net>
parents: 10958
diff changeset
106 # endif
13152
587fde43ef73 wchar: Port to NetBSD 1.5.
Hauke Fath <hauke@espresso.rhein-neckar.de>
parents: 12950
diff changeset
107 #else
15602
2ef7d0e76b27 Fix wint_t on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 14840
diff changeset
108 /* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
2ef7d0e76b27 Fix wint_t on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 14840
diff changeset
109 This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
2ef7d0e76b27 Fix wint_t on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 14840
diff changeset
110 "unchanged by default argument promotions". Override it. */
2ef7d0e76b27 Fix wint_t on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 14840
diff changeset
111 # if defined _MSC_VER
2ef7d0e76b27 Fix wint_t on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 14840
diff changeset
112 # if !GNULIB_defined_wint_t
2ef7d0e76b27 Fix wint_t on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 14840
diff changeset
113 # include <crtdefs.h>
2ef7d0e76b27 Fix wint_t on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 14840
diff changeset
114 typedef unsigned int rpl_wint_t;
2ef7d0e76b27 Fix wint_t on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 14840
diff changeset
115 # undef wint_t
2ef7d0e76b27 Fix wint_t on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 14840
diff changeset
116 # define wint_t rpl_wint_t
2ef7d0e76b27 Fix wint_t on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 14840
diff changeset
117 # define GNULIB_defined_wint_t 1
2ef7d0e76b27 Fix wint_t on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 14840
diff changeset
118 # endif
2ef7d0e76b27 Fix wint_t on MSVC.
Bruno Haible <bruno@clisp.org>
parents: 14840
diff changeset
119 # endif
13152
587fde43ef73 wchar: Port to NetBSD 1.5.
Hauke Fath <hauke@espresso.rhein-neckar.de>
parents: 12950
diff changeset
120 # ifndef WEOF
587fde43ef73 wchar: Port to NetBSD 1.5.
Hauke Fath <hauke@espresso.rhein-neckar.de>
parents: 12950
diff changeset
121 # define WEOF ((wint_t) -1)
587fde43ef73 wchar: Port to NetBSD 1.5.
Hauke Fath <hauke@espresso.rhein-neckar.de>
parents: 12950
diff changeset
122 # endif
10454
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
123 #endif
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
124
83d12e60b1e0 Ensure that wint_t gets defined on IRIX 5.3.
Bruno Haible <bruno@clisp.org>
parents: 10375
diff changeset
125
10906
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
126 /* Override mbstate_t if it is too small.
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
127 On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
128 implementing mbrtowc for encodings like UTF-8. */
10924
6f547b3710c7 Work around mbrtowc bugs on AIX, HP-UX, OSF/1, Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10922
diff changeset
129 #if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
14274
da5595160b9f Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents: 14267
diff changeset
130 # if !GNULIB_defined_mbstate_t
10906
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
131 typedef int rpl_mbstate_t;
14274
da5595160b9f Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents: 14267
diff changeset
132 # undef mbstate_t
da5595160b9f Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents: 14267
diff changeset
133 # define mbstate_t rpl_mbstate_t
da5595160b9f Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents: 14267
diff changeset
134 # define GNULIB_defined_mbstate_t 1
da5595160b9f Allow multiple gnulib generated replacements to coexist.
Bruno Haible <bruno@clisp.org>
parents: 14267
diff changeset
135 # endif
10906
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
136 #endif
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
137
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
138
10895
f68cffd4f574 New module 'btowc'.
Bruno Haible <bruno@clisp.org>
parents: 10892
diff changeset
139 /* Convert a single-byte character to a wide character. */
f68cffd4f574 New module 'btowc'.
Bruno Haible <bruno@clisp.org>
parents: 10892
diff changeset
140 #if @GNULIB_BTOWC@
10938
84611717fa6c Work around a btowc() bug on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 10936
diff changeset
141 # if @REPLACE_BTOWC@
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
142 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
143 # undef btowc
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
144 # define btowc rpl_btowc
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
145 # endif
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
146 _GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
147 _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
148 # else
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
149 # if !@HAVE_BTOWC@
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
150 _GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
151 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
152 _GL_CXXALIAS_SYS (btowc, wint_t, (int c));
10938
84611717fa6c Work around a btowc() bug on IRIX 6.5.
Bruno Haible <bruno@clisp.org>
parents: 10936
diff changeset
153 # endif
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
154 _GL_CXXALIASWARN (btowc);
10895
f68cffd4f574 New module 'btowc'.
Bruno Haible <bruno@clisp.org>
parents: 10892
diff changeset
155 #elif defined GNULIB_POSIXCHECK
f68cffd4f574 New module 'btowc'.
Bruno Haible <bruno@clisp.org>
parents: 10892
diff changeset
156 # undef btowc
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
157 # if HAVE_RAW_DECL_BTOWC
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
158 _GL_WARN_ON_USE (btowc, "btowc is unportable - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
159 "use gnulib module btowc for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
160 # endif
10895
f68cffd4f574 New module 'btowc'.
Bruno Haible <bruno@clisp.org>
parents: 10892
diff changeset
161 #endif
f68cffd4f574 New module 'btowc'.
Bruno Haible <bruno@clisp.org>
parents: 10892
diff changeset
162
f68cffd4f574 New module 'btowc'.
Bruno Haible <bruno@clisp.org>
parents: 10892
diff changeset
163
10905
bafd3f4f3496 New module 'wctob'.
Bruno Haible <bruno@clisp.org>
parents: 10895
diff changeset
164 /* Convert a wide character to a single-byte character. */
bafd3f4f3496 New module 'wctob'.
Bruno Haible <bruno@clisp.org>
parents: 10895
diff changeset
165 #if @GNULIB_WCTOB@
10922
91831148c181 Work around wctob bug on Solaris 9.
Bruno Haible <bruno@clisp.org>
parents: 10917
diff changeset
166 # if @REPLACE_WCTOB@
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
167 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
168 # undef wctob
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
169 # define wctob rpl_wctob
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
170 # endif
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
171 _GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
172 _GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
173 # else
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
174 # if !defined wctob && !@HAVE_DECL_WCTOB@
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
175 /* wctob is provided by gnulib, or wctob exists but is not declared. */
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
176 _GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
177 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
178 _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
10922
91831148c181 Work around wctob bug on Solaris 9.
Bruno Haible <bruno@clisp.org>
parents: 10917
diff changeset
179 # endif
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
180 _GL_CXXALIASWARN (wctob);
10905
bafd3f4f3496 New module 'wctob'.
Bruno Haible <bruno@clisp.org>
parents: 10895
diff changeset
181 #elif defined GNULIB_POSIXCHECK
bafd3f4f3496 New module 'wctob'.
Bruno Haible <bruno@clisp.org>
parents: 10895
diff changeset
182 # undef wctob
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
183 # if HAVE_RAW_DECL_WCTOB
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
184 _GL_WARN_ON_USE (wctob, "wctob is unportable - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
185 "use gnulib module wctob for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
186 # endif
10905
bafd3f4f3496 New module 'wctob'.
Bruno Haible <bruno@clisp.org>
parents: 10895
diff changeset
187 #endif
bafd3f4f3496 New module 'wctob'.
Bruno Haible <bruno@clisp.org>
parents: 10895
diff changeset
188
bafd3f4f3496 New module 'wctob'.
Bruno Haible <bruno@clisp.org>
parents: 10895
diff changeset
189
10892
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
190 /* Test whether *PS is in the initial state. */
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
191 #if @GNULIB_MBSINIT@
10924
6f547b3710c7 Work around mbrtowc bugs on AIX, HP-UX, OSF/1, Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10922
diff changeset
192 # if @REPLACE_MBSINIT@
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
193 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
194 # undef mbsinit
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
195 # define mbsinit rpl_mbsinit
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
196 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
197 _GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
198 _GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
199 # else
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
200 # if !@HAVE_MBSINIT@
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
201 _GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
202 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
203 _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
10924
6f547b3710c7 Work around mbrtowc bugs on AIX, HP-UX, OSF/1, Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10922
diff changeset
204 # endif
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
205 _GL_CXXALIASWARN (mbsinit);
10892
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
206 #elif defined GNULIB_POSIXCHECK
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
207 # undef mbsinit
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
208 # if HAVE_RAW_DECL_MBSINIT
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
209 _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
210 "use gnulib module mbsinit for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
211 # endif
10892
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
212 #endif
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
213
67a8f53c94f0 New module 'mbsinit'.
Bruno Haible <bruno@clisp.org>
parents: 10655
diff changeset
214
10906
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
215 /* Convert a multibyte character to a wide character. */
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
216 #if @GNULIB_MBRTOWC@
10924
6f547b3710c7 Work around mbrtowc bugs on AIX, HP-UX, OSF/1, Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10922
diff changeset
217 # if @REPLACE_MBRTOWC@
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
218 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
219 # undef mbrtowc
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
220 # define mbrtowc rpl_mbrtowc
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
221 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
222 _GL_FUNCDECL_RPL (mbrtowc, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
223 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
224 _GL_CXXALIAS_RPL (mbrtowc, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
225 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
226 # else
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
227 # if !@HAVE_MBRTOWC@
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
228 _GL_FUNCDECL_SYS (mbrtowc, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
229 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
230 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
231 _GL_CXXALIAS_SYS (mbrtowc, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
232 (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
10924
6f547b3710c7 Work around mbrtowc bugs on AIX, HP-UX, OSF/1, Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10922
diff changeset
233 # endif
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
234 _GL_CXXALIASWARN (mbrtowc);
10906
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
235 #elif defined GNULIB_POSIXCHECK
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
236 # undef mbrtowc
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
237 # if HAVE_RAW_DECL_MBRTOWC
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
238 _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
239 "use gnulib module mbrtowc for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
240 # endif
10906
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
241 #endif
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
242
6e283a40b2c1 New module 'mbrtowc'.
Bruno Haible <bruno@clisp.org>
parents: 10905
diff changeset
243
10910
e79b85bd0a7d New module 'mbrlen'.
Bruno Haible <bruno@clisp.org>
parents: 10906
diff changeset
244 /* Recognize a multibyte character. */
e79b85bd0a7d New module 'mbrlen'.
Bruno Haible <bruno@clisp.org>
parents: 10906
diff changeset
245 #if @GNULIB_MBRLEN@
10958
daa3e6323dc2 Work around mbrlen() bugs on various platforms.
Bruno Haible <bruno@clisp.org>
parents: 10943
diff changeset
246 # if @REPLACE_MBRLEN@
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
247 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
248 # undef mbrlen
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
249 # define mbrlen rpl_mbrlen
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
250 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
251 _GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
252 _GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
253 # else
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
254 # if !@HAVE_MBRLEN@
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
255 _GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
256 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
257 _GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
10958
daa3e6323dc2 Work around mbrlen() bugs on various platforms.
Bruno Haible <bruno@clisp.org>
parents: 10943
diff changeset
258 # endif
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
259 _GL_CXXALIASWARN (mbrlen);
10910
e79b85bd0a7d New module 'mbrlen'.
Bruno Haible <bruno@clisp.org>
parents: 10906
diff changeset
260 #elif defined GNULIB_POSIXCHECK
e79b85bd0a7d New module 'mbrlen'.
Bruno Haible <bruno@clisp.org>
parents: 10906
diff changeset
261 # undef mbrlen
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
262 # if HAVE_RAW_DECL_MBRLEN
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
263 _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
264 "use gnulib module mbrlen for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
265 # endif
10910
e79b85bd0a7d New module 'mbrlen'.
Bruno Haible <bruno@clisp.org>
parents: 10906
diff changeset
266 #endif
e79b85bd0a7d New module 'mbrlen'.
Bruno Haible <bruno@clisp.org>
parents: 10906
diff changeset
267
e79b85bd0a7d New module 'mbrlen'.
Bruno Haible <bruno@clisp.org>
parents: 10906
diff changeset
268
10913
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
269 /* Convert a string to a wide string. */
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
270 #if @GNULIB_MBSRTOWCS@
10925
c8051e85cbfd Override mbsrtowcs when redefining mbstate_t.
Bruno Haible <bruno@clisp.org>
parents: 10924
diff changeset
271 # if @REPLACE_MBSRTOWCS@
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
272 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
273 # undef mbsrtowcs
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
274 # define mbsrtowcs rpl_mbsrtowcs
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
275 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
276 _GL_FUNCDECL_RPL (mbsrtowcs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
277 (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
278 _GL_ARG_NONNULL ((2)));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
279 _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
280 (wchar_t *dest, const char **srcp, size_t len,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
281 mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
282 # else
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
283 # if !@HAVE_MBSRTOWCS@
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
284 _GL_FUNCDECL_SYS (mbsrtowcs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
285 (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
286 _GL_ARG_NONNULL ((2)));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
287 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
288 _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
289 (wchar_t *dest, const char **srcp, size_t len,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
290 mbstate_t *ps));
10925
c8051e85cbfd Override mbsrtowcs when redefining mbstate_t.
Bruno Haible <bruno@clisp.org>
parents: 10924
diff changeset
291 # endif
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
292 _GL_CXXALIASWARN (mbsrtowcs);
10913
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
293 #elif defined GNULIB_POSIXCHECK
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
294 # undef mbsrtowcs
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
295 # if HAVE_RAW_DECL_MBSRTOWCS
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
296 _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
297 "use gnulib module mbsrtowcs for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
298 # endif
10913
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
299 #endif
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
300
b97cc734ef40 New module 'mbsrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10910
diff changeset
301
10932
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
302 /* Convert a string to a wide string. */
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
303 #if @GNULIB_MBSNRTOWCS@
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
304 # if @REPLACE_MBSNRTOWCS@
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
305 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
306 # undef mbsnrtowcs
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
307 # define mbsnrtowcs rpl_mbsnrtowcs
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
308 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
309 _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
310 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
311 mbstate_t *ps)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
312 _GL_ARG_NONNULL ((2)));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
313 _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
314 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
315 mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
316 # else
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
317 # if !@HAVE_MBSNRTOWCS@
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
318 _GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
319 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
320 mbstate_t *ps)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
321 _GL_ARG_NONNULL ((2)));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
322 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
323 _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
324 (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
325 mbstate_t *ps));
10932
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
326 # endif
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
327 _GL_CXXALIASWARN (mbsnrtowcs);
10932
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
328 #elif defined GNULIB_POSIXCHECK
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
329 # undef mbsnrtowcs
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
330 # if HAVE_RAW_DECL_MBSNRTOWCS
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
331 _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
332 "use gnulib module mbsnrtowcs for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
333 # endif
10932
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
334 #endif
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
335
4d1763d8867c New module 'mbsnrtowcs'.
Bruno Haible <bruno@clisp.org>
parents: 10925
diff changeset
336
10936
197aac315d4d New module 'wcrtomb'.
Bruno Haible <bruno@clisp.org>
parents: 10932
diff changeset
337 /* Convert a wide character to a multibyte character. */
197aac315d4d New module 'wcrtomb'.
Bruno Haible <bruno@clisp.org>
parents: 10932
diff changeset
338 #if @GNULIB_WCRTOMB@
10939
4ee0271437dd Work around a wcrtomb() bug on Solaris 10 and OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 10938
diff changeset
339 # if @REPLACE_WCRTOMB@
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
340 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
341 # undef wcrtomb
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
342 # define wcrtomb rpl_wcrtomb
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
343 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
344 _GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
345 _GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
346 # else
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
347 # if !@HAVE_WCRTOMB@
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
348 _GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
349 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
350 _GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
10939
4ee0271437dd Work around a wcrtomb() bug on Solaris 10 and OSF/1 5.1.
Bruno Haible <bruno@clisp.org>
parents: 10938
diff changeset
351 # endif
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
352 _GL_CXXALIASWARN (wcrtomb);
10936
197aac315d4d New module 'wcrtomb'.
Bruno Haible <bruno@clisp.org>
parents: 10932
diff changeset
353 #elif defined GNULIB_POSIXCHECK
197aac315d4d New module 'wcrtomb'.
Bruno Haible <bruno@clisp.org>
parents: 10932
diff changeset
354 # undef wcrtomb
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
355 # if HAVE_RAW_DECL_WCRTOMB
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
356 _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
357 "use gnulib module wcrtomb for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
358 # endif
10936
197aac315d4d New module 'wcrtomb'.
Bruno Haible <bruno@clisp.org>
parents: 10932
diff changeset
359 #endif
197aac315d4d New module 'wcrtomb'.
Bruno Haible <bruno@clisp.org>
parents: 10932
diff changeset
360
197aac315d4d New module 'wcrtomb'.
Bruno Haible <bruno@clisp.org>
parents: 10932
diff changeset
361
10941
509592900669 New module 'wcsrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10939
diff changeset
362 /* Convert a wide string to a string. */
509592900669 New module 'wcsrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10939
diff changeset
363 #if @GNULIB_WCSRTOMBS@
509592900669 New module 'wcsrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10939
diff changeset
364 # if @REPLACE_WCSRTOMBS@
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
365 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
366 # undef wcsrtombs
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
367 # define wcsrtombs rpl_wcsrtombs
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
368 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
369 _GL_FUNCDECL_RPL (wcsrtombs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
370 (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
371 _GL_ARG_NONNULL ((2)));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
372 _GL_CXXALIAS_RPL (wcsrtombs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
373 (char *dest, const wchar_t **srcp, size_t len,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
374 mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
375 # else
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
376 # if !@HAVE_WCSRTOMBS@
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
377 _GL_FUNCDECL_SYS (wcsrtombs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
378 (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
379 _GL_ARG_NONNULL ((2)));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
380 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
381 _GL_CXXALIAS_SYS (wcsrtombs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
382 (char *dest, const wchar_t **srcp, size_t len,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
383 mbstate_t *ps));
10941
509592900669 New module 'wcsrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10939
diff changeset
384 # endif
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
385 _GL_CXXALIASWARN (wcsrtombs);
10941
509592900669 New module 'wcsrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10939
diff changeset
386 #elif defined GNULIB_POSIXCHECK
509592900669 New module 'wcsrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10939
diff changeset
387 # undef wcsrtombs
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
388 # if HAVE_RAW_DECL_WCSRTOMBS
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
389 _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
390 "use gnulib module wcsrtombs for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
391 # endif
10941
509592900669 New module 'wcsrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10939
diff changeset
392 #endif
509592900669 New module 'wcsrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10939
diff changeset
393
509592900669 New module 'wcsrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10939
diff changeset
394
10943
47cd92ce639a New module 'wcsnrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10941
diff changeset
395 /* Convert a wide string to a string. */
47cd92ce639a New module 'wcsnrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10941
diff changeset
396 #if @GNULIB_WCSNRTOMBS@
11527
4fe203c3f828 Replace wcrtomb, wcsrtombs, wcsnrtombs if mbstate_t has to be replaced.
Bruno Haible <bruno@clisp.org>
parents: 11029
diff changeset
397 # if @REPLACE_WCSNRTOMBS@
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
398 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
399 # undef wcsnrtombs
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
400 # define wcsnrtombs rpl_wcsnrtombs
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
401 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
402 _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
403 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
404 mbstate_t *ps)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
405 _GL_ARG_NONNULL ((2)));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
406 _GL_CXXALIAS_RPL (wcsnrtombs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
407 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
408 mbstate_t *ps));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
409 # else
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
410 # if !@HAVE_WCSNRTOMBS@
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
411 _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
412 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
413 mbstate_t *ps)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
414 _GL_ARG_NONNULL ((2)));
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
415 # endif
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
416 _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
417 (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
418 mbstate_t *ps));
11527
4fe203c3f828 Replace wcrtomb, wcsrtombs, wcsnrtombs if mbstate_t has to be replaced.
Bruno Haible <bruno@clisp.org>
parents: 11029
diff changeset
419 # endif
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
420 _GL_CXXALIASWARN (wcsnrtombs);
10943
47cd92ce639a New module 'wcsnrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10941
diff changeset
421 #elif defined GNULIB_POSIXCHECK
47cd92ce639a New module 'wcsnrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10941
diff changeset
422 # undef wcsnrtombs
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
423 # if HAVE_RAW_DECL_WCSNRTOMBS
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
424 _GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
425 "use gnulib module wcsnrtombs for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
426 # endif
10943
47cd92ce639a New module 'wcsnrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10941
diff changeset
427 #endif
47cd92ce639a New module 'wcsnrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10941
diff changeset
428
47cd92ce639a New module 'wcsnrtombs'.
Bruno Haible <bruno@clisp.org>
parents: 10941
diff changeset
429
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
430 /* Return the number of screen columns needed for WC. */
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
431 #if @GNULIB_WCWIDTH@
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
432 # if @REPLACE_WCWIDTH@
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
433 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
434 # undef wcwidth
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
435 # define wcwidth rpl_wcwidth
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
436 # endif
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
437 _GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
438 _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
439 # else
13301
6e54425a173a wcwidth: Declare also when it's aliased.
Bruno Haible <bruno@clisp.org>
parents: 13152
diff changeset
440 # if !@HAVE_DECL_WCWIDTH@
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
441 /* wcwidth exists but is not declared. */
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
442 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
443 # endif
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
444 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
445 # endif
12950
0d37d2127e54 wchar: Avoid #define replacements in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 12766
diff changeset
446 _GL_CXXALIASWARN (wcwidth);
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
447 #elif defined GNULIB_POSIXCHECK
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
448 # undef wcwidth
12766
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
449 # if HAVE_RAW_DECL_WCWIDTH
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
450 _GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
451 "use gnulib module wcwidth for portability");
2c14f1e449e5 warn-on-use: use instead of link-warning
Eric Blake <ebb9@byu.net>
parents: 12620
diff changeset
452 # endif
9272
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
453 #endif
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
454
ed34d7be7b7c Rename wchar_.h to wchar.in.h.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
455
14267
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
456 /* Search N wide characters of S for C. */
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
457 #if @GNULIB_WMEMCHR@
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
458 # if !@HAVE_WMEMCHR@
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
459 _GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
460 _GL_ATTRIBUTE_PURE);
14267
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
461 # endif
14519
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
462 /* On some systems, this function is defined as an overloaded function:
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
463 extern "C++" {
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
464 const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
465 wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
466 } */
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
467 _GL_CXXALIAS_SYS_CAST2 (wmemchr,
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
468 wchar_t *, (const wchar_t *, wchar_t, size_t),
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
469 const wchar_t *, (const wchar_t *, wchar_t, size_t));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
470 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
471 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
472 _GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
473 _GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
474 (const wchar_t *s, wchar_t c, size_t n));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
475 # else
14267
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
476 _GL_CXXALIASWARN (wmemchr);
14519
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
477 # endif
14267
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
478 #elif defined GNULIB_POSIXCHECK
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
479 # undef wmemchr
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
480 # if HAVE_RAW_DECL_WMEMCHR
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
481 _GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
482 "use gnulib module wmemchr for portability");
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
483 # endif
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
484 #endif
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
485
9ccff8d6fbbe New module 'wmemchr'.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
486
14277
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
487 /* Compare N wide characters of S1 and S2. */
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
488 #if @GNULIB_WMEMCMP@
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
489 # if !@HAVE_WMEMCMP@
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
490 _GL_FUNCDECL_SYS (wmemcmp, int,
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
491 (const wchar_t *s1, const wchar_t *s2, size_t n)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
492 _GL_ATTRIBUTE_PURE);
14277
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
493 # endif
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
494 _GL_CXXALIAS_SYS (wmemcmp, int,
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
495 (const wchar_t *s1, const wchar_t *s2, size_t n));
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
496 _GL_CXXALIASWARN (wmemcmp);
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
497 #elif defined GNULIB_POSIXCHECK
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
498 # undef wmemcmp
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
499 # if HAVE_RAW_DECL_WMEMCMP
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
500 _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
501 "use gnulib module wmemcmp for portability");
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
502 # endif
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
503 #endif
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
504
91a2110f419b New module 'wmemcmp'.
Bruno Haible <bruno@clisp.org>
parents: 14274
diff changeset
505
14278
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
506 /* Copy N wide characters of SRC to DEST. */
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
507 #if @GNULIB_WMEMCPY@
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
508 # if !@HAVE_WMEMCPY@
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
509 _GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
510 (wchar_t *dest, const wchar_t *src, size_t n));
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
511 # endif
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
512 _GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
513 (wchar_t *dest, const wchar_t *src, size_t n));
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
514 _GL_CXXALIASWARN (wmemcpy);
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
515 #elif defined GNULIB_POSIXCHECK
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
516 # undef wmemcpy
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
517 # if HAVE_RAW_DECL_WMEMCPY
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
518 _GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
519 "use gnulib module wmemcpy for portability");
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
520 # endif
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
521 #endif
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
522
fe5382375992 New module 'wmemcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14277
diff changeset
523
14279
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
524 /* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
525 overlapping memory areas. */
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
526 #if @GNULIB_WMEMMOVE@
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
527 # if !@HAVE_WMEMMOVE@
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
528 _GL_FUNCDECL_SYS (wmemmove, wchar_t *,
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
529 (wchar_t *dest, const wchar_t *src, size_t n));
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
530 # endif
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
531 _GL_CXXALIAS_SYS (wmemmove, wchar_t *,
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
532 (wchar_t *dest, const wchar_t *src, size_t n));
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
533 _GL_CXXALIASWARN (wmemmove);
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
534 #elif defined GNULIB_POSIXCHECK
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
535 # undef wmemmove
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
536 # if HAVE_RAW_DECL_WMEMMOVE
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
537 _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
538 "use gnulib module wmemmove for portability");
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
539 # endif
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
540 #endif
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
541
2a7d15223d39 New module 'wmemmove'.
Bruno Haible <bruno@clisp.org>
parents: 14278
diff changeset
542
14280
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
543 /* Set N wide characters of S to C. */
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
544 #if @GNULIB_WMEMSET@
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
545 # if !@HAVE_WMEMSET@
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
546 _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
547 # endif
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
548 _GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
549 _GL_CXXALIASWARN (wmemset);
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
550 #elif defined GNULIB_POSIXCHECK
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
551 # undef wmemset
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
552 # if HAVE_RAW_DECL_WMEMSET
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
553 _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
554 "use gnulib module wmemset for portability");
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
555 # endif
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
556 #endif
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
557
ac540ec36bef New module 'wmemset'.
Bruno Haible <bruno@clisp.org>
parents: 14279
diff changeset
558
14281
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
559 /* Return the number of wide characters in S. */
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
560 #if @GNULIB_WCSLEN@
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
561 # if !@HAVE_WCSLEN@
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
562 _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
14281
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
563 # endif
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
564 _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
565 _GL_CXXALIASWARN (wcslen);
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
566 #elif defined GNULIB_POSIXCHECK
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
567 # undef wcslen
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
568 # if HAVE_RAW_DECL_WCSLEN
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
569 _GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
570 "use gnulib module wcslen for portability");
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
571 # endif
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
572 #endif
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
573
cae17a11c789 New module 'wcslen'.
Bruno Haible <bruno@clisp.org>
parents: 14280
diff changeset
574
14282
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
575 /* Return the number of wide characters in S, but at most MAXLEN. */
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
576 #if @GNULIB_WCSNLEN@
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
577 # if !@HAVE_WCSNLEN@
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
578 _GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
579 _GL_ATTRIBUTE_PURE);
14282
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
580 # endif
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
581 _GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
582 _GL_CXXALIASWARN (wcsnlen);
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
583 #elif defined GNULIB_POSIXCHECK
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
584 # undef wcsnlen
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
585 # if HAVE_RAW_DECL_WCSNLEN
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
586 _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
587 "use gnulib module wcsnlen for portability");
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
588 # endif
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
589 #endif
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
590
3e1169cfa252 New module 'wcsnlen'.
Bruno Haible <bruno@clisp.org>
parents: 14281
diff changeset
591
14283
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
592 /* Copy SRC to DEST. */
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
593 #if @GNULIB_WCSCPY@
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
594 # if !@HAVE_WCSCPY@
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
595 _GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
596 # endif
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
597 _GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
598 _GL_CXXALIASWARN (wcscpy);
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
599 #elif defined GNULIB_POSIXCHECK
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
600 # undef wcscpy
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
601 # if HAVE_RAW_DECL_WCSCPY
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
602 _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
603 "use gnulib module wcscpy for portability");
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
604 # endif
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
605 #endif
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
606
f6f1da9d12f7 New module 'wcscpy'.
Bruno Haible <bruno@clisp.org>
parents: 14282
diff changeset
607
14284
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
608 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST. */
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
609 #if @GNULIB_WCPCPY@
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
610 # if !@HAVE_WCPCPY@
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
611 _GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
612 # endif
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
613 _GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
614 _GL_CXXALIASWARN (wcpcpy);
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
615 #elif defined GNULIB_POSIXCHECK
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
616 # undef wcpcpy
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
617 # if HAVE_RAW_DECL_WCPCPY
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
618 _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
619 "use gnulib module wcpcpy for portability");
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
620 # endif
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
621 #endif
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
622
252e51b8dd78 New module 'wcpcpy'.
Bruno Haible <bruno@clisp.org>
parents: 14283
diff changeset
623
14285
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
624 /* Copy no more than N wide characters of SRC to DEST. */
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
625 #if @GNULIB_WCSNCPY@
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
626 # if !@HAVE_WCSNCPY@
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
627 _GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
628 (wchar_t *dest, const wchar_t *src, size_t n));
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
629 # endif
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
630 _GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
631 (wchar_t *dest, const wchar_t *src, size_t n));
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
632 _GL_CXXALIASWARN (wcsncpy);
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
633 #elif defined GNULIB_POSIXCHECK
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
634 # undef wcsncpy
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
635 # if HAVE_RAW_DECL_WCSNCPY
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
636 _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
637 "use gnulib module wcsncpy for portability");
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
638 # endif
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
639 #endif
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
640
46d0f7a51cc0 New module 'wcsncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14284
diff changeset
641
14286
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
642 /* Copy no more than N characters of SRC to DEST, returning the address of
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
643 the last character written into DEST. */
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
644 #if @GNULIB_WCPNCPY@
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
645 # if !@HAVE_WCPNCPY@
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
646 _GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
647 (wchar_t *dest, const wchar_t *src, size_t n));
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
648 # endif
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
649 _GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
650 (wchar_t *dest, const wchar_t *src, size_t n));
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
651 _GL_CXXALIASWARN (wcpncpy);
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
652 #elif defined GNULIB_POSIXCHECK
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
653 # undef wcpncpy
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
654 # if HAVE_RAW_DECL_WCPNCPY
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
655 _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
656 "use gnulib module wcpncpy for portability");
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
657 # endif
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
658 #endif
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
659
c436f87485c4 New module 'wcpncpy'.
Bruno Haible <bruno@clisp.org>
parents: 14285
diff changeset
660
14287
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
661 /* Append SRC onto DEST. */
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
662 #if @GNULIB_WCSCAT@
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
663 # if !@HAVE_WCSCAT@
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
664 _GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
665 # endif
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
666 _GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
667 _GL_CXXALIASWARN (wcscat);
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
668 #elif defined GNULIB_POSIXCHECK
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
669 # undef wcscat
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
670 # if HAVE_RAW_DECL_WCSCAT
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
671 _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
672 "use gnulib module wcscat for portability");
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
673 # endif
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
674 #endif
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
675
783f910af794 New module 'wcscat'.
Bruno Haible <bruno@clisp.org>
parents: 14286
diff changeset
676
14288
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
677 /* Append no more than N wide characters of SRC onto DEST. */
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
678 #if @GNULIB_WCSNCAT@
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
679 # if !@HAVE_WCSNCAT@
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
680 _GL_FUNCDECL_SYS (wcsncat, wchar_t *,
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
681 (wchar_t *dest, const wchar_t *src, size_t n));
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
682 # endif
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
683 _GL_CXXALIAS_SYS (wcsncat, wchar_t *,
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
684 (wchar_t *dest, const wchar_t *src, size_t n));
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
685 _GL_CXXALIASWARN (wcsncat);
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
686 #elif defined GNULIB_POSIXCHECK
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
687 # undef wcsncat
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
688 # if HAVE_RAW_DECL_WCSNCAT
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
689 _GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
690 "use gnulib module wcsncat for portability");
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
691 # endif
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
692 #endif
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
693
75ffd7ebdec7 New module 'wcsncat'.
Bruno Haible <bruno@clisp.org>
parents: 14287
diff changeset
694
14289
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
695 /* Compare S1 and S2. */
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
696 #if @GNULIB_WCSCMP@
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
697 # if !@HAVE_WCSCMP@
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
698 _GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
699 _GL_ATTRIBUTE_PURE);
14289
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
700 # endif
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
701 _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
702 _GL_CXXALIASWARN (wcscmp);
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
703 #elif defined GNULIB_POSIXCHECK
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
704 # undef wcscmp
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
705 # if HAVE_RAW_DECL_WCSCMP
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
706 _GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
707 "use gnulib module wcscmp for portability");
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
708 # endif
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
709 #endif
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
710
b5843d4d8441 New module 'wcscmp'.
Bruno Haible <bruno@clisp.org>
parents: 14288
diff changeset
711
14290
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
712 /* Compare no more than N wide characters of S1 and S2. */
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
713 #if @GNULIB_WCSNCMP@
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
714 # if !@HAVE_WCSNCMP@
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
715 _GL_FUNCDECL_SYS (wcsncmp, int,
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
716 (const wchar_t *s1, const wchar_t *s2, size_t n)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
717 _GL_ATTRIBUTE_PURE);
14290
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
718 # endif
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
719 _GL_CXXALIAS_SYS (wcsncmp, int,
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
720 (const wchar_t *s1, const wchar_t *s2, size_t n));
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
721 _GL_CXXALIASWARN (wcsncmp);
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
722 #elif defined GNULIB_POSIXCHECK
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
723 # undef wcsncmp
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
724 # if HAVE_RAW_DECL_WCSNCMP
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
725 _GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
726 "use gnulib module wcsncmp for portability");
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
727 # endif
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
728 #endif
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
729
0da9f0fe36fe New module 'wcsncmp'.
Bruno Haible <bruno@clisp.org>
parents: 14289
diff changeset
730
14291
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
731 /* Compare S1 and S2, ignoring case. */
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
732 #if @GNULIB_WCSCASECMP@
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
733 # if !@HAVE_WCSCASECMP@
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
734 _GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
735 _GL_ATTRIBUTE_PURE);
14291
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
736 # endif
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
737 _GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
738 _GL_CXXALIASWARN (wcscasecmp);
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
739 #elif defined GNULIB_POSIXCHECK
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
740 # undef wcscasecmp
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
741 # if HAVE_RAW_DECL_WCSCASECMP
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
742 _GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
743 "use gnulib module wcscasecmp for portability");
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
744 # endif
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
745 #endif
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
746
517e0af1a79b New module 'wcscasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14290
diff changeset
747
14292
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
748 /* Compare no more than N chars of S1 and S2, ignoring case. */
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
749 #if @GNULIB_WCSNCASECMP@
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
750 # if !@HAVE_WCSNCASECMP@
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
751 _GL_FUNCDECL_SYS (wcsncasecmp, int,
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
752 (const wchar_t *s1, const wchar_t *s2, size_t n)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
753 _GL_ATTRIBUTE_PURE);
14292
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
754 # endif
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
755 _GL_CXXALIAS_SYS (wcsncasecmp, int,
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
756 (const wchar_t *s1, const wchar_t *s2, size_t n));
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
757 _GL_CXXALIASWARN (wcsncasecmp);
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
758 #elif defined GNULIB_POSIXCHECK
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
759 # undef wcsncasecmp
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
760 # if HAVE_RAW_DECL_WCSNCASECMP
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
761 _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
762 "use gnulib module wcsncasecmp for portability");
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
763 # endif
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
764 #endif
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
765
ba9661869dda New module 'wcsncasecmp'.
Bruno Haible <bruno@clisp.org>
parents: 14291
diff changeset
766
14293
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
767 /* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
768 category of the current locale. */
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
769 #if @GNULIB_WCSCOLL@
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
770 # if !@HAVE_WCSCOLL@
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
771 _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
772 # endif
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
773 _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
774 _GL_CXXALIASWARN (wcscoll);
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
775 #elif defined GNULIB_POSIXCHECK
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
776 # undef wcscoll
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
777 # if HAVE_RAW_DECL_WCSCOLL
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
778 _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
779 "use gnulib module wcscoll for portability");
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
780 # endif
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
781 #endif
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
782
13e6946b4e9a New module 'wcscoll'.
Bruno Haible <bruno@clisp.org>
parents: 14292
diff changeset
783
14294
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
784 /* Transform S2 into array pointed to by S1 such that if wcscmp is applied
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
785 to two transformed strings the result is the as applying 'wcscoll' to the
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
786 original strings. */
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
787 #if @GNULIB_WCSXFRM@
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
788 # if !@HAVE_WCSXFRM@
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
789 _GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
790 # endif
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
791 _GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
792 _GL_CXXALIASWARN (wcsxfrm);
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
793 #elif defined GNULIB_POSIXCHECK
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
794 # undef wcsxfrm
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
795 # if HAVE_RAW_DECL_WCSXFRM
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
796 _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
797 "use gnulib module wcsxfrm for portability");
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
798 # endif
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
799 #endif
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
800
b19db9397852 New module 'wcsxfrm'.
Bruno Haible <bruno@clisp.org>
parents: 14293
diff changeset
801
14295
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
802 /* Duplicate S, returning an identical malloc'd string. */
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
803 #if @GNULIB_WCSDUP@
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
804 # if !@HAVE_WCSDUP@
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
805 _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
806 # endif
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
807 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
808 _GL_CXXALIASWARN (wcsdup);
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
809 #elif defined GNULIB_POSIXCHECK
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
810 # undef wcsdup
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
811 # if HAVE_RAW_DECL_WCSDUP
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
812 _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
813 "use gnulib module wcsdup for portability");
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
814 # endif
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
815 #endif
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
816
34809a158a33 New module 'wcsdup'.
Bruno Haible <bruno@clisp.org>
parents: 14294
diff changeset
817
14296
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
818 /* Find the first occurrence of WC in WCS. */
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
819 #if @GNULIB_WCSCHR@
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
820 # if !@HAVE_WCSCHR@
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
821 _GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
822 _GL_ATTRIBUTE_PURE);
14296
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
823 # endif
14519
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
824 /* On some systems, this function is defined as an overloaded function:
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
825 extern "C++" {
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
826 const wchar_t * std::wcschr (const wchar_t *, wchar_t);
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
827 wchar_t * std::wcschr (wchar_t *, wchar_t);
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
828 } */
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
829 _GL_CXXALIAS_SYS_CAST2 (wcschr,
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
830 wchar_t *, (const wchar_t *, wchar_t),
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
831 const wchar_t *, (const wchar_t *, wchar_t));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
832 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
833 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
834 _GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
835 _GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
836 # else
14296
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
837 _GL_CXXALIASWARN (wcschr);
14519
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
838 # endif
14296
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
839 #elif defined GNULIB_POSIXCHECK
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
840 # undef wcschr
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
841 # if HAVE_RAW_DECL_WCSCHR
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
842 _GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
843 "use gnulib module wcschr for portability");
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
844 # endif
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
845 #endif
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
846
932d02b6b200 New module 'wcschr'.
Bruno Haible <bruno@clisp.org>
parents: 14295
diff changeset
847
14297
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
848 /* Find the last occurrence of WC in WCS. */
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
849 #if @GNULIB_WCSRCHR@
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
850 # if !@HAVE_WCSRCHR@
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
851 _GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
852 _GL_ATTRIBUTE_PURE);
14297
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
853 # endif
14519
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
854 /* On some systems, this function is defined as an overloaded function:
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
855 extern "C++" {
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
856 const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
857 wchar_t * std::wcsrchr (wchar_t *, wchar_t);
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
858 } */
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
859 _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
860 wchar_t *, (const wchar_t *, wchar_t),
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
861 const wchar_t *, (const wchar_t *, wchar_t));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
862 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
863 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
864 _GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
865 _GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
866 # else
14297
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
867 _GL_CXXALIASWARN (wcsrchr);
14519
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
868 # endif
14297
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
869 #elif defined GNULIB_POSIXCHECK
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
870 # undef wcsrchr
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
871 # if HAVE_RAW_DECL_WCSRCHR
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
872 _GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
873 "use gnulib module wcsrchr for portability");
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
874 # endif
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
875 #endif
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
876
029111e5ac51 New module 'wcsrchr'.
Bruno Haible <bruno@clisp.org>
parents: 14296
diff changeset
877
14298
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
878 /* Return the length of the initial segmet of WCS which consists entirely
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
879 of wide characters not in REJECT. */
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
880 #if @GNULIB_WCSCSPN@
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
881 # if !@HAVE_WCSCSPN@
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
882 _GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
883 _GL_ATTRIBUTE_PURE);
14298
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
884 # endif
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
885 _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
886 _GL_CXXALIASWARN (wcscspn);
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
887 #elif defined GNULIB_POSIXCHECK
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
888 # undef wcscspn
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
889 # if HAVE_RAW_DECL_WCSCSPN
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
890 _GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
891 "use gnulib module wcscspn for portability");
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
892 # endif
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
893 #endif
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
894
f0c82d0c08e6 New module 'wcscspn'.
Bruno Haible <bruno@clisp.org>
parents: 14297
diff changeset
895
14299
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
896 /* Return the length of the initial segmet of WCS which consists entirely
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
897 of wide characters in ACCEPT. */
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
898 #if @GNULIB_WCSSPN@
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
899 # if !@HAVE_WCSSPN@
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
900 _GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
901 _GL_ATTRIBUTE_PURE);
14299
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
902 # endif
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
903 _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
904 _GL_CXXALIASWARN (wcsspn);
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
905 #elif defined GNULIB_POSIXCHECK
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
906 # undef wcsspn
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
907 # if HAVE_RAW_DECL_WCSSPN
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
908 _GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
909 "use gnulib module wcsspn for portability");
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
910 # endif
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
911 #endif
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
912
0d372bfa8a0f New module 'wcsspn'.
Bruno Haible <bruno@clisp.org>
parents: 14298
diff changeset
913
14300
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
914 /* Find the first occurrence in WCS of any character in ACCEPT. */
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
915 #if @GNULIB_WCSPBRK@
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
916 # if !@HAVE_WCSPBRK@
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
917 _GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
918 (const wchar_t *wcs, const wchar_t *accept)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
919 _GL_ATTRIBUTE_PURE);
14300
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
920 # endif
14519
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
921 /* On some systems, this function is defined as an overloaded function:
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
922 extern "C++" {
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
923 const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
924 wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
925 } */
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
926 _GL_CXXALIAS_SYS_CAST2 (wcspbrk,
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
927 wchar_t *, (const wchar_t *, const wchar_t *),
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
928 const wchar_t *, (const wchar_t *, const wchar_t *));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
929 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
930 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
931 _GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
932 (wchar_t *wcs, const wchar_t *accept));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
933 _GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
934 (const wchar_t *wcs, const wchar_t *accept));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
935 # else
14300
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
936 _GL_CXXALIASWARN (wcspbrk);
14519
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
937 # endif
14300
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
938 #elif defined GNULIB_POSIXCHECK
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
939 # undef wcspbrk
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
940 # if HAVE_RAW_DECL_WCSPBRK
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
941 _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
942 "use gnulib module wcspbrk for portability");
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
943 # endif
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
944 #endif
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
945
31285699a61f New module 'wcspbrk'.
Bruno Haible <bruno@clisp.org>
parents: 14299
diff changeset
946
14301
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
947 /* Find the first occurrence of NEEDLE in HAYSTACK. */
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
948 #if @GNULIB_WCSSTR@
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
949 # if !@HAVE_WCSSTR@
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
950 _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
951 (const wchar_t *haystack, const wchar_t *needle)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
952 _GL_ATTRIBUTE_PURE);
14301
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
953 # endif
14519
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
954 /* On some systems, this function is defined as an overloaded function:
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
955 extern "C++" {
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
956 const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
957 wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
958 } */
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
959 _GL_CXXALIAS_SYS_CAST2 (wcsstr,
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
960 wchar_t *, (const wchar_t *, const wchar_t *),
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
961 const wchar_t *, (const wchar_t *, const wchar_t *));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
962 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
963 && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
964 _GL_CXXALIASWARN1 (wcsstr, wchar_t *,
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
965 (wchar_t *haystack, const wchar_t *needle));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
966 _GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
967 (const wchar_t *haystack, const wchar_t *needle));
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
968 # else
14301
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
969 _GL_CXXALIASWARN (wcsstr);
14519
d20bca67b23f wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr: Avoid errors in C++ mode.
Bruno Haible <bruno@clisp.org>
parents: 14303
diff changeset
970 # endif
14301
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
971 #elif defined GNULIB_POSIXCHECK
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
972 # undef wcsstr
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
973 # if HAVE_RAW_DECL_WCSSTR
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
974 _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
975 "use gnulib module wcsstr for portability");
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
976 # endif
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
977 #endif
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
978
b58bcfabff09 New module 'wcsstr'.
Bruno Haible <bruno@clisp.org>
parents: 14300
diff changeset
979
14302
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
980 /* Divide WCS into tokens separated by characters in DELIM. */
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
981 #if @GNULIB_WCSTOK@
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
982 # if !@HAVE_WCSTOK@
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
983 _GL_FUNCDECL_SYS (wcstok, wchar_t *,
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
984 (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
985 # endif
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
986 _GL_CXXALIAS_SYS (wcstok, wchar_t *,
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
987 (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
988 _GL_CXXALIASWARN (wcstok);
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
989 #elif defined GNULIB_POSIXCHECK
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
990 # undef wcstok
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
991 # if HAVE_RAW_DECL_WCSTOK
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
992 _GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
993 "use gnulib module wcstok for portability");
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
994 # endif
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
995 #endif
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
996
952e98e7b703 New module 'wcstok'.
Bruno Haible <bruno@clisp.org>
parents: 14301
diff changeset
997
14303
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
998 /* Determine number of column positions required for first N wide
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
999 characters (or fewer if S ends before this) in S. */
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1000 #if @GNULIB_WCSWIDTH@
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1001 # if @REPLACE_WCSWIDTH@
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1002 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1003 # undef wcswidth
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1004 # define wcswidth rpl_wcswidth
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1005 # endif
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
1006 _GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
1007 _GL_ATTRIBUTE_PURE);
14303
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1008 _GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1009 # else
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1010 # if !@HAVE_WCSWIDTH@
16715
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
1011 _GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
be14d9f76493 Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents: 16366
diff changeset
1012 _GL_ATTRIBUTE_PURE);
14303
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1013 # endif
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1014 _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1015 # endif
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1016 _GL_CXXALIASWARN (wcswidth);
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1017 #elif defined GNULIB_POSIXCHECK
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1018 # undef wcswidth
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1019 # if HAVE_RAW_DECL_WCSWIDTH
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1020 _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1021 "use gnulib module wcswidth for portability");
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1022 # endif
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1023 #endif
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1024
7357862f4745 New module 'wcswidth'.
Bruno Haible <bruno@clisp.org>
parents: 14302
diff changeset
1025
14840
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14581
diff changeset
1026 #endif /* _@GUARD_PREFIX@_WCHAR_H */
5f709022a256 Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents: 14581
diff changeset
1027 #endif /* _@GUARD_PREFIX@_WCHAR_H */
9842
5a6c62d69d18 * lib/wchar.in.h [defined __need_mbstate_t]: Just include <wchar.h>.
Paul Eggert <eggert@cs.ucla.edu>
parents: 9272
diff changeset
1028 #endif