annotate lib/wchar.in.h @ 272:d5392bb5da3c 2.5

Added generated files
author lost
date Sun, 16 Aug 2009 17:16:49 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
272
d5392bb5da3c Added generated files
lost
parents:
diff changeset
1 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
2
d5392bb5da3c Added generated files
lost
parents:
diff changeset
3 Copyright (C) 2007-2008 Free Software Foundation, Inc.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
4
d5392bb5da3c Added generated files
lost
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify
d5392bb5da3c Added generated files
lost
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
d5392bb5da3c Added generated files
lost
parents:
diff changeset
7 the Free Software Foundation; either version 3, or (at your option)
d5392bb5da3c Added generated files
lost
parents:
diff changeset
8 any later version.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
9
d5392bb5da3c Added generated files
lost
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
d5392bb5da3c Added generated files
lost
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
d5392bb5da3c Added generated files
lost
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d5392bb5da3c Added generated files
lost
parents:
diff changeset
13 GNU General Public License for more details.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
14
d5392bb5da3c Added generated files
lost
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
d5392bb5da3c Added generated files
lost
parents:
diff changeset
16 along with this program; if not, write to the Free Software Foundation,
d5392bb5da3c Added generated files
lost
parents:
diff changeset
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
18
d5392bb5da3c Added generated files
lost
parents:
diff changeset
19 /* Written by Eric Blake. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
20
d5392bb5da3c Added generated files
lost
parents:
diff changeset
21 /*
d5392bb5da3c Added generated files
lost
parents:
diff changeset
22 * ISO C 99 <wchar.h> for platforms that have issues.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
23 * <http://www.opengroup.org/susv3xbd/wchar.h.html>
d5392bb5da3c Added generated files
lost
parents:
diff changeset
24 *
d5392bb5da3c Added generated files
lost
parents:
diff changeset
25 * For now, this just ensures proper prerequisite inclusion order and
d5392bb5da3c Added generated files
lost
parents:
diff changeset
26 * the declaration of wcwidth().
d5392bb5da3c Added generated files
lost
parents:
diff changeset
27 */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
28
d5392bb5da3c Added generated files
lost
parents:
diff changeset
29 #if __GNUC__ >= 3
d5392bb5da3c Added generated files
lost
parents:
diff changeset
30 @PRAGMA_SYSTEM_HEADER@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
31 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
32
d5392bb5da3c Added generated files
lost
parents:
diff changeset
33 #ifdef __need_mbstate_t
d5392bb5da3c Added generated files
lost
parents:
diff changeset
34 /* Special invocation convention inside uClibc header files. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
35
d5392bb5da3c Added generated files
lost
parents:
diff changeset
36 #@INCLUDE_NEXT@ @NEXT_WCHAR_H@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
37
d5392bb5da3c Added generated files
lost
parents:
diff changeset
38 #else
d5392bb5da3c Added generated files
lost
parents:
diff changeset
39 /* Normal invocation convention. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
40
d5392bb5da3c Added generated files
lost
parents:
diff changeset
41 #ifndef _GL_WCHAR_H
d5392bb5da3c Added generated files
lost
parents:
diff changeset
42
d5392bb5da3c Added generated files
lost
parents:
diff changeset
43 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
d5392bb5da3c Added generated files
lost
parents:
diff changeset
44 <wchar.h>.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
45 BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
d5392bb5da3c Added generated files
lost
parents:
diff changeset
46 included before <wchar.h>. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
47 #include <stddef.h>
d5392bb5da3c Added generated files
lost
parents:
diff changeset
48 #include <stdio.h>
d5392bb5da3c Added generated files
lost
parents:
diff changeset
49 #include <time.h>
d5392bb5da3c Added generated files
lost
parents:
diff changeset
50
d5392bb5da3c Added generated files
lost
parents:
diff changeset
51 /* Include the original <wchar.h> if it exists.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
52 Some builds of uClibc lack it. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
53 /* The include_next requires a split double-inclusion guard. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
54 #if @HAVE_WCHAR_H@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
55 # @INCLUDE_NEXT@ @NEXT_WCHAR_H@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
56 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
57
d5392bb5da3c Added generated files
lost
parents:
diff changeset
58 #ifndef _GL_WCHAR_H
d5392bb5da3c Added generated files
lost
parents:
diff changeset
59 #define _GL_WCHAR_H
d5392bb5da3c Added generated files
lost
parents:
diff changeset
60
d5392bb5da3c Added generated files
lost
parents:
diff changeset
61 /* The definition of GL_LINK_WARNING is copied here. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
62
d5392bb5da3c Added generated files
lost
parents:
diff changeset
63 #ifdef __cplusplus
d5392bb5da3c Added generated files
lost
parents:
diff changeset
64 extern "C" {
d5392bb5da3c Added generated files
lost
parents:
diff changeset
65 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
66
d5392bb5da3c Added generated files
lost
parents:
diff changeset
67
d5392bb5da3c Added generated files
lost
parents:
diff changeset
68 /* Define wint_t. (Also done in wctype.in.h.) */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
69 #if !@HAVE_WINT_T@ && !defined wint_t
d5392bb5da3c Added generated files
lost
parents:
diff changeset
70 # define wint_t int
d5392bb5da3c Added generated files
lost
parents:
diff changeset
71 # ifndef WEOF
d5392bb5da3c Added generated files
lost
parents:
diff changeset
72 # define WEOF -1
d5392bb5da3c Added generated files
lost
parents:
diff changeset
73 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
74 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
75
d5392bb5da3c Added generated files
lost
parents:
diff changeset
76
d5392bb5da3c Added generated files
lost
parents:
diff changeset
77 /* Override mbstate_t if it is too small.
d5392bb5da3c Added generated files
lost
parents:
diff changeset
78 On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
d5392bb5da3c Added generated files
lost
parents:
diff changeset
79 implementing mbrtowc for encodings like UTF-8. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
80 #if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
81 typedef int rpl_mbstate_t;
d5392bb5da3c Added generated files
lost
parents:
diff changeset
82 # undef mbstate_t
d5392bb5da3c Added generated files
lost
parents:
diff changeset
83 # define mbstate_t rpl_mbstate_t
d5392bb5da3c Added generated files
lost
parents:
diff changeset
84 # define GNULIB_defined_mbstate_t 1
d5392bb5da3c Added generated files
lost
parents:
diff changeset
85 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
86
d5392bb5da3c Added generated files
lost
parents:
diff changeset
87
d5392bb5da3c Added generated files
lost
parents:
diff changeset
88 /* Convert a single-byte character to a wide character. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
89 #if @GNULIB_BTOWC@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
90 # if @REPLACE_BTOWC@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
91 # undef btowc
d5392bb5da3c Added generated files
lost
parents:
diff changeset
92 # define btowc rpl_btowc
d5392bb5da3c Added generated files
lost
parents:
diff changeset
93 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
94 # if !@HAVE_BTOWC@ || @REPLACE_BTOWC@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
95 extern wint_t btowc (int c);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
96 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
97 #elif defined GNULIB_POSIXCHECK
d5392bb5da3c Added generated files
lost
parents:
diff changeset
98 # undef btowc
d5392bb5da3c Added generated files
lost
parents:
diff changeset
99 # define btowc(c) \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
100 (GL_LINK_WARNING ("btowc is unportable - " \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
101 "use gnulib module btowc for portability"), \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
102 btowc (c))
d5392bb5da3c Added generated files
lost
parents:
diff changeset
103 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
104
d5392bb5da3c Added generated files
lost
parents:
diff changeset
105
d5392bb5da3c Added generated files
lost
parents:
diff changeset
106 /* Convert a wide character to a single-byte character. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
107 #if @GNULIB_WCTOB@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
108 # if @REPLACE_WCTOB@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
109 # undef wctob
d5392bb5da3c Added generated files
lost
parents:
diff changeset
110 # define wctob rpl_wctob
d5392bb5da3c Added generated files
lost
parents:
diff changeset
111 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
112 # if (!defined wctob && !@HAVE_DECL_WCTOB@) || @REPLACE_WCTOB@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
113 /* wctob is provided by gnulib, or wctob exists but is not declared. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
114 extern int wctob (wint_t wc);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
115 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
116 #elif defined GNULIB_POSIXCHECK
d5392bb5da3c Added generated files
lost
parents:
diff changeset
117 # undef wctob
d5392bb5da3c Added generated files
lost
parents:
diff changeset
118 # define wctob(w) \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
119 (GL_LINK_WARNING ("wctob is unportable - " \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
120 "use gnulib module wctob for portability"), \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
121 wctob (w))
d5392bb5da3c Added generated files
lost
parents:
diff changeset
122 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
123
d5392bb5da3c Added generated files
lost
parents:
diff changeset
124
d5392bb5da3c Added generated files
lost
parents:
diff changeset
125 /* Test whether *PS is in the initial state. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
126 #if @GNULIB_MBSINIT@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
127 # if @REPLACE_MBSINIT@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
128 # undef mbsinit
d5392bb5da3c Added generated files
lost
parents:
diff changeset
129 # define mbsinit rpl_mbsinit
d5392bb5da3c Added generated files
lost
parents:
diff changeset
130 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
131 # if !@HAVE_MBSINIT@ || @REPLACE_MBSINIT@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
132 extern int mbsinit (const mbstate_t *ps);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
133 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
134 #elif defined GNULIB_POSIXCHECK
d5392bb5da3c Added generated files
lost
parents:
diff changeset
135 # undef mbsinit
d5392bb5da3c Added generated files
lost
parents:
diff changeset
136 # define mbsinit(p) \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
137 (GL_LINK_WARNING ("mbsinit is unportable - " \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
138 "use gnulib module mbsinit for portability"), \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
139 mbsinit (p))
d5392bb5da3c Added generated files
lost
parents:
diff changeset
140 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
141
d5392bb5da3c Added generated files
lost
parents:
diff changeset
142
d5392bb5da3c Added generated files
lost
parents:
diff changeset
143 /* Convert a multibyte character to a wide character. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
144 #if @GNULIB_MBRTOWC@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
145 # if @REPLACE_MBRTOWC@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
146 # undef mbrtowc
d5392bb5da3c Added generated files
lost
parents:
diff changeset
147 # define mbrtowc rpl_mbrtowc
d5392bb5da3c Added generated files
lost
parents:
diff changeset
148 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
149 # if !@HAVE_MBRTOWC@ || @REPLACE_MBRTOWC@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
150 extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
151 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
152 #elif defined GNULIB_POSIXCHECK
d5392bb5da3c Added generated files
lost
parents:
diff changeset
153 # undef mbrtowc
d5392bb5da3c Added generated files
lost
parents:
diff changeset
154 # define mbrtowc(w,s,n,p) \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
155 (GL_LINK_WARNING ("mbrtowc is unportable - " \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
156 "use gnulib module mbrtowc for portability"), \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
157 mbrtowc (w, s, n, p))
d5392bb5da3c Added generated files
lost
parents:
diff changeset
158 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
159
d5392bb5da3c Added generated files
lost
parents:
diff changeset
160
d5392bb5da3c Added generated files
lost
parents:
diff changeset
161 /* Recognize a multibyte character. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
162 #if @GNULIB_MBRLEN@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
163 # if @REPLACE_MBRLEN@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
164 # undef mbrlen
d5392bb5da3c Added generated files
lost
parents:
diff changeset
165 # define mbrlen rpl_mbrlen
d5392bb5da3c Added generated files
lost
parents:
diff changeset
166 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
167 # if !@HAVE_MBRLEN@ || @REPLACE_MBRLEN@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
168 extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
169 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
170 #elif defined GNULIB_POSIXCHECK
d5392bb5da3c Added generated files
lost
parents:
diff changeset
171 # undef mbrlen
d5392bb5da3c Added generated files
lost
parents:
diff changeset
172 # define mbrlen(s,n,p) \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
173 (GL_LINK_WARNING ("mbrlen is unportable - " \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
174 "use gnulib module mbrlen for portability"), \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
175 mbrlen (s, n, p))
d5392bb5da3c Added generated files
lost
parents:
diff changeset
176 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
177
d5392bb5da3c Added generated files
lost
parents:
diff changeset
178
d5392bb5da3c Added generated files
lost
parents:
diff changeset
179 /* Convert a string to a wide string. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
180 #if @GNULIB_MBSRTOWCS@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
181 # if @REPLACE_MBSRTOWCS@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
182 # undef mbsrtowcs
d5392bb5da3c Added generated files
lost
parents:
diff changeset
183 # define mbsrtowcs rpl_mbsrtowcs
d5392bb5da3c Added generated files
lost
parents:
diff changeset
184 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
185 # if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
186 extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
187 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
188 #elif defined GNULIB_POSIXCHECK
d5392bb5da3c Added generated files
lost
parents:
diff changeset
189 # undef mbsrtowcs
d5392bb5da3c Added generated files
lost
parents:
diff changeset
190 # define mbsrtowcs(d,s,l,p) \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
191 (GL_LINK_WARNING ("mbsrtowcs is unportable - " \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
192 "use gnulib module mbsrtowcs for portability"), \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
193 mbsrtowcs (d, s, l, p))
d5392bb5da3c Added generated files
lost
parents:
diff changeset
194 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
195
d5392bb5da3c Added generated files
lost
parents:
diff changeset
196
d5392bb5da3c Added generated files
lost
parents:
diff changeset
197 /* Convert a string to a wide string. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
198 #if @GNULIB_MBSNRTOWCS@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
199 # if @REPLACE_MBSNRTOWCS@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
200 # undef mbsnrtowcs
d5392bb5da3c Added generated files
lost
parents:
diff changeset
201 # define mbsnrtowcs rpl_mbsnrtowcs
d5392bb5da3c Added generated files
lost
parents:
diff changeset
202 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
203 # if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
204 extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
205 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
206 #elif defined GNULIB_POSIXCHECK
d5392bb5da3c Added generated files
lost
parents:
diff changeset
207 # undef mbsnrtowcs
d5392bb5da3c Added generated files
lost
parents:
diff changeset
208 # define mbsnrtowcs(d,s,n,l,p) \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
209 (GL_LINK_WARNING ("mbsnrtowcs is unportable - " \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
210 "use gnulib module mbsnrtowcs for portability"), \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
211 mbsnrtowcs (d, s, n, l, p))
d5392bb5da3c Added generated files
lost
parents:
diff changeset
212 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
213
d5392bb5da3c Added generated files
lost
parents:
diff changeset
214
d5392bb5da3c Added generated files
lost
parents:
diff changeset
215 /* Convert a wide character to a multibyte character. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
216 #if @GNULIB_WCRTOMB@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
217 # if @REPLACE_WCRTOMB@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
218 # undef wcrtomb
d5392bb5da3c Added generated files
lost
parents:
diff changeset
219 # define wcrtomb rpl_wcrtomb
d5392bb5da3c Added generated files
lost
parents:
diff changeset
220 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
221 # if !@HAVE_WCRTOMB@ || @REPLACE_WCRTOMB@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
222 extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
223 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
224 #elif defined GNULIB_POSIXCHECK
d5392bb5da3c Added generated files
lost
parents:
diff changeset
225 # undef wcrtomb
d5392bb5da3c Added generated files
lost
parents:
diff changeset
226 # define wcrtomb(s,w,p) \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
227 (GL_LINK_WARNING ("wcrtomb is unportable - " \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
228 "use gnulib module wcrtomb for portability"), \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
229 wcrtomb (s, w, p))
d5392bb5da3c Added generated files
lost
parents:
diff changeset
230 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
231
d5392bb5da3c Added generated files
lost
parents:
diff changeset
232
d5392bb5da3c Added generated files
lost
parents:
diff changeset
233 /* Convert a wide string to a string. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
234 #if @GNULIB_WCSRTOMBS@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
235 # if @REPLACE_WCSRTOMBS@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
236 # undef wcsrtombs
d5392bb5da3c Added generated files
lost
parents:
diff changeset
237 # define wcsrtombs rpl_wcsrtombs
d5392bb5da3c Added generated files
lost
parents:
diff changeset
238 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
239 # if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
240 extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
241 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
242 #elif defined GNULIB_POSIXCHECK
d5392bb5da3c Added generated files
lost
parents:
diff changeset
243 # undef wcsrtombs
d5392bb5da3c Added generated files
lost
parents:
diff changeset
244 # define wcsrtombs(d,s,l,p) \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
245 (GL_LINK_WARNING ("wcsrtombs is unportable - " \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
246 "use gnulib module wcsrtombs for portability"), \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
247 wcsrtombs (d, s, l, p))
d5392bb5da3c Added generated files
lost
parents:
diff changeset
248 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
249
d5392bb5da3c Added generated files
lost
parents:
diff changeset
250
d5392bb5da3c Added generated files
lost
parents:
diff changeset
251 /* Convert a wide string to a string. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
252 #if @GNULIB_WCSNRTOMBS@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
253 # if !@HAVE_WCSNRTOMBS@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
254 extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
255 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
256 #elif defined GNULIB_POSIXCHECK
d5392bb5da3c Added generated files
lost
parents:
diff changeset
257 # undef wcsnrtombs
d5392bb5da3c Added generated files
lost
parents:
diff changeset
258 # define wcsnrtombs(d,s,n,l,p) \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
259 (GL_LINK_WARNING ("wcsnrtombs is unportable - " \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
260 "use gnulib module wcsnrtombs for portability"), \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
261 wcsnrtombs (d, s, n, l, p))
d5392bb5da3c Added generated files
lost
parents:
diff changeset
262 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
263
d5392bb5da3c Added generated files
lost
parents:
diff changeset
264
d5392bb5da3c Added generated files
lost
parents:
diff changeset
265 /* Return the number of screen columns needed for WC. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
266 #if @GNULIB_WCWIDTH@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
267 # if @REPLACE_WCWIDTH@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
268 # undef wcwidth
d5392bb5da3c Added generated files
lost
parents:
diff changeset
269 # define wcwidth rpl_wcwidth
d5392bb5da3c Added generated files
lost
parents:
diff changeset
270 extern int wcwidth (wchar_t);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
271 # else
d5392bb5da3c Added generated files
lost
parents:
diff changeset
272 # if !defined wcwidth && !@HAVE_DECL_WCWIDTH@
d5392bb5da3c Added generated files
lost
parents:
diff changeset
273 /* wcwidth exists but is not declared. */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
274 extern int wcwidth (int /* actually wchar_t */);
d5392bb5da3c Added generated files
lost
parents:
diff changeset
275 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
276 # endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
277 #elif defined GNULIB_POSIXCHECK
d5392bb5da3c Added generated files
lost
parents:
diff changeset
278 # undef wcwidth
d5392bb5da3c Added generated files
lost
parents:
diff changeset
279 # define wcwidth(w) \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
280 (GL_LINK_WARNING ("wcwidth is unportable - " \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
281 "use gnulib module wcwidth for portability"), \
d5392bb5da3c Added generated files
lost
parents:
diff changeset
282 wcwidth (w))
d5392bb5da3c Added generated files
lost
parents:
diff changeset
283 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
284
d5392bb5da3c Added generated files
lost
parents:
diff changeset
285
d5392bb5da3c Added generated files
lost
parents:
diff changeset
286 #ifdef __cplusplus
d5392bb5da3c Added generated files
lost
parents:
diff changeset
287 }
d5392bb5da3c Added generated files
lost
parents:
diff changeset
288 #endif
d5392bb5da3c Added generated files
lost
parents:
diff changeset
289
d5392bb5da3c Added generated files
lost
parents:
diff changeset
290 #endif /* _GL_WCHAR_H */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
291 #endif /* _GL_WCHAR_H */
d5392bb5da3c Added generated files
lost
parents:
diff changeset
292 #endif