1 /* Copyright (C) 1995-99,2000,01,02 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 * ISO C99 Standard: 7.24
21 * Extended multibyte and wide character utilities <wchar.h>
26 #ifndef __need_mbstate_t
28 # include <features.h>
32 /* Get FILE definition. */
33 # define __need___FILE
38 /* Get va_list definition. */
39 # define __need___va_list
42 /* Get size_t, wchar_t, wint_t and NULL from <stddef.h>. */
43 # define __need_size_t
44 # define __need_wchar_t
50 #include <bits/wchar.h>
52 /* We try to get wint_t from <stddef.h>, but not all GCC versions define it
53 there. So define it ourselves if it remains undefined. */
55 /* Integral type unchanged by default argument promotions that can
56 hold any value corresponding to members of the extended character
57 set, as well as at least one value that does not correspond to any
58 member of the extended character set. */
60 typedef unsigned int wint_t;
64 #ifndef __mbstate_t_defined
65 # define __mbstate_t_defined 1
66 /* Conversion state information. */
74 } __value
; /* Value so far. */
77 #undef __need_mbstate_t
80 /* The rest of the file is only used if used if __need_mbstate_t is not
85 typedef __mbstate_t
mbstate_t;
88 /* These constants might also be defined in <inttypes.h>. */
89 # define WCHAR_MIN __WCHAR_MIN
90 # define WCHAR_MAX __WCHAR_MAX
94 # define WEOF (0xffffffffu)
97 /* For XPG4 compliance we have to define the stuff from <wctype.h> here
99 #if defined __USE_XOPEN && !defined __USE_UNIX98
103 /* This incomplete type is defined in <time.h> but needed here because
110 /* Copy SRC to DEST. */
111 extern wchar_t *wcscpy (wchar_t *__restrict __dest
,
112 __const
wchar_t *__restrict __src
) __THROW
;
113 /* Copy no more than N wide-characters of SRC to DEST. */
114 extern wchar_t *wcsncpy (wchar_t *__restrict __dest
,
115 __const
wchar_t *__restrict __src
, size_t __n
)
118 /* Append SRC onto DEST. */
119 extern wchar_t *wcscat (wchar_t *__restrict __dest
,
120 __const
wchar_t *__restrict __src
) __THROW
;
121 /* Append no more than N wide-characters of SRC onto DEST. */
122 extern wchar_t *wcsncat (wchar_t *__restrict __dest
,
123 __const
wchar_t *__restrict __src
, size_t __n
)
126 /* Compare S1 and S2. */
127 extern int wcscmp (__const
wchar_t *__s1
, __const
wchar_t *__s2
)
128 __THROW __attribute_pure__
;
129 /* Compare N wide-characters of S1 and S2. */
130 extern int wcsncmp (__const
wchar_t *__s1
, __const
wchar_t *__s2
, size_t __n
)
131 __THROW __attribute_pure__
;
134 /* Compare S1 and S2, ignoring case. */
135 extern int wcscasecmp (__const
wchar_t *__s1
, __const
wchar_t *__s2
) __THROW
;
137 /* Compare no more than N chars of S1 and S2, ignoring case. */
138 extern int wcsncasecmp (__const
wchar_t *__s1
, __const
wchar_t *__s2
,
141 /* Similar to the two functions above but take the information from
142 the provided locale and not the global locale. */
143 # include <xlocale.h>
145 extern int __wcscasecmp_l (__const
wchar_t *__s1
, __const
wchar_t *__s2
,
146 __locale_t __loc
) __THROW
;
147 extern int wcscasecmp_l (__const
wchar_t *__s1
, __const
wchar_t *__s2
,
148 __locale_t __loc
) __THROW
;
150 extern int __wcsncasecmp_l (__const
wchar_t *__s1
, __const
wchar_t *__s2
,
151 size_t __n
, __locale_t __loc
) __THROW
;
152 extern int wcsncasecmp_l (__const
wchar_t *__s1
, __const
wchar_t *__s2
,
153 size_t __n
, __locale_t __loc
) __THROW
;
156 /* Compare S1 and S2, both interpreted as appropriate to the
157 LC_COLLATE category of the current locale. */
158 extern int wcscoll (__const
wchar_t *__s1
, __const
wchar_t *__s2
) __THROW
;
159 /* Transform S2 into array pointed to by S1 such that if wcscmp is
160 applied to two transformed strings the result is the as applying
161 `wcscoll' to the original strings. */
162 extern size_t wcsxfrm (wchar_t *__restrict __s1
,
163 __const
wchar_t *__restrict __s2
, size_t __n
) __THROW
;
166 /* Similar to the two functions above but take the information from
167 the provided locale and not the global locale. */
169 /* Compare S1 and S2, both interpreted as appropriate to the
170 LC_COLLATE category of the given locale. */
171 extern int __wcscoll_l (__const
wchar_t *__s1
, __const
wchar_t *__s2
,
172 __locale_t __loc
) __THROW
;
173 extern int wcscoll_l (__const
wchar_t *__s1
, __const
wchar_t *__s2
,
174 __locale_t __loc
) __THROW
;
176 /* Transform S2 into array pointed to by S1 such that if wcscmp is
177 applied to two transformed strings the result is the as applying
178 `wcscoll' to the original strings. */
179 extern size_t __wcsxfrm_l (wchar_t *__s1
, __const
wchar_t *__s2
,
180 size_t __n
, __locale_t __loc
) __THROW
;
181 extern size_t wcsxfrm_l (wchar_t *__s1
, __const
wchar_t *__s2
,
182 size_t __n
, __locale_t __loc
) __THROW
;
184 /* Duplicate S, returning an identical malloc'd string. */
185 extern wchar_t *wcsdup (__const
wchar_t *__s
) __THROW __attribute_malloc__
;
188 /* Find the first occurrence of WC in WCS. */
189 extern wchar_t *wcschr (__const
wchar_t *__wcs
, wchar_t __wc
)
190 __THROW __attribute_pure__
;
191 /* Find the last occurrence of WC in WCS. */
192 extern wchar_t *wcsrchr (__const
wchar_t *__wcs
, wchar_t __wc
)
193 __THROW __attribute_pure__
;
196 /* This function is similar to `wcschr'. But it returns a pointer to
197 the closing NUL wide character in case C is not found in S. */
198 extern wchar_t *wcschrnul (__const
wchar_t *__s
, wchar_t __wc
)
199 __THROW __attribute_pure__
;
202 /* Return the length of the initial segmet of WCS which
203 consists entirely of wide characters not in REJECT. */
204 extern size_t wcscspn (__const
wchar_t *__wcs
, __const
wchar_t *__reject
)
205 __THROW __attribute_pure__
;
206 /* Return the length of the initial segmet of WCS which
207 consists entirely of wide characters in ACCEPT. */
208 extern size_t wcsspn (__const
wchar_t *__wcs
, __const
wchar_t *__accept
)
209 __THROW __attribute_pure__
;
210 /* Find the first occurrence in WCS of any character in ACCEPT. */
211 extern wchar_t *wcspbrk (__const
wchar_t *__wcs
, __const
wchar_t *__accept
)
212 __THROW __attribute_pure__
;
213 /* Find the first occurrence of NEEDLE in HAYSTACK. */
214 extern wchar_t *wcsstr (__const
wchar_t *__haystack
, __const
wchar_t *__needle
)
215 __THROW __attribute_pure__
;
218 /* Another name for `wcsstr' from XPG4. */
219 extern wchar_t *wcswcs (__const
wchar_t *__haystack
, __const
wchar_t *__needle
)
220 __THROW __attribute_pure__
;
223 /* Divide WCS into tokens separated by characters in DELIM. */
224 extern wchar_t *wcstok (wchar_t *__restrict __s
,
225 __const
wchar_t *__restrict __delim
,
226 wchar_t **__restrict __ptr
) __THROW
;
228 /* Return the number of wide characters in S. */
229 extern size_t wcslen (__const
wchar_t *__s
) __THROW __attribute_pure__
;
232 /* Return the number of wide characters in S, but at most MAXLEN. */
233 extern size_t wcsnlen (__const
wchar_t *__s
, size_t __maxlen
)
234 __THROW __attribute_pure__
;
238 /* Search N wide characters of S for C. */
239 extern wchar_t *wmemchr (__const
wchar_t *__s
, wchar_t __c
, size_t __n
)
240 __THROW __attribute_pure__
;
242 /* Compare N wide characters of S1 and S2. */
243 extern int wmemcmp (__const
wchar_t *__restrict __s1
,
244 __const
wchar_t *__restrict __s2
, size_t __n
)
245 __THROW __attribute_pure__
;
247 /* Copy N wide characters of SRC to DEST. */
248 extern wchar_t *wmemcpy (wchar_t *__restrict __s1
,
249 __const
wchar_t *__restrict __s2
, size_t __n
) __THROW
;
251 /* Copy N wide characters of SRC to DEST, guaranteeing
252 correct behavior for overlapping strings. */
253 extern wchar_t *wmemmove (wchar_t *__s1
, __const
wchar_t *__s2
, size_t __n
)
256 /* Set N wide characters of S to C. */
257 extern wchar_t *wmemset (wchar_t *__s
, wchar_t __c
, size_t __n
) __THROW
;
260 /* Copy N wide characters of SRC to DEST and return pointer to following
262 extern wchar_t *wmempcpy (wchar_t *__restrict __s1
,
263 __const
wchar_t *__restrict __s2
, size_t __n
)
268 /* Determine whether C constitutes a valid (one-byte) multibyte
270 extern wint_t btowc (int __c
) __THROW
;
272 /* Determine whether C corresponds to a member of the extended
273 character set whose multibyte representation is a single byte. */
274 extern int wctob (wint_t __c
) __THROW
;
276 /* Determine whether PS points to an object representing the initial
278 extern int mbsinit (__const
mbstate_t *__ps
) __THROW __attribute_pure__
;
280 /* Write wide character representation of multibyte character pointed
282 extern size_t mbrtowc (wchar_t *__restrict __pwc
,
283 __const
char *__restrict __s
, size_t __n
,
284 mbstate_t *__p
) __THROW
;
286 /* Write multibyte representation of wide character WC to S. */
287 extern size_t wcrtomb (char *__restrict __s
, wchar_t __wc
,
288 mbstate_t *__restrict __ps
) __THROW
;
290 /* Return number of bytes in multibyte character pointed to by S. */
291 extern size_t __mbrlen (__const
char *__restrict __s
, size_t __n
,
292 mbstate_t *__restrict __ps
) __THROW
;
293 extern size_t mbrlen (__const
char *__restrict __s
, size_t __n
,
294 mbstate_t *__restrict __ps
) __THROW
;
296 #ifdef __USE_EXTERN_INLINES
297 /* Define inline function as optimization. */
298 extern __inline
size_t mbrlen (__const
char *__restrict __s
, size_t __n
,
299 mbstate_t *__restrict __ps
) __THROW
300 { return (__ps
!= NULL
301 ? mbrtowc (NULL
, __s
, __n
, __ps
) : __mbrlen (__s
, __n
, NULL
)); }
304 /* Write wide character representation of multibyte character string
306 extern size_t mbsrtowcs (wchar_t *__restrict __dst
,
307 __const
char **__restrict __src
, size_t __len
,
308 mbstate_t *__restrict __ps
) __THROW
;
310 /* Write multibyte character representation of wide character string
312 extern size_t wcsrtombs (char *__restrict __dst
,
313 __const
wchar_t **__restrict __src
, size_t __len
,
314 mbstate_t *__restrict __ps
) __THROW
;
318 /* Write wide character representation of at most NMC bytes of the
319 multibyte character string SRC to DST. */
320 extern size_t mbsnrtowcs (wchar_t *__restrict __dst
,
321 __const
char **__restrict __src
, size_t __nmc
,
322 size_t __len
, mbstate_t *__restrict __ps
) __THROW
;
324 /* Write multibyte character representation of at most NWC characters
325 from the wide character string SRC to DST. */
326 extern size_t wcsnrtombs (char *__restrict __dst
,
327 __const
wchar_t **__restrict __src
,
328 size_t __nwc
, size_t __len
,
329 mbstate_t *__restrict __ps
) __THROW
;
333 /* The following functions are extensions found in X/Open CAE. */
335 /* Determine number of column positions required for C. */
336 extern int wcwidth (wchar_t __c
) __THROW
;
338 /* Determine number of column positions required for first N wide
339 characters (or fewer if S ends before this) in S. */
340 extern int wcswidth (__const
wchar_t *__s
, size_t __n
) __THROW
;
341 #endif /* Use X/Open. */
344 /* Convert initial portion of the wide string NPTR to `double'
346 extern double wcstod (__const
wchar_t *__restrict __nptr
,
347 wchar_t **__restrict __endptr
) __THROW
;
350 /* Likewise for `float' and `long double' sizes of floating-point numbers. */
351 extern float wcstof (__const
wchar_t *__restrict __nptr
,
352 wchar_t **__restrict __endptr
) __THROW
;
353 extern long double wcstold (__const
wchar_t *__restrict __nptr
,
354 wchar_t **__restrict __endptr
) __THROW
;
358 /* Convert initial portion of wide string NPTR to `long int'
360 extern long int wcstol (__const
wchar_t *__restrict __nptr
,
361 wchar_t **__restrict __endptr
, int __base
) __THROW
;
363 /* Convert initial portion of wide string NPTR to `unsigned long int'
365 extern unsigned long int wcstoul (__const
wchar_t *__restrict __nptr
,
366 wchar_t **__restrict __endptr
, int __base
)
369 #if defined __GNUC__ && defined __USE_GNU
370 /* Convert initial portion of wide string NPTR to `long int'
373 extern long long int wcstoq (__const
wchar_t *__restrict __nptr
,
374 wchar_t **__restrict __endptr
, int __base
)
377 /* Convert initial portion of wide string NPTR to `unsigned long long int'
380 extern unsigned long long int wcstouq (__const
wchar_t *__restrict __nptr
,
381 wchar_t **__restrict __endptr
,
383 #endif /* GCC and use GNU. */
385 #if defined __USE_ISOC99 || (defined __GNUC__ && defined __USE_GNU)
386 /* Convert initial portion of wide string NPTR to `long int'
389 extern long long int wcstoll (__const
wchar_t *__restrict __nptr
,
390 wchar_t **__restrict __endptr
, int __base
)
393 /* Convert initial portion of wide string NPTR to `unsigned long long int'
396 extern unsigned long long int wcstoull (__const
wchar_t *__restrict __nptr
,
397 wchar_t **__restrict __endptr
,
399 #endif /* ISO C99 or GCC and GNU. */
402 /* The concept of one static locale per category is not very well
403 thought out. Many applications will need to process its data using
404 information from several different locales. Another application is
405 the implementation of the internationalization handling in the
406 upcoming ISO C++ standard library. To support this another set of
407 the functions using locale data exist which have an additional
410 Attention: all these functions are *not* standardized in any form.
411 This is a proof-of-concept implementation. */
413 /* Structure for reentrant locale using functions. This is an
414 (almost) opaque type for the user level programs. */
415 # include <xlocale.h>
417 /* Special versions of the functions above which take the locale to
418 use as an additional parameter. */
419 extern long int __wcstol_l (__const
wchar_t *__restrict __nptr
,
420 wchar_t **__restrict __endptr
, int __base
,
421 __locale_t __loc
) __THROW
;
422 extern long int wcstol_l (__const
wchar_t *__restrict __nptr
,
423 wchar_t **__restrict __endptr
, int __base
,
424 __locale_t __loc
) __THROW
;
426 extern unsigned long int __wcstoul_l (__const
wchar_t *__restrict __nptr
,
427 wchar_t **__restrict __endptr
,
428 int __base
, __locale_t __loc
) __THROW
;
429 extern unsigned long int wcstoul_l (__const
wchar_t *__restrict __nptr
,
430 wchar_t **__restrict __endptr
,
431 int __base
, __locale_t __loc
) __THROW
;
434 extern long long int __wcstoll_l (__const
wchar_t *__restrict __nptr
,
435 wchar_t **__restrict __endptr
,
436 int __base
, __locale_t __loc
) __THROW
;
438 extern long long int wcstoll_l (__const
wchar_t *__restrict __nptr
,
439 wchar_t **__restrict __endptr
,
440 int __base
, __locale_t __loc
) __THROW
;
443 extern unsigned long long int __wcstoull_l (__const
wchar_t *__restrict __nptr
,
444 wchar_t **__restrict __endptr
,
445 int __base
, __locale_t __loc
)
448 extern unsigned long long int wcstoull_l (__const
wchar_t *__restrict __nptr
,
449 wchar_t **__restrict __endptr
,
450 int __base
, __locale_t __loc
)
453 extern double __wcstod_l (__const
wchar_t *__restrict __nptr
,
454 wchar_t **__restrict __endptr
, __locale_t __loc
)
456 extern double wcstod_l (__const
wchar_t *__restrict __nptr
,
457 wchar_t **__restrict __endptr
, __locale_t __loc
)
460 extern float __wcstof_l (__const
wchar_t *__restrict __nptr
,
461 wchar_t **__restrict __endptr
, __locale_t __loc
)
463 extern float wcstof_l (__const
wchar_t *__restrict __nptr
,
464 wchar_t **__restrict __endptr
, __locale_t __loc
)
467 extern long double __wcstold_l (__const
wchar_t *__restrict __nptr
,
468 wchar_t **__restrict __endptr
,
469 __locale_t __loc
) __THROW
;
470 extern long double wcstold_l (__const
wchar_t *__restrict __nptr
,
471 wchar_t **__restrict __endptr
,
472 __locale_t __loc
) __THROW
;
476 /* The internal entry points for `wcstoX' take an extra flag argument
477 saying whether or not to parse locale-dependent number grouping. */
478 extern double __wcstod_internal (__const
wchar_t *__restrict __nptr
,
479 wchar_t **__restrict __endptr
, int __group
)
481 extern float __wcstof_internal (__const
wchar_t *__restrict __nptr
,
482 wchar_t **__restrict __endptr
, int __group
)
484 extern long double __wcstold_internal (__const
wchar_t *__restrict __nptr
,
485 wchar_t **__restrict __endptr
,
486 int __group
) __THROW
;
488 #ifndef __wcstol_internal_defined
489 extern long int __wcstol_internal (__const
wchar_t *__restrict __nptr
,
490 wchar_t **__restrict __endptr
,
491 int __base
, int __group
) __THROW
;
492 # define __wcstol_internal_defined 1
494 #ifndef __wcstoul_internal_defined
495 extern unsigned long int __wcstoul_internal (__const
wchar_t *__restrict __npt
,
496 wchar_t **__restrict __endptr
,
497 int __base
, int __group
) __THROW
;
498 # define __wcstoul_internal_defined 1
500 #ifndef __wcstoll_internal_defined
502 extern long long int __wcstoll_internal (__const
wchar_t *__restrict __nptr
,
503 wchar_t **__restrict __endptr
,
504 int __base
, int __group
) __THROW
;
505 # define __wcstoll_internal_defined 1
507 #ifndef __wcstoull_internal_defined
509 extern unsigned long long int __wcstoull_internal (__const
wchar_t *
514 int __group
) __THROW
;
515 # define __wcstoull_internal_defined 1
519 #if defined __OPTIMIZE__ && __GNUC__ >= 2
520 /* Define inline functions which call the internal entry points. */
522 extern __inline
double wcstod (__const
wchar_t *__restrict __nptr
,
523 wchar_t **__restrict __endptr
) __THROW
524 { return __wcstod_internal (__nptr
, __endptr
, 0); }
525 extern __inline
long int wcstol (__const
wchar_t *__restrict __nptr
,
526 wchar_t **__restrict __endptr
,
528 { return __wcstol_internal (__nptr
, __endptr
, __base
, 0); }
529 extern __inline
unsigned long int wcstoul (__const
wchar_t *__restrict __nptr
,
530 wchar_t **__restrict __endptr
,
532 { return __wcstoul_internal (__nptr
, __endptr
, __base
, 0); }
535 extern __inline
float wcstof (__const
wchar_t *__restrict __nptr
,
536 wchar_t **__restrict __endptr
) __THROW
537 { return __wcstof_internal (__nptr
, __endptr
, 0); }
538 extern __inline
long double wcstold (__const
wchar_t *__restrict __nptr
,
539 wchar_t **__restrict __endptr
) __THROW
540 { return __wcstold_internal (__nptr
, __endptr
, 0); }
544 extern __inline
long long int wcstoq (__const
wchar_t *__restrict __nptr
,
545 wchar_t **__restrict __endptr
,
547 { return __wcstoll_internal (__nptr
, __endptr
, __base
, 0); }
549 extern __inline
unsigned long long int wcstouq (__const
wchar_t *
551 wchar_t **__restrict __endptr
,
553 { return __wcstoull_internal (__nptr
, __endptr
, __base
, 0); }
554 # endif /* Use GNU. */
555 #endif /* Optimizing GCC >=2. */
559 /* Copy SRC to DEST, returning the address of the terminating L'\0' in
561 extern wchar_t *wcpcpy (wchar_t *__dest
, __const
wchar_t *__src
) __THROW
;
563 /* Copy no more than N characters of SRC to DEST, returning the address of
564 the last character written into DEST. */
565 extern wchar_t *wcpncpy (wchar_t *__dest
, __const
wchar_t *__src
, size_t __n
)
570 /* Wide character I/O functions. */
571 #if defined __USE_ISOC99 || defined __USE_UNIX98
573 /* Select orientation for stream. */
574 extern int fwide (__FILE
*__fp
, int __mode
) __THROW
;
577 /* Write formatted output to STREAM. */
578 extern int fwprintf (__FILE
*__restrict __stream
,
579 __const
wchar_t *__restrict __format
, ...)
580 __THROW
/* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
581 /* Write formatted output to stdout. */
582 extern int wprintf (__const
wchar_t *__restrict __format
, ...)
583 __THROW
/* __attribute__ ((__format__ (__wprintf__, 1, 2))) */;
584 /* Write formatted output of at most N characters to S. */
585 extern int swprintf (wchar_t *__restrict __s
, size_t __n
,
586 __const
wchar_t *__restrict __format
, ...)
587 __THROW
/* __attribute__ ((__format__ (__wprintf__, 3, 4))) */;
589 /* Write formatted output to S from argument list ARG. */
590 extern int vfwprintf (__FILE
*__restrict __s
,
591 __const
wchar_t *__restrict __format
,
592 __gnuc_va_list __arg
)
593 __THROW
/* __attribute__ ((__format__ (__wprintf__, 2, 0))) */;
594 /* Write formatted output to stdout from argument list ARG. */
595 extern int vwprintf (__const
wchar_t *__restrict __format
,
596 __gnuc_va_list __arg
)
597 __THROW
/* __attribute__ ((__format__ (__wprintf__, 1, 0))) */;
598 /* Write formatted output of at most N character to S from argument
600 extern int vswprintf (wchar_t *__restrict __s
, size_t __n
,
601 __const
wchar_t *__restrict __format
,
602 __gnuc_va_list __arg
)
603 __THROW
/* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
606 /* Read formatted input from STREAM. */
607 extern int fwscanf (__FILE
*__restrict __stream
,
608 __const
wchar_t *__restrict __format
, ...)
609 __THROW
/* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
610 /* Read formatted input from stdin. */
611 extern int wscanf (__const
wchar_t *__restrict __format
, ...)
612 __THROW
/* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
613 /* Read formatted input from S. */
614 extern int swscanf (__const
wchar_t *__restrict __s
,
615 __const
wchar_t *__restrict __format
, ...)
616 __THROW
/* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
617 #endif /* Use ISO C99 and Unix98. */
620 /* Read formatted input from S into argument list ARG. */
621 extern int vfwscanf (__FILE
*__restrict __s
,
622 __const
wchar_t *__restrict __format
,
623 __gnuc_va_list __arg
)
624 __THROW
/* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
625 /* Read formatted input from stdin into argument list ARG. */
626 extern int vwscanf (__const
wchar_t *__restrict __format
,
627 __gnuc_va_list __arg
)
628 __THROW
/* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
629 /* Read formatted input from S into argument list ARG. */
630 extern int vswscanf (__const
wchar_t *__restrict __s
,
631 __const
wchar_t *__restrict __format
,
632 __gnuc_va_list __arg
)
633 __THROW
/* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
634 #endif /* Use ISO C99. */
637 /* Read a character from STREAM. */
638 extern wint_t fgetwc (__FILE
*__stream
) __THROW
;
639 extern wint_t getwc (__FILE
*__stream
) __THROW
;
641 /* Read a character from stdin. */
642 extern wint_t getwchar (void) __THROW
;
645 /* Write a character to STREAM. */
646 extern wint_t fputwc (wchar_t __wc
, __FILE
*__stream
) __THROW
;
647 extern wint_t putwc (wchar_t __wc
, __FILE
*__stream
) __THROW
;
649 /* Write a character to stdout. */
650 extern wint_t putwchar (wchar_t __wc
) __THROW
;
653 /* Get a newline-terminated wide character string of finite length
655 extern wchar_t *fgetws (wchar_t *__restrict __ws
, int __n
,
656 __FILE
*__restrict __stream
) __THROW
;
658 /* Write a string to STREAM. */
659 extern int fputws (__const
wchar_t *__restrict __ws
,
660 __FILE
*__restrict __stream
) __THROW
;
663 /* Push a character back onto the input buffer of STREAM. */
664 extern wint_t ungetwc (wint_t __wc
, __FILE
*__stream
) __THROW
;
668 /* These are defined to be equivalent to the `char' functions defined
670 extern wint_t getwc_unlocked (__FILE
*__stream
) __THROW
;
671 extern wint_t getwchar_unlocked (void) __THROW
;
673 /* This is the wide character version of a GNU extension. */
674 extern wint_t fgetwc_unlocked (__FILE
*__stream
) __THROW
;
676 /* Faster version when locking is not necessary. */
677 extern wint_t fputwc_unlocked (wchar_t __wc
, __FILE
*__stream
) __THROW
;
679 /* These are defined to be equivalent to the `char' functions defined
681 extern wint_t putwc_unlocked (wchar_t __wc
, __FILE
*__stream
) __THROW
;
682 extern wint_t putwchar_unlocked (wchar_t __wc
) __THROW
;
685 /* This function does the same as `fgetws' but does not lock the stream. */
686 extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws
, int __n
,
687 __FILE
*__restrict __stream
) __THROW
;
689 /* This function does the same as `fputws' but does not lock the stream. */
690 extern int fputws_unlocked (__const
wchar_t *__restrict __ws
,
691 __FILE
*__restrict __stream
) __THROW
;
695 /* Format TP into S according to FORMAT.
696 Write no more than MAXSIZE wide characters and return the number
697 of wide characters written, or 0 if it would exceed MAXSIZE. */
698 extern size_t wcsftime (wchar_t *__restrict __s
, size_t __maxsize
,
699 __const
wchar_t *__restrict __format
,
700 __const
struct tm
*__restrict __tp
) __THROW
;
702 /* The X/Open standard demands that most of the functions defined in
703 the <wctype.h> header must also appear here. This is probably
704 because some X/Open members wrote their implementation before the
705 ISO C standard was published and introduced the better solution.
706 We have to provide these definitions for compliance reasons but we
707 do this nonsense only if really necessary. */
708 #if defined __USE_UNIX98 && !defined __USE_GNU
709 # define __need_iswxxx
715 #endif /* _WCHAR_H defined */