OSDN Git Service

Add a dummy (always fails) wcsftime. This is needed for the libstdc++ locale
[uclinux-h8/uClibc.git] / include / wchar.h
1 /* Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3
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.
8
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.
13
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
17    02111-1307 USA.  */
18
19 /*
20  *      ISO C99 Standard: 7.24
21  *      Extended multibyte and wide character utilities <wchar.h>
22  */
23
24 #ifndef _WCHAR_H
25
26 #ifndef __need_mbstate_t
27 # define _WCHAR_H 1
28 # include <features.h>
29 #endif
30
31 #ifndef __UCLIBC_HAS_WCHAR__
32 #error Attempted to include wchar.h when uClibc built without wide char support.
33 #endif
34
35 #ifdef _WCHAR_H
36 /* Get FILE definition.  */
37 # define __need___FILE
38 # ifdef __USE_UNIX98
39 #  define __need_FILE
40 # endif
41 # include <stdio.h>
42 /* Get va_list definition.  */
43 # define __need___va_list
44 # include <stdarg.h>
45
46 /* Get size_t, wchar_t, wint_t and NULL from <stddef.h>.  */
47 # define __need_size_t
48 # define __need_wchar_t
49 # define __need_NULL
50 #endif
51 #define __need_wint_t
52 #include <stddef.h>
53
54 #include <bits/wchar.h>
55
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.  */
58 #ifndef _WINT_T
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.  */
63 # define _WINT_T
64 typedef unsigned int wint_t;
65 #else
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__
70 __BEGIN_NAMESPACE_STD
71 typedef __WINT_TYPE__ wint_t;
72 __END_NAMESPACE_STD
73 # endif
74 #endif
75
76
77 #ifndef __mbstate_t_defined
78 # define __mbstate_t_defined    1
79 /* Conversion state information.  */
80 #if 1
81 typedef struct
82 {
83         wchar_t mask;
84         wchar_t wc;
85 } __mbstate_t;
86 #else
87 typedef struct
88 {
89   int __count;
90   union
91   {
92     wint_t __wch;
93     char __wchb[4];
94   } __value;            /* Value so far.  */
95 } __mbstate_t;
96 #endif
97 #endif
98 #undef __need_mbstate_t
99
100
101 /* The rest of the file is only used if used if __need_mbstate_t is not
102    defined.  */
103 #ifdef _WCHAR_H
104
105 __BEGIN_NAMESPACE_C99
106 /* Public type.  */
107 typedef __mbstate_t mbstate_t;
108 __END_NAMESPACE_C99
109 #ifdef __USE_GNU
110 __USING_NAMESPACE_C99(mbstate_t)
111 #endif
112
113 #ifndef WCHAR_MIN
114 /* These constants might also be defined in <inttypes.h>.  */
115 # define WCHAR_MIN __WCHAR_MIN
116 # define WCHAR_MAX __WCHAR_MAX
117 #endif
118
119 #ifndef WEOF
120 # define WEOF (0xffffffffu)
121 #endif
122
123 /* For XPG4 compliance we have to define the stuff from <wctype.h> here
124    as well.  */
125 #if defined __USE_XOPEN && !defined __USE_UNIX98
126 # include <wctype.h>
127 #endif
128
129
130 __BEGIN_DECLS
131
132 __BEGIN_NAMESPACE_STD
133 /* This incomplete type is defined in <time.h> but needed here because
134    of `wcsftime'.  */
135 struct tm;
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)
140 __END_NAMESPACE_STD
141
142
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)
150      __THROW;
151
152 /* Append SRC onto DEST.  */
153 extern wchar_t *wcscat (wchar_t *__restrict __dest,
154                         __const wchar_t *__restrict __src) __THROW;
155 /* Append no more than N wide-characters of SRC onto DEST.  */
156 extern wchar_t *wcsncat (wchar_t *__restrict __dest,
157                          __const wchar_t *__restrict __src, size_t __n)
158      __THROW;
159
160 /* Compare S1 and S2.  */
161 extern int wcscmp (__const wchar_t *__s1, __const wchar_t *__s2)
162      __THROW __attribute_pure__;
163 /* Compare N wide-characters of S1 and S2.  */
164 extern int wcsncmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n)
165      __THROW __attribute_pure__;
166 __END_NAMESPACE_C99
167
168 #ifdef __USE_GNU
169 /* Compare S1 and S2, ignoring case.  */
170 extern int wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2) __THROW;
171
172 /* Compare no more than N chars of S1 and S2, ignoring case.  */
173 extern int wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2,
174                         size_t __n) __THROW;
175
176 #ifdef __UCLIBC_HAS_XLOCALE__
177 /* Similar to the two functions above but take the information from
178    the provided locale and not the global locale.  */
179 # include <xlocale.h>
180
181 extern int wcscasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
182                          __locale_t __loc) __THROW;
183 extern int __wcscasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
184                          __locale_t __loc) __THROW;
185
186 extern int wcsncasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
187                           size_t __n, __locale_t __loc) __THROW;
188 extern int __wcsncasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
189                           size_t __n, __locale_t __loc) __THROW;
190 #endif /* __UCLIBC_HAS_XLOCALE__ */
191 #endif
192
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 /* Transform S2 into array pointed to by S1 such that if wcscmp is
198    applied to two transformed strings the result is the as applying
199    `wcscoll' to the original strings.  */
200 extern size_t wcsxfrm (wchar_t *__restrict __s1,
201                        __const wchar_t *__restrict __s2, size_t __n) __THROW;
202 __END_NAMESPACE_C99
203
204 #ifdef __USE_GNU
205 #ifdef __UCLIBC_HAS_XLOCALE__
206 /* Similar to the two functions above but take the information from
207    the provided locale and not the global locale.  */
208
209 /* Compare S1 and S2, both interpreted as appropriate to the
210    LC_COLLATE category of the given locale.  */
211 extern int wcscoll_l (__const wchar_t *__s1, __const wchar_t *__s2,
212                       __locale_t __loc) __THROW;
213 extern int __wcscoll_l (__const wchar_t *__s1, __const wchar_t *__s2,
214                       __locale_t __loc) __THROW;
215
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 extern size_t __wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2,
222                          size_t __n, __locale_t __loc) __THROW;
223
224 #endif /* __UCLIBC_HAS_XLOCALE__ */
225
226 /* Duplicate S, returning an identical malloc'd string.  */
227 extern wchar_t *wcsdup (__const wchar_t *__s) __THROW __attribute_malloc__;
228 #endif
229
230 __BEGIN_NAMESPACE_C99
231 /* Find the first occurrence of WC in WCS.  */
232 extern wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc)
233      __THROW __attribute_pure__;
234 /* Find the last occurrence of WC in WCS.  */
235 extern wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc)
236      __THROW __attribute_pure__;
237 __END_NAMESPACE_C99
238
239 #ifdef __USE_GNU
240 /* This function is similar to `wcschr'.  But it returns a pointer to
241    the closing NUL wide character in case C is not found in S.  */
242 extern wchar_t *wcschrnul (__const wchar_t *__s, wchar_t __wc)
243      __THROW __attribute_pure__;
244 #endif
245
246 __BEGIN_NAMESPACE_C99
247 /* Return the length of the initial segmet of WCS which
248    consists entirely of wide characters not in REJECT.  */
249 extern size_t wcscspn (__const wchar_t *__wcs, __const wchar_t *__reject)
250      __THROW __attribute_pure__;
251 /* Return the length of the initial segmet of WCS which
252    consists entirely of wide characters in  ACCEPT.  */
253 extern size_t wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept)
254      __THROW __attribute_pure__;
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 /* Find the first occurrence of NEEDLE in HAYSTACK.  */
259 extern wchar_t *wcsstr (__const wchar_t *__haystack, __const wchar_t *__needle)
260      __THROW __attribute_pure__;
261
262 /* Divide WCS into tokens separated by characters in DELIM.  */
263 extern wchar_t *wcstok (wchar_t *__restrict __s,
264                         __const wchar_t *__restrict __delim,
265                         wchar_t **__restrict __ptr) __THROW;
266
267 /* Return the number of wide characters in S.  */
268 extern size_t wcslen (__const wchar_t *__s) __THROW __attribute_pure__;
269 __END_NAMESPACE_C99
270
271 #ifdef __USE_XOPEN
272 /* Another name for `wcsstr' from XPG4.  */
273 extern wchar_t *wcswcs (__const wchar_t *__haystack, __const wchar_t *__needle)
274      __THROW __attribute_pure__;
275 #endif
276
277 #ifdef __USE_GNU
278 /* Return the number of wide characters in S, but at most MAXLEN.  */
279 extern size_t wcsnlen (__const wchar_t *__s, size_t __maxlen)
280      __THROW __attribute_pure__;
281 #endif
282
283
284 __BEGIN_NAMESPACE_C99
285 /* Search N wide characters of S for C.  */
286 extern wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n)
287      __THROW __attribute_pure__;
288
289 /* Compare N wide characters of S1 and S2.  */
290 extern int wmemcmp (__const wchar_t *__restrict __s1,
291                     __const wchar_t *__restrict __s2, size_t __n)
292      __THROW __attribute_pure__;
293
294 /* Copy N wide characters of SRC to DEST.  */
295 extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
296                          __const wchar_t *__restrict __s2, size_t __n) __THROW;
297
298 /* Copy N wide characters of SRC to DEST, guaranteeing
299    correct behavior for overlapping strings.  */
300 extern wchar_t *wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n)
301      __THROW;
302
303 /* Set N wide characters of S to C.  */
304 extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
305 __END_NAMESPACE_C99
306
307 #ifdef __USE_GNU
308 /* Copy N wide characters of SRC to DEST and return pointer to following
309    wide character.  */
310 extern wchar_t *wmempcpy (wchar_t *__restrict __s1,
311                           __const wchar_t *__restrict __s2, size_t __n)
312      __THROW;
313 #endif
314
315
316 __BEGIN_NAMESPACE_C99
317 /* Determine whether C constitutes a valid (one-byte) multibyte
318    character.  */
319 extern wint_t btowc (int __c) __THROW;
320
321 /* Determine whether C corresponds to a member of the extended
322    character set whose multibyte representation is a single byte.  */
323 extern int wctob (wint_t __c) __THROW;
324
325 /* Determine whether PS points to an object representing the initial
326    state.  */
327 extern int mbsinit (__const mbstate_t *__ps) __THROW __attribute_pure__;
328
329 /* Write wide character representation of multibyte character pointed
330    to by S to PWC.  */
331 extern size_t mbrtowc (wchar_t *__restrict __pwc,
332                        __const char *__restrict __s, size_t __n,
333                        mbstate_t *__p) __THROW;
334
335 /* Write multibyte representation of wide character WC to S.  */
336 extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
337                        mbstate_t *__restrict __ps) __THROW;
338
339 /* Return number of bytes in multibyte character pointed to by S.  */
340 extern size_t __mbrlen (__const char *__restrict __s, size_t __n,
341                         mbstate_t *__restrict __ps) __THROW;
342 extern size_t mbrlen (__const char *__restrict __s, size_t __n,
343                       mbstate_t *__restrict __ps) __THROW;
344 __END_NAMESPACE_C99
345
346 #ifdef __USE_EXTERN_INLINES
347 /* Define inline function as optimization.  */
348 extern __inline size_t mbrlen (__const char *__restrict __s, size_t __n,
349                                mbstate_t *__restrict __ps) __THROW
350 { return (__ps != NULL
351           ? mbrtowc (NULL, __s, __n, __ps) : __mbrlen (__s, __n, NULL)); }
352 #endif
353
354 __BEGIN_NAMESPACE_C99
355 /* Write wide character representation of multibyte character string
356    SRC to DST.  */
357 extern size_t mbsrtowcs (wchar_t *__restrict __dst,
358                          __const char **__restrict __src, size_t __len,
359                          mbstate_t *__restrict __ps) __THROW;
360
361 /* Write multibyte character representation of wide character string
362    SRC to DST.  */
363 extern size_t wcsrtombs (char *__restrict __dst,
364                          __const wchar_t **__restrict __src, size_t __len,
365                          mbstate_t *__restrict __ps) __THROW;
366 __END_NAMESPACE_C99
367
368
369 #ifdef  __USE_GNU
370 /* Write wide character representation of at most NMC bytes of the
371    multibyte character string SRC to DST.  */
372 extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
373                           __const char **__restrict __src, size_t __nmc,
374                           size_t __len, mbstate_t *__restrict __ps) __THROW;
375
376 /* Write multibyte character representation of at most NWC characters
377    from the wide character string SRC to DST.  */
378 extern size_t wcsnrtombs (char *__restrict __dst,
379                           __const wchar_t **__restrict __src,
380                           size_t __nwc, size_t __len,
381                           mbstate_t *__restrict __ps) __THROW;
382 #endif  /* use GNU */
383
384
385 /* The following functions are extensions found in X/Open CAE.  */
386 #ifdef __USE_XOPEN
387 /* Determine number of column positions required for C.  */
388 extern int wcwidth (wchar_t __c) __THROW;
389
390 /* Determine number of column positions required for first N wide
391    characters (or fewer if S ends before this) in S.  */
392 extern int wcswidth (__const wchar_t *__s, size_t __n) __THROW;
393 #endif  /* Use X/Open.  */
394
395
396 __BEGIN_NAMESPACE_C99
397 #ifdef __UCLIBC_HAS_FLOATS__
398 /* Convert initial portion of the wide string NPTR to `double'
399    representation.  */
400 extern double wcstod (__const wchar_t *__restrict __nptr,
401                       wchar_t **__restrict __endptr) __THROW;
402
403 #ifdef __USE_ISOC99
404 /* Likewise for `float' and `long double' sizes of floating-point numbers.  */
405 extern float wcstof (__const wchar_t *__restrict __nptr,
406                      wchar_t **__restrict __endptr) __THROW;
407 extern long double wcstold (__const wchar_t *__restrict __nptr,
408                             wchar_t **__restrict __endptr) __THROW;
409 #endif /* C99 */
410 #endif /* __UCLIBC_HAS_FLOATS__ */
411
412
413 /* Convert initial portion of wide string NPTR to `long int'
414    representation.  */
415 extern long int wcstol (__const wchar_t *__restrict __nptr,
416                         wchar_t **__restrict __endptr, int __base) __THROW;
417
418 /* Convert initial portion of wide string NPTR to `unsigned long int'
419    representation.  */
420 extern unsigned long int wcstoul (__const wchar_t *__restrict __nptr,
421                                   wchar_t **__restrict __endptr, int __base)
422      __THROW;
423
424 #if defined __USE_ISOC99 || (defined __GNUC__ && defined __USE_GNU)
425 /* Convert initial portion of wide string NPTR to `long int'
426    representation.  */
427 __extension__
428 extern long long int wcstoll (__const wchar_t *__restrict __nptr,
429                               wchar_t **__restrict __endptr, int __base)
430      __THROW;
431
432 /* Convert initial portion of wide string NPTR to `unsigned long long int'
433    representation.  */
434 __extension__
435 extern unsigned long long int wcstoull (__const wchar_t *__restrict __nptr,
436                                         wchar_t **__restrict __endptr,
437                                         int __base) __THROW;
438 #endif /* ISO C99 or GCC and GNU.  */
439 __END_NAMESPACE_C99
440
441 #if defined __GNUC__ && defined __USE_GNU
442 /* Convert initial portion of wide string NPTR to `long int'
443    representation.  */
444 __extension__
445 extern long long int wcstoq (__const wchar_t *__restrict __nptr,
446                              wchar_t **__restrict __endptr, int __base)
447      __THROW;
448
449 /* Convert initial portion of wide string NPTR to `unsigned long long int'
450    representation.  */
451 __extension__
452 extern unsigned long long int wcstouq (__const wchar_t *__restrict __nptr,
453                                        wchar_t **__restrict __endptr,
454                                        int __base) __THROW;
455 #endif /* GCC and use GNU.  */
456
457 #ifdef __USE_GNU
458 #ifdef __UCLIBC_HAS_XLOCALE__
459 /* The concept of one static locale per category is not very well
460    thought out.  Many applications will need to process its data using
461    information from several different locales.  Another application is
462    the implementation of the internationalization handling in the
463    upcoming ISO C++ standard library.  To support this another set of
464    the functions using locale data exist which have an additional
465    argument.
466
467    Attention: all these functions are *not* standardized in any form.
468    This is a proof-of-concept implementation.  */
469
470 /* Structure for reentrant locale using functions.  This is an
471    (almost) opaque type for the user level programs.  */
472 # include <xlocale.h>
473
474 /* Special versions of the functions above which take the locale to
475    use as an additional parameter.  */
476 extern long int wcstol_l (__const wchar_t *__restrict __nptr,
477                           wchar_t **__restrict __endptr, int __base,
478                           __locale_t __loc) __THROW;
479 extern long int __wcstol_l (__const wchar_t *__restrict __nptr,
480                           wchar_t **__restrict __endptr, int __base,
481                           __locale_t __loc) __THROW;
482
483 extern unsigned long int wcstoul_l (__const wchar_t *__restrict __nptr,
484                                     wchar_t **__restrict __endptr,
485                                     int __base, __locale_t __loc) __THROW;
486 extern unsigned long int __wcstoul_l (__const wchar_t *__restrict __nptr,
487                                     wchar_t **__restrict __endptr,
488                                     int __base, __locale_t __loc) __THROW;
489
490 __extension__
491 extern long long int wcstoll_l (__const wchar_t *__restrict __nptr,
492                                 wchar_t **__restrict __endptr,
493                                 int __base, __locale_t __loc) __THROW;
494 __extension__
495 extern long long int __wcstoll_l (__const wchar_t *__restrict __nptr,
496                                 wchar_t **__restrict __endptr,
497                                 int __base, __locale_t __loc) __THROW;
498
499 __extension__
500 extern unsigned long long int wcstoull_l (__const wchar_t *__restrict __nptr,
501                                           wchar_t **__restrict __endptr,
502                                           int __base, __locale_t __loc)
503      __THROW;
504 __extension__
505 extern unsigned long long int __wcstoull_l (__const wchar_t *__restrict __nptr,
506                                           wchar_t **__restrict __endptr,
507                                           int __base, __locale_t __loc)
508      __THROW;
509
510 #ifdef __UCLIBC_HAS_FLOATS__
511 extern double wcstod_l (__const wchar_t *__restrict __nptr,
512                         wchar_t **__restrict __endptr, __locale_t __loc)
513      __THROW;
514 extern double __wcstod_l (__const wchar_t *__restrict __nptr,
515                         wchar_t **__restrict __endptr, __locale_t __loc)
516      __THROW;
517
518 extern float wcstof_l (__const wchar_t *__restrict __nptr,
519                        wchar_t **__restrict __endptr, __locale_t __loc)
520      __THROW;
521 extern float __wcstof_l (__const wchar_t *__restrict __nptr,
522                        wchar_t **__restrict __endptr, __locale_t __loc)
523      __THROW;
524
525 extern long double wcstold_l (__const wchar_t *__restrict __nptr,
526                               wchar_t **__restrict __endptr,
527                               __locale_t __loc) __THROW;
528 extern long double __wcstold_l (__const wchar_t *__restrict __nptr,
529                               wchar_t **__restrict __endptr,
530                               __locale_t __loc) __THROW;
531 #endif /* __UCLIBC_HAS_FLOATS__ */
532 #endif /* __UCLIBC_HAS_XLOCALE__ */
533 #endif /* GNU */
534
535
536 #if 0
537 #ifdef __UCLIBC_HAS_FLOATS__
538 /* The internal entry points for `wcstoX' take an extra flag argument
539    saying whether or not to parse locale-dependent number grouping.  */
540 extern double __wcstod_internal (__const wchar_t *__restrict __nptr,
541                                  wchar_t **__restrict __endptr, int __group)
542      __THROW;
543 extern float __wcstof_internal (__const wchar_t *__restrict __nptr,
544                                 wchar_t **__restrict __endptr, int __group)
545      __THROW;
546 extern long double __wcstold_internal (__const wchar_t *__restrict __nptr,
547                                        wchar_t **__restrict __endptr,
548                                        int __group) __THROW;
549 #endif /* __UCLIBC_HAS_FLOATS__ */
550
551 #ifndef __wcstol_internal_defined
552 extern long int __wcstol_internal (__const wchar_t *__restrict __nptr,
553                                    wchar_t **__restrict __endptr,
554                                    int __base, int __group) __THROW;
555 # define __wcstol_internal_defined      1
556 #endif
557 #ifndef __wcstoul_internal_defined
558 extern unsigned long int __wcstoul_internal (__const wchar_t *__restrict __npt,
559                                              wchar_t **__restrict __endptr,
560                                              int __base, int __group) __THROW;
561 # define __wcstoul_internal_defined     1
562 #endif
563 #ifndef __wcstoll_internal_defined
564 __extension__
565 extern long long int __wcstoll_internal (__const wchar_t *__restrict __nptr,
566                                          wchar_t **__restrict __endptr,
567                                          int __base, int __group) __THROW;
568 # define __wcstoll_internal_defined     1
569 #endif
570 #ifndef __wcstoull_internal_defined
571 __extension__
572 extern unsigned long long int __wcstoull_internal (__const wchar_t *
573                                                    __restrict __nptr,
574                                                    wchar_t **
575                                                    __restrict __endptr,
576                                                    int __base,
577                                                    int __group) __THROW;
578 # define __wcstoull_internal_defined    1
579 #endif
580
581
582 #if defined __OPTIMIZE__ && __GNUC__ >= 2
583 /* Define inline functions which call the internal entry points.  */
584 /* __BEGIN_NAMESPACE_C99 */
585
586 /* extern __inline double wcstod (__const wchar_t *__restrict __nptr, */
587 /*                             wchar_t **__restrict __endptr) __THROW */
588 /* { return __wcstod_internal (__nptr, __endptr, 0); } */
589 /* extern __inline long int wcstol (__const wchar_t *__restrict __nptr, */
590 /*                                  wchar_t **__restrict __endptr, */
591 /*                               int __base) __THROW */
592 /* { return __wcstol_internal (__nptr, __endptr, __base, 0); } */
593 /* extern __inline unsigned long int wcstoul (__const wchar_t *__restrict __nptr, */
594 /*                                            wchar_t **__restrict __endptr, */
595 /*                                         int __base) __THROW */
596 /* { return __wcstoul_internal (__nptr, __endptr, __base, 0); } */
597 /* __END_NAMESPACE_C99 */
598
599 # ifdef __USE_GNU
600 /* extern __inline float wcstof (__const wchar_t *__restrict __nptr, */
601 /*                            wchar_t **__restrict __endptr) __THROW */
602 /* { return __wcstof_internal (__nptr, __endptr, 0); } */
603 /* extern __inline long double wcstold (__const wchar_t *__restrict __nptr, */
604 /*                                   wchar_t **__restrict __endptr) __THROW */
605 /* { return __wcstold_internal (__nptr, __endptr, 0); } */
606
607
608 /* __extension__ */
609 /* extern __inline long long int wcstoq (__const wchar_t *__restrict __nptr, */
610 /*                                    wchar_t **__restrict __endptr, */
611 /*                                    int __base) __THROW */
612 /* { return __wcstoll_internal (__nptr, __endptr, __base, 0); } */
613 /* __extension__ */
614 /* extern __inline unsigned long long int wcstouq (__const wchar_t * */
615 /*                                              __restrict __nptr, */
616 /*                                              wchar_t **__restrict __endptr, */
617 /*                                              int __base) __THROW */
618 /* { return __wcstoull_internal (__nptr, __endptr, __base, 0); } */
619 # endif /* Use GNU.  */
620 #endif /* Optimizing GCC >=2.  */
621 #endif /* 0 */
622
623
624 #ifdef  __USE_GNU
625 /* Copy SRC to DEST, returning the address of the terminating L'\0' in
626    DEST.  */
627 extern wchar_t *wcpcpy (wchar_t *__dest, __const wchar_t *__src) __THROW;
628
629 /* Copy no more than N characters of SRC to DEST, returning the address of
630    the last character written into DEST.  */
631 extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n)
632      __THROW;
633 #endif  /* use GNU */
634
635
636 /* Wide character I/O functions.  */
637 #if defined __USE_ISOC99 || defined __USE_UNIX98
638 __BEGIN_NAMESPACE_C99
639
640 /* Select orientation for stream.  */
641 extern int fwide (__FILE *__fp, int __mode) __THROW;
642
643
644 /* Write formatted output to STREAM.
645
646    This function is a possible cancellation point and therefore not
647    marked with __THROW.  */
648 extern int fwprintf (__FILE *__restrict __stream,
649                      __const wchar_t *__restrict __format, ...)
650      /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
651 /* Write formatted output to stdout.
652
653    This function is a possible cancellation point and therefore not
654    marked with __THROW.  */
655 extern int wprintf (__const wchar_t *__restrict __format, ...)
656      /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */;
657 /* Write formatted output of at most N characters to S.  */
658 extern int swprintf (wchar_t *__restrict __s, size_t __n,
659                      __const wchar_t *__restrict __format, ...)
660      __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */;
661
662 /* Write formatted output to S from argument list ARG.
663
664    This function is a possible cancellation point and therefore not
665    marked with __THROW.  */
666 extern int vfwprintf (__FILE *__restrict __s,
667                       __const wchar_t *__restrict __format,
668                       __gnuc_va_list __arg)
669      /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */;
670 /* Write formatted output to stdout from argument list ARG.
671
672    This function is a possible cancellation point and therefore not
673    marked with __THROW.  */
674 extern int vwprintf (__const wchar_t *__restrict __format,
675                      __gnuc_va_list __arg)
676      /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */;
677 /* Write formatted output of at most N character to S from argument
678    list ARG.  */
679 extern int vswprintf (wchar_t *__restrict __s, size_t __n,
680                       __const wchar_t *__restrict __format,
681                       __gnuc_va_list __arg)
682      __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
683
684
685 /* Read formatted input from STREAM.
686
687    This function is a possible cancellation point and therefore not
688    marked with __THROW.  */
689 extern int fwscanf (__FILE *__restrict __stream,
690                     __const wchar_t *__restrict __format, ...)
691      /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
692 /* Read formatted input from stdin.
693
694    This function is a possible cancellation point and therefore not
695    marked with __THROW.  */
696 extern int wscanf (__const wchar_t *__restrict __format, ...)
697      /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
698 /* Read formatted input from S.  */
699 extern int swscanf (__const wchar_t *__restrict __s,
700                     __const wchar_t *__restrict __format, ...)
701      __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
702
703 __END_NAMESPACE_C99
704 #endif /* Use ISO C99 and Unix98. */
705
706 #ifdef __USE_ISOC99
707 __BEGIN_NAMESPACE_C99
708
709 /* Read formatted input from S into argument list ARG.
710
711    This function is a possible cancellation point and therefore not
712    marked with __THROW.  */
713 extern int vfwscanf (__FILE *__restrict __s,
714                      __const wchar_t *__restrict __format,
715                      __gnuc_va_list __arg)
716      /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
717 /* Read formatted input from stdin into argument list ARG.
718
719    This function is a possible cancellation point and therefore not
720    marked with __THROW.  */
721 extern int vwscanf (__const wchar_t *__restrict __format,
722                     __gnuc_va_list __arg)
723      /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
724 /* Read formatted input from S into argument list ARG.  */
725 extern int vswscanf (__const wchar_t *__restrict __s,
726                      __const wchar_t *__restrict __format,
727                      __gnuc_va_list __arg)
728      __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
729
730 __END_NAMESPACE_C99
731 #endif /* Use ISO C99. */
732
733
734 __BEGIN_NAMESPACE_C99
735 /* Read a character from STREAM.
736
737    These functions are possible cancellation points and therefore not
738    marked with __THROW.  */
739 extern wint_t fgetwc (__FILE *__stream);
740 extern wint_t getwc (__FILE *__stream);
741
742 /* Read a character from stdin.
743
744    This function is a possible cancellation point and therefore not
745    marked with __THROW.  */
746 extern wint_t getwchar (void);
747
748
749 /* Write a character to STREAM.
750
751    These functions are possible cancellation points and therefore not
752    marked with __THROW.  */
753 extern wint_t fputwc (wchar_t __wc, __FILE *__stream);
754 extern wint_t putwc (wchar_t __wc, __FILE *__stream);
755
756 /* Write a character to stdout.
757
758    This function is a possible cancellation points and therefore not
759    marked with __THROW.  */
760 extern wint_t putwchar (wchar_t __wc);
761
762
763 /* Get a newline-terminated wide character string of finite length
764    from STREAM.
765
766    This function is a possible cancellation points and therefore not
767    marked with __THROW.  */
768 extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
769                         __FILE *__restrict __stream);
770
771 /* Write a string to STREAM.
772
773    This function is a possible cancellation points and therefore not
774    marked with __THROW.  */
775 extern int fputws (__const wchar_t *__restrict __ws,
776                    __FILE *__restrict __stream);
777
778
779 /* Push a character back onto the input buffer of STREAM.
780
781    This function is a possible cancellation points and therefore not
782    marked with __THROW.  */
783 extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
784 __END_NAMESPACE_C99
785
786
787 #ifdef __USE_GNU
788 /* These are defined to be equivalent to the `char' functions defined
789    in POSIX.1:1996.
790
791    These functions are not part of POSIX and therefore no official
792    cancellation point.  But due to similarity with an POSIX interface
793    or due to the implementation they are cancellation points and
794    therefore not marked with __THROW.  */
795 extern wint_t getwc_unlocked (__FILE *__stream);
796 extern wint_t getwchar_unlocked (void);
797
798 /* This is the wide character version of a GNU extension.
799
800    This function is not part of POSIX and therefore no official
801    cancellation point.  But due to similarity with an POSIX interface
802    or due to the implementation it is a cancellation point and
803    therefore not marked with __THROW.  */
804 extern wint_t fgetwc_unlocked (__FILE *__stream);
805
806 /* Faster version when locking is not necessary.
807
808    This function is not part of POSIX and therefore no official
809    cancellation point.  But due to similarity with an POSIX interface
810    or due to the implementation it is a cancellation point and
811    therefore not marked with __THROW.  */
812 extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream);
813
814 /* These are defined to be equivalent to the `char' functions defined
815    in POSIX.1:1996.
816
817    These functions are not part of POSIX and therefore no official
818    cancellation point.  But due to similarity with an POSIX interface
819    or due to the implementation they are cancellation points and
820    therefore not marked with __THROW.  */
821 extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream);
822 extern wint_t putwchar_unlocked (wchar_t __wc);
823
824
825 /* This function does the same as `fgetws' but does not lock the stream.
826
827    This function is not part of POSIX and therefore no official
828    cancellation point.  But due to similarity with an POSIX interface
829    or due to the implementation it is a cancellation point and
830    therefore not marked with __THROW.  */
831 extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n,
832                                  __FILE *__restrict __stream);
833
834 /* This function does the same as `fputws' but does not lock the stream.
835
836    This function is not part of POSIX and therefore no official
837    cancellation point.  But due to similarity with an POSIX interface
838    or due to the implementation it is a cancellation point and
839    therefore not marked with __THROW.  */
840 extern int fputws_unlocked (__const wchar_t *__restrict __ws,
841                             __FILE *__restrict __stream);
842 #endif
843
844
845 __BEGIN_NAMESPACE_C99
846 /* Format TP into S according to FORMAT.
847    Write no more than MAXSIZE wide characters and return the number
848    of wide characters written, or 0 if it would exceed MAXSIZE.  */
849 extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
850                         __const wchar_t *__restrict __format,
851                         __const struct tm *__restrict __tp) __THROW;
852 __END_NAMESPACE_C99
853
854 # ifdef __USE_GNU
855 #ifdef __UCLIBC_HAS_XLOCALE__
856 # include <xlocale.h>
857
858 /* Similar to `wcsftime' but takes the information from
859    the provided locale and not the global locale.  */
860 extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
861                           __const wchar_t *__restrict __format,
862                           __const struct tm *__restrict __tp,
863                           __locale_t __loc) __THROW;
864 extern size_t __wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
865                           __const wchar_t *__restrict __format,
866                           __const struct tm *__restrict __tp,
867                           __locale_t __loc) __THROW;
868 #endif /* __UCLIBC_HAS_XLOCALE__ */
869 # endif
870
871 /* The X/Open standard demands that most of the functions defined in
872    the <wctype.h> header must also appear here.  This is probably
873    because some X/Open members wrote their implementation before the
874    ISO C standard was published and introduced the better solution.
875    We have to provide these definitions for compliance reasons but we
876    do this nonsense only if really necessary.  */
877 #if defined __USE_UNIX98 && !defined __USE_GNU
878 # define __need_iswxxx
879 # include <wctype.h>
880 #endif
881
882 __END_DECLS
883
884 #endif  /* _WCHAR_H defined */
885
886 #endif /* wchar.h  */