1 /* Copyright (C) 1995-2002, 2003 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>
31 #ifndef __UCLIBC_HAS_WCHAR__
32 #error Attempted to include wchar.h when uClibc built without wide char support.
36 /* Get FILE definition. */
37 # define __need___FILE
42 /* Get va_list definition. */
43 # define __need___va_list
46 /* Get size_t, wchar_t, wint_t and NULL from <stddef.h>. */
47 # define __need_size_t
48 # define __need_wchar_t
54 #include <bits/wchar.h>
56 /* We try to get wint_t from <stddef.h>, but not all GCC versions define it
57 there. So define it ourselves if it remains undefined. */
59 /* Integral type unchanged by default argument promotions that can
60 hold any value corresponding to members of the extended character
61 set, as well as at least one value that does not correspond to any
62 member of the extended character set. */
64 typedef unsigned int wint_t;
66 /* Work around problems with the <stddef.h> file which doesn't put
67 wint_t in the std namespace. */
68 # if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \
69 && defined __WINT_TYPE__
71 typedef __WINT_TYPE__ wint_t;
77 #ifndef __mbstate_t_defined
78 # define __mbstate_t_defined 1
79 /* Conversion state information. */
94 } __value; /* Value so far. */
98 #undef __need_mbstate_t
101 /* The rest of the file is only used if used if __need_mbstate_t is not
105 __BEGIN_NAMESPACE_C99
107 typedef __mbstate_t mbstate_t;
110 __USING_NAMESPACE_C99(mbstate_t)
114 /* These constants might also be defined in <inttypes.h>. */
115 # define WCHAR_MIN __WCHAR_MIN
116 # define WCHAR_MAX __WCHAR_MAX
120 # define WEOF (0xffffffffu)
123 /* For XPG4 compliance we have to define the stuff from <wctype.h> here
125 #if defined __USE_XOPEN && !defined __USE_UNIX98
132 __BEGIN_NAMESPACE_STD
133 /* This incomplete type is defined in <time.h> but needed here because
136 /* XXX We have to clean this up at some point. Since tm is in the std
137 namespace but wcsftime is in __c99 the type wouldn't be found
138 without inserting it in the global namespace. */
139 __USING_NAMESPACE_STD(tm)
143 __BEGIN_NAMESPACE_C99
144 /* Copy SRC to DEST. */
145 extern wchar_t *wcscpy (wchar_t *__restrict __dest,
146 __const wchar_t *__restrict __src) __THROW;
147 /* Copy no more than N wide-characters of SRC to DEST. */
148 extern wchar_t *wcsncpy (wchar_t *__restrict __dest,
149 __const wchar_t *__restrict __src, size_t __n)
152 /* Append SRC onto DEST. */
153 extern wchar_t *wcscat (wchar_t *__restrict __dest,
154 __const wchar_t *__restrict __src) __THROW;
155 libc_hidden_proto(wcscat)
156 /* Append no more than N wide-characters of SRC onto DEST. */
157 extern wchar_t *wcsncat (wchar_t *__restrict __dest,
158 __const wchar_t *__restrict __src, size_t __n)
161 /* Compare S1 and S2. */
162 extern int wcscmp (__const wchar_t *__s1, __const wchar_t *__s2)
163 __THROW __attribute_pure__;
164 libc_hidden_proto(wcscmp)
165 /* Compare N wide-characters of S1 and S2. */
166 extern int wcsncmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n)
167 __THROW __attribute_pure__;
171 /* Compare S1 and S2, ignoring case. */
172 extern int wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2) __THROW;
174 /* Compare no more than N chars of S1 and S2, ignoring case. */
175 extern int wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2,
178 #ifdef __UCLIBC_HAS_XLOCALE__
179 /* Similar to the two functions above but take the information from
180 the provided locale and not the global locale. */
181 # include <xlocale.h>
183 extern int wcscasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
184 __locale_t __loc) __THROW;
185 libc_hidden_proto(wcscasecmp_l)
187 extern int wcsncasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
188 size_t __n, __locale_t __loc) __THROW;
189 libc_hidden_proto(wcsncasecmp_l)
190 #endif /* __UCLIBC_HAS_XLOCALE__ */
193 __BEGIN_NAMESPACE_C99
194 /* Compare S1 and S2, both interpreted as appropriate to the
195 LC_COLLATE category of the current locale. */
196 extern int wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) __THROW;
197 libc_hidden_proto(wcscoll)
198 /* Transform S2 into array pointed to by S1 such that if wcscmp is
199 applied to two transformed strings the result is the as applying
200 `wcscoll' to the original strings. */
201 extern size_t wcsxfrm (wchar_t *__restrict __s1,
202 __const wchar_t *__restrict __s2, size_t __n) __THROW;
206 #ifdef __UCLIBC_HAS_XLOCALE__
207 /* Similar to the two functions above but take the information from
208 the provided locale and not the global locale. */
210 /* Compare S1 and S2, both interpreted as appropriate to the
211 LC_COLLATE category of the given locale. */
212 extern int wcscoll_l (__const wchar_t *__s1, __const wchar_t *__s2,
213 __locale_t __loc) __THROW;
214 libc_hidden_proto(wcscoll_l)
216 /* Transform S2 into array pointed to by S1 such that if wcscmp is
217 applied to two transformed strings the result is the as applying
218 `wcscoll' to the original strings. */
219 extern size_t wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2,
220 size_t __n, __locale_t __loc) __THROW;
221 libc_hidden_proto(wcsxfrm_l)
223 #endif /* __UCLIBC_HAS_XLOCALE__ */
225 /* Duplicate S, returning an identical malloc'd string. */
226 extern wchar_t *wcsdup (__const wchar_t *__s) __THROW __attribute_malloc__;
229 __BEGIN_NAMESPACE_C99
230 /* Find the first occurrence of WC in WCS. */
231 extern wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc)
232 __THROW __attribute_pure__;
233 /* Find the last occurrence of WC in WCS. */
234 extern wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc)
235 __THROW __attribute_pure__;
239 /* This function is similar to `wcschr'. But it returns a pointer to
240 the closing NUL wide character in case C is not found in S. */
241 extern wchar_t *wcschrnul (__const wchar_t *__s, wchar_t __wc)
242 __THROW __attribute_pure__;
245 __BEGIN_NAMESPACE_C99
246 /* Return the length of the initial segmet of WCS which
247 consists entirely of wide characters not in REJECT. */
248 extern size_t wcscspn (__const wchar_t *__wcs, __const wchar_t *__reject)
249 __THROW __attribute_pure__;
250 /* Return the length of the initial segmet of WCS which
251 consists entirely of wide characters in ACCEPT. */
252 extern size_t wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept)
253 __THROW __attribute_pure__;
254 libc_hidden_proto(wcsspn)
255 /* Find the first occurrence in WCS of any character in ACCEPT. */
256 extern wchar_t *wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept)
257 __THROW __attribute_pure__;
258 libc_hidden_proto(wcspbrk)
259 /* Find the first occurrence of NEEDLE in HAYSTACK. */
260 extern wchar_t *wcsstr (__const wchar_t *__haystack, __const wchar_t *__needle)
261 __THROW __attribute_pure__;
263 /* Divide WCS into tokens separated by characters in DELIM. */
264 extern wchar_t *wcstok (wchar_t *__restrict __s,
265 __const wchar_t *__restrict __delim,
266 wchar_t **__restrict __ptr) __THROW;
268 /* Return the number of wide characters in S. */
269 extern size_t wcslen (__const wchar_t *__s) __THROW __attribute_pure__;
270 libc_hidden_proto(wcslen)
273 #if defined __USE_XOPEN && defined __UCLIBC_SUSV3_LEGACY__
274 /* Another name for `wcsstr' from XPG4. */
275 extern wchar_t *wcswcs (__const wchar_t *__haystack, __const wchar_t *__needle)
276 __THROW __attribute_pure__;
280 /* Return the number of wide characters in S, but at most MAXLEN. */
281 extern size_t wcsnlen (__const wchar_t *__s, size_t __maxlen)
282 __THROW __attribute_pure__;
283 libc_hidden_proto(wcsnlen)
287 __BEGIN_NAMESPACE_C99
288 /* Search N wide characters of S for C. */
289 extern wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n)
290 __THROW __attribute_pure__;
291 libc_hidden_proto(wmemchr)
293 /* Compare N wide characters of S1 and S2. */
294 extern int wmemcmp (__const wchar_t *__restrict __s1,
295 __const wchar_t *__restrict __s2, size_t __n)
296 __THROW __attribute_pure__;
298 /* Copy N wide characters of SRC to DEST. */
299 extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
300 __const wchar_t *__restrict __s2, size_t __n) __THROW;
301 libc_hidden_proto(wmemcpy)
303 /* Copy N wide characters of SRC to DEST, guaranteeing
304 correct behavior for overlapping strings. */
305 extern wchar_t *wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n)
308 /* Set N wide characters of S to C. */
309 extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
313 /* Copy N wide characters of SRC to DEST and return pointer to following
315 extern wchar_t *wmempcpy (wchar_t *__restrict __s1,
316 __const wchar_t *__restrict __s2, size_t __n)
318 libc_hidden_proto(wmempcpy)
322 __BEGIN_NAMESPACE_C99
323 /* Determine whether C constitutes a valid (one-byte) multibyte
325 extern wint_t btowc (int __c) __THROW;
326 libc_hidden_proto(btowc)
328 /* Determine whether C corresponds to a member of the extended
329 character set whose multibyte representation is a single byte. */
330 extern int wctob (wint_t __c) __THROW;
332 /* Determine whether PS points to an object representing the initial
334 extern int mbsinit (__const mbstate_t *__ps) __THROW __attribute_pure__;
335 libc_hidden_proto(mbsinit)
337 /* Write wide character representation of multibyte character pointed
339 extern size_t mbrtowc (wchar_t *__restrict __pwc,
340 __const char *__restrict __s, size_t __n,
341 mbstate_t *__p) __THROW;
342 libc_hidden_proto(mbrtowc)
344 /* Write multibyte representation of wide character WC to S. */
345 extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
346 mbstate_t *__restrict __ps) __THROW;
347 libc_hidden_proto(wcrtomb)
349 /* Return number of bytes in multibyte character pointed to by S. */
350 #if 0 /* uClibc: disabled */
351 extern size_t __mbrlen (__const char *__restrict __s, size_t __n,
352 mbstate_t *__restrict __ps) __THROW;
354 extern size_t mbrlen (__const char *__restrict __s, size_t __n,
355 mbstate_t *__restrict __ps) __THROW;
356 libc_hidden_proto(mbrlen)
358 /* Write wide character representation of multibyte character string
360 extern size_t mbsrtowcs (wchar_t *__restrict __dst,
361 __const char **__restrict __src, size_t __len,
362 mbstate_t *__restrict __ps) __THROW;
363 libc_hidden_proto(mbsrtowcs)
365 /* Write multibyte character representation of wide character string
367 extern size_t wcsrtombs (char *__restrict __dst,
368 __const wchar_t **__restrict __src, size_t __len,
369 mbstate_t *__restrict __ps) __THROW;
370 libc_hidden_proto(wcsrtombs)
375 /* Write wide character representation of at most NMC bytes of the
376 multibyte character string SRC to DST. */
377 extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
378 __const char **__restrict __src, size_t __nmc,
379 size_t __len, mbstate_t *__restrict __ps) __THROW;
380 libc_hidden_proto(mbsnrtowcs)
382 /* Write multibyte character representation of at most NWC characters
383 from the wide character string SRC to DST. */
384 extern size_t wcsnrtombs (char *__restrict __dst,
385 __const wchar_t **__restrict __src,
386 size_t __nwc, size_t __len,
387 mbstate_t *__restrict __ps) __THROW;
388 libc_hidden_proto(wcsnrtombs)
392 /* The following functions are extensions found in X/Open CAE. */
394 /* Determine number of column positions required for C. */
395 extern int wcwidth (wchar_t __c) __THROW;
397 /* Determine number of column positions required for first N wide
398 characters (or fewer if S ends before this) in S. */
399 extern int wcswidth (__const wchar_t *__s, size_t __n) __THROW;
400 libc_hidden_proto(wcswidth)
401 #endif /* Use X/Open. */
404 __BEGIN_NAMESPACE_C99
405 #ifdef __UCLIBC_HAS_FLOATS__
406 /* Convert initial portion of the wide string NPTR to `double'
408 extern double wcstod (__const wchar_t *__restrict __nptr,
409 wchar_t **__restrict __endptr) __THROW;
412 /* Likewise for `float' and `long double' sizes of floating-point numbers. */
413 extern float wcstof (__const wchar_t *__restrict __nptr,
414 wchar_t **__restrict __endptr) __THROW;
415 extern long double wcstold (__const wchar_t *__restrict __nptr,
416 wchar_t **__restrict __endptr) __THROW;
418 #endif /* __UCLIBC_HAS_FLOATS__ */
421 /* Convert initial portion of wide string NPTR to `long int'
423 extern long int wcstol (__const wchar_t *__restrict __nptr,
424 wchar_t **__restrict __endptr, int __base) __THROW;
426 /* Convert initial portion of wide string NPTR to `unsigned long int'
428 extern unsigned long int wcstoul (__const wchar_t *__restrict __nptr,
429 wchar_t **__restrict __endptr, int __base)
432 #if defined __USE_ISOC99 || (defined __GNUC__ && defined __USE_GNU)
433 /* Convert initial portion of wide string NPTR to `long int'
436 extern long long int wcstoll (__const wchar_t *__restrict __nptr,
437 wchar_t **__restrict __endptr, int __base)
440 /* Convert initial portion of wide string NPTR to `unsigned long long int'
443 extern unsigned long long int wcstoull (__const wchar_t *__restrict __nptr,
444 wchar_t **__restrict __endptr,
446 #endif /* ISO C99 or GCC and GNU. */
449 #if defined __GNUC__ && defined __USE_GNU
450 /* Convert initial portion of wide string NPTR to `long int'
453 extern long long int wcstoq (__const wchar_t *__restrict __nptr,
454 wchar_t **__restrict __endptr, int __base)
457 /* Convert initial portion of wide string NPTR to `unsigned long long int'
460 extern unsigned long long int wcstouq (__const wchar_t *__restrict __nptr,
461 wchar_t **__restrict __endptr,
463 #endif /* GCC and use GNU. */
466 #ifdef __UCLIBC_HAS_XLOCALE__
467 /* The concept of one static locale per category is not very well
468 thought out. Many applications will need to process its data using
469 information from several different locales. Another application is
470 the implementation of the internationalization handling in the
471 upcoming ISO C++ standard library. To support this another set of
472 the functions using locale data exist which have an additional
475 Attention: all these functions are *not* standardized in any form.
476 This is a proof-of-concept implementation. */
478 /* Structure for reentrant locale using functions. This is an
479 (almost) opaque type for the user level programs. */
480 # include <xlocale.h>
482 /* Special versions of the functions above which take the locale to
483 use as an additional parameter. */
484 extern long int wcstol_l (__const wchar_t *__restrict __nptr,
485 wchar_t **__restrict __endptr, int __base,
486 __locale_t __loc) __THROW;
488 extern unsigned long int wcstoul_l (__const wchar_t *__restrict __nptr,
489 wchar_t **__restrict __endptr,
490 int __base, __locale_t __loc) __THROW;
493 extern long long int wcstoll_l (__const wchar_t *__restrict __nptr,
494 wchar_t **__restrict __endptr,
495 int __base, __locale_t __loc) __THROW;
498 extern unsigned long long int wcstoull_l (__const wchar_t *__restrict __nptr,
499 wchar_t **__restrict __endptr,
500 int __base, __locale_t __loc)
503 #ifdef __UCLIBC_HAS_FLOATS__
504 extern double wcstod_l (__const wchar_t *__restrict __nptr,
505 wchar_t **__restrict __endptr, __locale_t __loc)
508 extern float wcstof_l (__const wchar_t *__restrict __nptr,
509 wchar_t **__restrict __endptr, __locale_t __loc)
512 extern long double wcstold_l (__const wchar_t *__restrict __nptr,
513 wchar_t **__restrict __endptr,
514 __locale_t __loc) __THROW;
515 #endif /* __UCLIBC_HAS_FLOATS__ */
516 #endif /* __UCLIBC_HAS_XLOCALE__ */
521 /* Copy SRC to DEST, returning the address of the terminating L'\0' in
523 extern wchar_t *wcpcpy (wchar_t *__dest, __const wchar_t *__src) __THROW;
525 /* Copy no more than N characters of SRC to DEST, returning the address of
526 the last character written into DEST. */
527 extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n)
532 /* Wide character I/O functions. */
533 #if defined __USE_ISOC99 || defined __USE_UNIX98
534 __BEGIN_NAMESPACE_C99
536 /* Select orientation for stream. */
537 extern int fwide (__FILE *__fp, int __mode) __THROW;
540 /* Write formatted output to STREAM.
542 This function is a possible cancellation point and therefore not
543 marked with __THROW. */
544 extern int fwprintf (__FILE *__restrict __stream,
545 __const wchar_t *__restrict __format, ...)
546 /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
547 /* Write formatted output to stdout.
549 This function is a possible cancellation point and therefore not
550 marked with __THROW. */
551 extern int wprintf (__const wchar_t *__restrict __format, ...)
552 /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */;
553 /* Write formatted output of at most N characters to S. */
554 extern int swprintf (wchar_t *__restrict __s, size_t __n,
555 __const wchar_t *__restrict __format, ...)
556 __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */;
558 /* Write formatted output to S from argument list ARG.
560 This function is a possible cancellation point and therefore not
561 marked with __THROW. */
562 extern int vfwprintf (__FILE *__restrict __s,
563 __const wchar_t *__restrict __format,
564 __gnuc_va_list __arg)
565 /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */;
566 libc_hidden_proto(vfwprintf)
567 /* Write formatted output to stdout from argument list ARG.
569 This function is a possible cancellation point and therefore not
570 marked with __THROW. */
571 extern int vwprintf (__const wchar_t *__restrict __format,
572 __gnuc_va_list __arg)
573 /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */;
574 /* Write formatted output of at most N character to S from argument
576 extern int vswprintf (wchar_t *__restrict __s, size_t __n,
577 __const wchar_t *__restrict __format,
578 __gnuc_va_list __arg)
579 __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
580 libc_hidden_proto(vswprintf)
583 /* Read formatted input from STREAM.
585 This function is a possible cancellation point and therefore not
586 marked with __THROW. */
587 extern int fwscanf (__FILE *__restrict __stream,
588 __const wchar_t *__restrict __format, ...)
589 /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
590 /* Read formatted input from stdin.
592 This function is a possible cancellation point and therefore not
593 marked with __THROW. */
594 extern int wscanf (__const wchar_t *__restrict __format, ...)
595 /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
596 /* Read formatted input from S. */
597 extern int swscanf (__const wchar_t *__restrict __s,
598 __const wchar_t *__restrict __format, ...)
599 __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
602 #endif /* Use ISO C99 and Unix98. */
605 __BEGIN_NAMESPACE_C99
607 /* Read formatted input from S into argument list ARG.
609 This function is a possible cancellation point and therefore not
610 marked with __THROW. */
611 extern int vfwscanf (__FILE *__restrict __s,
612 __const wchar_t *__restrict __format,
613 __gnuc_va_list __arg)
614 /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
615 libc_hidden_proto(vfwscanf)
616 /* Read formatted input from stdin into argument list ARG.
618 This function is a possible cancellation point and therefore not
619 marked with __THROW. */
620 extern int vwscanf (__const wchar_t *__restrict __format,
621 __gnuc_va_list __arg)
622 /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
623 /* Read formatted input from S into argument list ARG. */
624 extern int vswscanf (__const wchar_t *__restrict __s,
625 __const wchar_t *__restrict __format,
626 __gnuc_va_list __arg)
627 __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
628 libc_hidden_proto(vswscanf)
631 #endif /* Use ISO C99. */
634 __BEGIN_NAMESPACE_C99
635 /* Read a character from STREAM.
637 These functions are possible cancellation points and therefore not
638 marked with __THROW. */
639 extern wint_t fgetwc (__FILE *__stream);
640 libc_hidden_proto(fgetwc)
641 extern wint_t getwc (__FILE *__stream);
643 /* Read a character from stdin.
645 This function is a possible cancellation point and therefore not
646 marked with __THROW. */
647 extern wint_t getwchar (void);
650 /* Write a character to STREAM.
652 These functions are possible cancellation points and therefore not
653 marked with __THROW. */
654 extern wint_t fputwc (wchar_t __wc, __FILE *__stream);
655 extern wint_t putwc (wchar_t __wc, __FILE *__stream);
657 /* Write a character to stdout.
659 This function is a possible cancellation points and therefore not
660 marked with __THROW. */
661 extern wint_t putwchar (wchar_t __wc);
664 /* Get a newline-terminated wide character string of finite length
667 This function is a possible cancellation points and therefore not
668 marked with __THROW. */
669 extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
670 __FILE *__restrict __stream);
672 /* Write a string to STREAM.
674 This function is a possible cancellation points and therefore not
675 marked with __THROW. */
676 extern int fputws (__const wchar_t *__restrict __ws,
677 __FILE *__restrict __stream);
678 libc_hidden_proto(fputws)
681 /* Push a character back onto the input buffer of STREAM.
683 This function is a possible cancellation points and therefore not
684 marked with __THROW. */
685 extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
686 libc_hidden_proto(ungetwc)
691 /* These are defined to be equivalent to the `char' functions defined
694 These functions are not part of POSIX and therefore no official
695 cancellation point. But due to similarity with an POSIX interface
696 or due to the implementation they are cancellation points and
697 therefore not marked with __THROW. */
698 extern wint_t getwc_unlocked (__FILE *__stream);
699 extern wint_t getwchar_unlocked (void);
701 /* This is the wide character version of a GNU extension.
703 This function is not part of POSIX and therefore no official
704 cancellation point. But due to similarity with an POSIX interface
705 or due to the implementation it is a cancellation point and
706 therefore not marked with __THROW. */
707 extern wint_t fgetwc_unlocked (__FILE *__stream);
708 libc_hidden_proto(fgetwc_unlocked)
710 /* Faster version when locking is not necessary.
712 This function is not part of POSIX and therefore no official
713 cancellation point. But due to similarity with an POSIX interface
714 or due to the implementation it is a cancellation point and
715 therefore not marked with __THROW. */
716 extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream);
717 libc_hidden_proto(fputwc_unlocked)
719 /* These are defined to be equivalent to the `char' functions defined
722 These functions are not part of POSIX and therefore no official
723 cancellation point. But due to similarity with an POSIX interface
724 or due to the implementation they are cancellation points and
725 therefore not marked with __THROW. */
726 extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream);
727 extern wint_t putwchar_unlocked (wchar_t __wc);
730 /* This function does the same as `fgetws' but does not lock the stream.
732 This function is not part of POSIX and therefore no official
733 cancellation point. But due to similarity with an POSIX interface
734 or due to the implementation it is a cancellation point and
735 therefore not marked with __THROW. */
736 extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n,
737 __FILE *__restrict __stream);
738 libc_hidden_proto(fgetws_unlocked)
740 /* This function does the same as `fputws' but does not lock the stream.
742 This function is not part of POSIX and therefore no official
743 cancellation point. But due to similarity with an POSIX interface
744 or due to the implementation it is a cancellation point and
745 therefore not marked with __THROW. */
746 extern int fputws_unlocked (__const wchar_t *__restrict __ws,
747 __FILE *__restrict __stream);
748 libc_hidden_proto(fputws_unlocked)
752 __BEGIN_NAMESPACE_C99
753 /* Format TP into S according to FORMAT.
754 Write no more than MAXSIZE wide characters and return the number
755 of wide characters written, or 0 if it would exceed MAXSIZE. */
756 extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
757 __const wchar_t *__restrict __format,
758 __const struct tm *__restrict __tp) __THROW;
761 # if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
762 # include <xlocale.h>
764 /* Similar to `wcsftime' but takes the information from
765 the provided locale and not the global locale. */
766 extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
767 __const wchar_t *__restrict __format,
768 __const struct tm *__restrict __tp,
769 __locale_t __loc) __THROW;
770 libc_hidden_proto(wcsftime_l)
773 /* The X/Open standard demands that most of the functions defined in
774 the <wctype.h> header must also appear here. This is probably
775 because some X/Open members wrote their implementation before the
776 ISO C standard was published and introduced the better solution.
777 We have to provide these definitions for compliance reasons but we
778 do this nonsense only if really necessary. */
779 #if defined __USE_UNIX98 && !defined __USE_GNU
780 # define __need_iswxxx
785 extern size_t __wcslcpy(wchar_t *__restrict dst,
786 const wchar_t *__restrict src, size_t n) attribute_hidden;
791 #endif /* _WCHAR_H defined */