68
82
/* Define wint_t. (Also done in wctype.in.h.) */
69
83
#if !@HAVE_WINT_T@ && !defined wint_t
70
84
# define wint_t int
91
/* Override mbstate_t if it is too small.
92
On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
93
implementing mbrtowc for encodings like UTF-8. */
94
#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
95
typedef int rpl_mbstate_t;
97
# define mbstate_t rpl_mbstate_t
98
# define GNULIB_defined_mbstate_t 1
102
/* Convert a single-byte character to a wide character. */
106
# define btowc rpl_btowc
108
# if !@HAVE_BTOWC@ || @REPLACE_BTOWC@
109
extern wint_t btowc (int c);
111
#elif defined GNULIB_POSIXCHECK
114
(GL_LINK_WARNING ("btowc is unportable - " \
115
"use gnulib module btowc for portability"), \
120
/* Convert a wide character to a single-byte character. */
124
# define wctob rpl_wctob
126
# if (!defined wctob && !@HAVE_DECL_WCTOB@) || @REPLACE_WCTOB@
127
/* wctob is provided by gnulib, or wctob exists but is not declared. */
128
extern int wctob (wint_t wc);
130
#elif defined GNULIB_POSIXCHECK
133
(GL_LINK_WARNING ("wctob is unportable - " \
134
"use gnulib module wctob for portability"), \
139
/* Test whether *PS is in the initial state. */
141
# if @REPLACE_MBSINIT@
143
# define mbsinit rpl_mbsinit
145
# if !@HAVE_MBSINIT@ || @REPLACE_MBSINIT@
146
extern int mbsinit (const mbstate_t *ps);
148
#elif defined GNULIB_POSIXCHECK
150
# define mbsinit(p) \
151
(GL_LINK_WARNING ("mbsinit is unportable - " \
152
"use gnulib module mbsinit for portability"), \
157
/* Convert a multibyte character to a wide character. */
159
# if @REPLACE_MBRTOWC@
161
# define mbrtowc rpl_mbrtowc
163
# if !@HAVE_MBRTOWC@ || @REPLACE_MBRTOWC@
164
extern size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps);
166
#elif defined GNULIB_POSIXCHECK
168
# define mbrtowc(w,s,n,p) \
169
(GL_LINK_WARNING ("mbrtowc is unportable - " \
170
"use gnulib module mbrtowc for portability"), \
171
mbrtowc (w, s, n, p))
175
/* Recognize a multibyte character. */
177
# if @REPLACE_MBRLEN@
179
# define mbrlen rpl_mbrlen
181
# if !@HAVE_MBRLEN@ || @REPLACE_MBRLEN@
182
extern size_t mbrlen (const char *s, size_t n, mbstate_t *ps);
184
#elif defined GNULIB_POSIXCHECK
186
# define mbrlen(s,n,p) \
187
(GL_LINK_WARNING ("mbrlen is unportable - " \
188
"use gnulib module mbrlen for portability"), \
193
/* Convert a string to a wide string. */
194
#if @GNULIB_MBSRTOWCS@
195
# if @REPLACE_MBSRTOWCS@
197
# define mbsrtowcs rpl_mbsrtowcs
199
# if !@HAVE_MBSRTOWCS@ || @REPLACE_MBSRTOWCS@
200
extern size_t mbsrtowcs (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps);
202
#elif defined GNULIB_POSIXCHECK
204
# define mbsrtowcs(d,s,l,p) \
205
(GL_LINK_WARNING ("mbsrtowcs is unportable - " \
206
"use gnulib module mbsrtowcs for portability"), \
207
mbsrtowcs (d, s, l, p))
211
/* Convert a string to a wide string. */
212
#if @GNULIB_MBSNRTOWCS@
213
# if @REPLACE_MBSNRTOWCS@
215
# define mbsnrtowcs rpl_mbsnrtowcs
217
# if !@HAVE_MBSNRTOWCS@ || @REPLACE_MBSNRTOWCS@
218
extern size_t mbsnrtowcs (wchar_t *dest, const char **srcp, size_t srclen, size_t len, mbstate_t *ps);
220
#elif defined GNULIB_POSIXCHECK
222
# define mbsnrtowcs(d,s,n,l,p) \
223
(GL_LINK_WARNING ("mbsnrtowcs is unportable - " \
224
"use gnulib module mbsnrtowcs for portability"), \
225
mbsnrtowcs (d, s, n, l, p))
229
/* Convert a wide character to a multibyte character. */
231
# if @REPLACE_WCRTOMB@
233
# define wcrtomb rpl_wcrtomb
235
# if !@HAVE_WCRTOMB@ || @REPLACE_WCRTOMB@
236
extern size_t wcrtomb (char *s, wchar_t wc, mbstate_t *ps);
238
#elif defined GNULIB_POSIXCHECK
240
# define wcrtomb(s,w,p) \
241
(GL_LINK_WARNING ("wcrtomb is unportable - " \
242
"use gnulib module wcrtomb for portability"), \
247
/* Convert a wide string to a string. */
248
#if @GNULIB_WCSRTOMBS@
249
# if @REPLACE_WCSRTOMBS@
251
# define wcsrtombs rpl_wcsrtombs
253
# if !@HAVE_WCSRTOMBS@ || @REPLACE_WCSRTOMBS@
254
extern size_t wcsrtombs (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps);
256
#elif defined GNULIB_POSIXCHECK
258
# define wcsrtombs(d,s,l,p) \
259
(GL_LINK_WARNING ("wcsrtombs is unportable - " \
260
"use gnulib module wcsrtombs for portability"), \
261
wcsrtombs (d, s, l, p))
265
/* Convert a wide string to a string. */
266
#if @GNULIB_WCSNRTOMBS@
267
# if !@HAVE_WCSNRTOMBS@
268
extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen, size_t len, mbstate_t *ps);
270
#elif defined GNULIB_POSIXCHECK
272
# define wcsnrtombs(d,s,n,l,p) \
273
(GL_LINK_WARNING ("wcsnrtombs is unportable - " \
274
"use gnulib module wcsnrtombs for portability"), \
275
wcsnrtombs (d, s, n, l, p))