modernc.org/cc@v1.0.1/v2/headers/linux_386/usr/include/wchar.h (about) 1 /* Copyright (C) 1995-2018 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, see 16 <http://www.gnu.org/licenses/>. */ 17 18 /* 19 * ISO C99 Standard: 7.24 20 * Extended multibyte and wide character utilities <wchar.h> 21 */ 22 23 #ifndef _WCHAR_H 24 #define _WCHAR_H 1 25 26 #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION 27 #include <bits/libc-header-start.h> 28 29 /* Gather machine dependent type support. */ 30 #include <bits/floatn.h> 31 32 #define __need_size_t 33 #define __need_wchar_t 34 #define __need_NULL 35 #include <stddef.h> 36 37 #define __need___va_list 38 #include <stdarg.h> 39 40 #include <bits/wchar.h> 41 #include <bits/types/wint_t.h> 42 #include <bits/types/mbstate_t.h> 43 #include <bits/types/__FILE.h> 44 45 #if defined __USE_UNIX98 || defined __USE_XOPEN2K 46 # include <bits/types/FILE.h> 47 #endif 48 #ifdef __USE_XOPEN2K8 49 # include <bits/types/locale_t.h> 50 #endif 51 52 /* Tell the caller that we provide correct C++ prototypes. */ 53 #if defined __cplusplus && __GNUC_PREREQ (4, 4) 54 # define __CORRECT_ISO_CPP_WCHAR_H_PROTO 55 #endif 56 57 #ifndef WCHAR_MIN 58 /* These constants might also be defined in <inttypes.h>. */ 59 # define WCHAR_MIN __WCHAR_MIN 60 # define WCHAR_MAX __WCHAR_MAX 61 #endif 62 63 #ifndef WEOF 64 # define WEOF (0xffffffffu) 65 #endif 66 67 /* All versions of XPG prior to the publication of ISO C99 required 68 the bulk of <wctype.h>'s declarations to appear in this header 69 (because <wctype.h> did not exist prior to C99). In POSIX.1-2001 70 those declarations were marked as XSI extensions; in -2008 they 71 were additionally marked as obsolescent. _GNU_SOURCE mode 72 anticipates the removal of these declarations in the next revision 73 of POSIX. */ 74 #if (defined __USE_XOPEN && !defined __USE_GNU \ 75 && !(defined __USE_XOPEN2K && !defined __USE_XOPEN2KXSI)) 76 # include <bits/wctype-wchar.h> 77 #endif 78 79 __BEGIN_DECLS 80 /* This incomplete type is defined in <time.h> but needed here because 81 of `wcsftime'. */ 82 struct tm; 83 84 /* Copy SRC to DEST. */ 85 extern wchar_t *wcscpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src) 86 __THROW __nonnull((1, 2)); 87 88 /* Copy no more than N wide-characters of SRC to DEST. */ 89 extern wchar_t *wcsncpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src, size_t __n) 90 __THROW __nonnull((1, 2)); 91 92 /* Append SRC onto DEST. */ 93 extern wchar_t *wcscat(wchar_t * __restrict __dest, const wchar_t * __restrict __src) 94 __THROW __nonnull((1, 2)); 95 /* Append no more than N wide-characters of SRC onto DEST. */ 96 extern wchar_t *wcsncat(wchar_t * __restrict __dest, const wchar_t * __restrict __src, size_t __n) 97 __THROW __nonnull((1, 2)); 98 99 /* Compare S1 and S2. */ 100 extern int wcscmp(const wchar_t * __s1, const wchar_t * __s2) 101 __THROW __attribute_pure__ __nonnull((1, 2)); 102 /* Compare N wide-characters of S1 and S2. */ 103 extern int wcsncmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n) 104 __THROW __attribute_pure__ __nonnull((1, 2)); 105 106 #ifdef __USE_XOPEN2K8 107 /* Compare S1 and S2, ignoring case. */ 108 extern int wcscasecmp(const wchar_t * __s1, const wchar_t * __s2) __THROW; 109 110 /* Compare no more than N chars of S1 and S2, ignoring case. */ 111 extern int wcsncasecmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW; 112 113 /* Similar to the two functions above but take the information from 114 the provided locale and not the global locale. */ 115 extern int wcscasecmp_l(const wchar_t * __s1, const wchar_t * __s2, locale_t __loc) __THROW; 116 117 extern int wcsncasecmp_l(const wchar_t * __s1, const wchar_t * __s2, size_t __n, locale_t __loc) __THROW; 118 #endif 119 120 /* Compare S1 and S2, both interpreted as appropriate to the 121 LC_COLLATE category of the current locale. */ 122 extern int wcscoll(const wchar_t * __s1, const wchar_t * __s2) __THROW; 123 /* Transform S2 into array pointed to by S1 such that if wcscmp is 124 applied to two transformed strings the result is the as applying 125 `wcscoll' to the original strings. */ 126 extern size_t wcsxfrm(wchar_t * __restrict __s1, const wchar_t * __restrict __s2, size_t __n) __THROW; 127 128 #ifdef __USE_XOPEN2K8 129 /* Similar to the two functions above but take the information from 130 the provided locale and not the global locale. */ 131 132 /* Compare S1 and S2, both interpreted as appropriate to the 133 LC_COLLATE category of the given locale. */ 134 extern int wcscoll_l(const wchar_t * __s1, const wchar_t * __s2, locale_t __loc) __THROW; 135 136 /* Transform S2 into array pointed to by S1 such that if wcscmp is 137 applied to two transformed strings the result is the as applying 138 `wcscoll' to the original strings. */ 139 extern size_t wcsxfrm_l(wchar_t * __s1, const wchar_t * __s2, size_t __n, locale_t __loc) __THROW; 140 141 /* Duplicate S, returning an identical malloc'd string. */ 142 extern wchar_t *wcsdup(const wchar_t * __s) 143 __THROW __attribute_malloc__; 144 #endif 145 146 /* Find the first occurrence of WC in WCS. */ 147 #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO 148 extern "C++" wchar_t * wcschr(wchar_t * __wcs, wchar_t __wc) 149 __THROW __asm("wcschr") __attribute_pure__; 150 extern "C++" const wchar_t *wcschr(const wchar_t * __wcs, wchar_t __wc) 151 __THROW __asm("wcschr") __attribute_pure__; 152 #else 153 extern wchar_t *wcschr(const wchar_t * __wcs, wchar_t __wc) 154 __THROW __attribute_pure__; 155 #endif 156 /* Find the last occurrence of WC in WCS. */ 157 #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO 158 extern "C++" wchar_t * wcsrchr(wchar_t * __wcs, wchar_t __wc) 159 __THROW __asm("wcsrchr") __attribute_pure__; 160 extern "C++" const wchar_t *wcsrchr(const wchar_t * __wcs, wchar_t __wc) 161 __THROW __asm("wcsrchr") __attribute_pure__; 162 #else 163 extern wchar_t *wcsrchr(const wchar_t * __wcs, wchar_t __wc) 164 __THROW __attribute_pure__; 165 #endif 166 167 #ifdef __USE_GNU 168 /* This function is similar to `wcschr'. But it returns a pointer to 169 the closing NUL wide character in case C is not found in S. */ 170 extern wchar_t *wcschrnul(const wchar_t * __s, wchar_t __wc) 171 __THROW __attribute_pure__; 172 #endif 173 174 /* Return the length of the initial segmet of WCS which 175 consists entirely of wide characters not in REJECT. */ 176 extern size_t wcscspn(const wchar_t * __wcs, const wchar_t * __reject) 177 __THROW __attribute_pure__; 178 /* Return the length of the initial segmet of WCS which 179 consists entirely of wide characters in ACCEPT. */ 180 extern size_t wcsspn(const wchar_t * __wcs, const wchar_t * __accept) 181 __THROW __attribute_pure__; 182 /* Find the first occurrence in WCS of any character in ACCEPT. */ 183 #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO 184 extern "C++" wchar_t * wcspbrk(wchar_t * __wcs, const wchar_t * __accept) 185 __THROW __asm("wcspbrk") __attribute_pure__; 186 extern "C++" const wchar_t *wcspbrk(const wchar_t * __wcs, const wchar_t * __accept) 187 __THROW __asm("wcspbrk") __attribute_pure__; 188 #else 189 extern wchar_t *wcspbrk(const wchar_t * __wcs, const wchar_t * __accept) 190 __THROW __attribute_pure__; 191 #endif 192 /* Find the first occurrence of NEEDLE in HAYSTACK. */ 193 #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO 194 extern "C++" wchar_t * wcsstr(wchar_t * __haystack, const wchar_t * __needle) 195 __THROW __asm("wcsstr") __attribute_pure__; 196 extern "C++" const wchar_t *wcsstr(const wchar_t * __haystack, const wchar_t * __needle) 197 __THROW __asm("wcsstr") __attribute_pure__; 198 #else 199 extern wchar_t *wcsstr(const wchar_t * __haystack, const wchar_t * __needle) 200 __THROW __attribute_pure__; 201 #endif 202 203 /* Divide WCS into tokens separated by characters in DELIM. */ 204 extern wchar_t *wcstok(wchar_t * __restrict __s, const wchar_t * __restrict __delim, wchar_t ** __restrict __ptr) __THROW; 205 206 /* Return the number of wide characters in S. */ 207 extern size_t wcslen(const wchar_t * __s) 208 __THROW __attribute_pure__; 209 210 #ifdef __USE_XOPEN 211 /* Another name for `wcsstr' from XPG4. */ 212 # ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO 213 extern "C++" wchar_t * wcswcs(wchar_t * __haystack, const wchar_t * __needle) 214 __THROW __asm("wcswcs") __attribute_pure__; 215 extern "C++" const wchar_t *wcswcs(const wchar_t * __haystack, const wchar_t * __needle) 216 __THROW __asm("wcswcs") __attribute_pure__; 217 # else 218 extern wchar_t *wcswcs(const wchar_t * __haystack, const wchar_t * __needle) 219 __THROW __attribute_pure__; 220 # endif 221 #endif 222 223 #ifdef __USE_XOPEN2K8 224 /* Return the number of wide characters in S, but at most MAXLEN. */ 225 extern size_t wcsnlen(const wchar_t * __s, size_t __maxlen) 226 __THROW __attribute_pure__; 227 #endif 228 229 /* Search N wide characters of S for C. */ 230 #ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO 231 extern "C++" wchar_t * wmemchr(wchar_t * __s, wchar_t __c, size_t __n) 232 __THROW __asm("wmemchr") __attribute_pure__; 233 extern "C++" const wchar_t *wmemchr(const wchar_t * __s, wchar_t __c, size_t __n) 234 __THROW __asm("wmemchr") __attribute_pure__; 235 #else 236 extern wchar_t *wmemchr(const wchar_t * __s, wchar_t __c, size_t __n) 237 __THROW __attribute_pure__; 238 #endif 239 240 /* Compare N wide characters of S1 and S2. */ 241 extern int wmemcmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n) 242 __THROW __attribute_pure__; 243 244 /* Copy N wide characters of SRC to DEST. */ 245 extern wchar_t *wmemcpy(wchar_t * __restrict __s1, const wchar_t * __restrict __s2, size_t __n) __THROW; 246 247 /* Copy N wide characters of SRC to DEST, guaranteeing 248 correct behavior for overlapping strings. */ 249 extern wchar_t *wmemmove(wchar_t * __s1, const wchar_t * __s2, size_t __n) __THROW; 250 251 /* Set N wide characters of S to C. */ 252 extern wchar_t *wmemset(wchar_t * __s, wchar_t __c, size_t __n) __THROW; 253 254 #ifdef __USE_GNU 255 /* Copy N wide characters of SRC to DEST and return pointer to following 256 wide character. */ 257 extern wchar_t *wmempcpy(wchar_t * __restrict __s1, const wchar_t * __restrict __s2, size_t __n) __THROW; 258 #endif 259 260 /* Determine whether C constitutes a valid (one-byte) multibyte 261 character. */ 262 extern wint_t btowc(int __c) __THROW; 263 264 /* Determine whether C corresponds to a member of the extended 265 character set whose multibyte representation is a single byte. */ 266 extern int wctob(wint_t __c) __THROW; 267 268 /* Determine whether PS points to an object representing the initial 269 state. */ 270 extern int mbsinit(const mbstate_t * __ps) 271 __THROW __attribute_pure__; 272 273 /* Write wide character representation of multibyte character pointed 274 to by S to PWC. */ 275 extern size_t mbrtowc(wchar_t * __restrict __pwc, const char *__restrict __s, size_t __n, mbstate_t * __restrict __p) __THROW; 276 277 /* Write multibyte representation of wide character WC to S. */ 278 extern size_t wcrtomb(char *__restrict __s, wchar_t __wc, mbstate_t * __restrict __ps) __THROW; 279 280 /* Return number of bytes in multibyte character pointed to by S. */ 281 extern size_t __mbrlen(const char *__restrict __s, size_t __n, mbstate_t * __restrict __ps) __THROW; 282 extern size_t mbrlen(const char *__restrict __s, size_t __n, mbstate_t * __restrict __ps) __THROW; 283 284 #ifdef __USE_EXTERN_INLINES 285 /* Define inline function as optimization. */ 286 287 /* We can use the BTOWC and WCTOB optimizations since we know that all 288 locales must use ASCII encoding for the values in the ASCII range 289 and because the wchar_t encoding is always ISO 10646. */ 290 extern wint_t __btowc_alias(int __c) __asm("btowc"); 291 __extern_inline wint_t __NTH(btowc(int __c)) 292 { 293 return (__builtin_constant_p(__c) && __c >= '\0' && __c <= '\x7f' ? (wint_t) __c : __btowc_alias(__c)); 294 } 295 296 extern int __wctob_alias(wint_t __c) __asm("wctob"); 297 __extern_inline int __NTH(wctob(wint_t __wc)) 298 { 299 return (__builtin_constant_p(__wc) && __wc >= L'\0' && __wc <= L'\x7f' ? (int)__wc : __wctob_alias(__wc)); 300 } 301 302 __extern_inline size_t __NTH(mbrlen(const char *__restrict __s, size_t __n, mbstate_t * __restrict __ps)) 303 { 304 return (__ps != NULL ? mbrtowc(NULL, __s, __n, __ps) : __mbrlen(__s, __n, NULL)); 305 } 306 #endif 307 308 /* Write wide character representation of multibyte character string 309 SRC to DST. */ 310 extern size_t mbsrtowcs(wchar_t * __restrict __dst, const char **__restrict __src, size_t __len, mbstate_t * __restrict __ps) __THROW; 311 312 /* Write multibyte character representation of wide character string 313 SRC to DST. */ 314 extern size_t wcsrtombs(char *__restrict __dst, const wchar_t ** __restrict __src, size_t __len, mbstate_t * __restrict __ps) __THROW; 315 316 #ifdef __USE_XOPEN2K8 317 /* Write wide character representation of at most NMC bytes of the 318 multibyte character string SRC to DST. */ 319 extern size_t mbsnrtowcs(wchar_t * __restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t * __restrict __ps) __THROW; 320 321 /* Write multibyte character representation of at most NWC characters 322 from the wide character string SRC to DST. */ 323 extern size_t wcsnrtombs(char *__restrict __dst, const wchar_t ** __restrict __src, size_t __nwc, size_t __len, mbstate_t * __restrict __ps) __THROW; 324 #endif /* use POSIX 2008 */ 325 326 /* The following functions are extensions found in X/Open CAE. */ 327 #ifdef __USE_XOPEN 328 /* Determine number of column positions required for C. */ 329 extern int wcwidth(wchar_t __c) __THROW; 330 331 /* Determine number of column positions required for first N wide 332 characters (or fewer if S ends before this) in S. */ 333 extern int wcswidth(const wchar_t * __s, size_t __n) __THROW; 334 #endif /* Use X/Open. */ 335 336 /* Convert initial portion of the wide string NPTR to `double' 337 representation. */ 338 extern double wcstod(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; 339 340 #ifdef __USE_ISOC99 341 /* Likewise for `float' and `long double' sizes of floating-point numbers. */ 342 extern float wcstof(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; 343 extern long double wcstold(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; 344 #endif /* C99 */ 345 346 /* Likewise for `_FloatN' and `_FloatNx' when support is enabled. */ 347 348 #if __HAVE_FLOAT16 && defined __USE_GNU 349 extern _Float16 wcstof16(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; 350 #endif 351 352 #if __HAVE_FLOAT32 && defined __USE_GNU 353 extern _Float32 wcstof32(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; 354 #endif 355 356 #if __HAVE_FLOAT64 && defined __USE_GNU 357 extern _Float64 wcstof64(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; 358 #endif 359 360 #if __HAVE_FLOAT128 && defined __USE_GNU 361 extern _Float128 wcstof128(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; 362 #endif 363 364 #if __HAVE_FLOAT32X && defined __USE_GNU 365 extern _Float32x wcstof32x(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; 366 #endif 367 368 #if __HAVE_FLOAT64X && defined __USE_GNU 369 extern _Float64x wcstof64x(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; 370 #endif 371 372 #if __HAVE_FLOAT128X && defined __USE_GNU 373 extern _Float128x wcstof128x(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr) __THROW; 374 #endif 375 376 /* Convert initial portion of wide string NPTR to `long int' 377 representation. */ 378 extern long int wcstol(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; 379 380 /* Convert initial portion of wide string NPTR to `unsigned long int' 381 representation. */ 382 extern unsigned long int wcstoul(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; 383 384 #ifdef __USE_ISOC99 385 /* Convert initial portion of wide string NPTR to `long long int' 386 representation. */ 387 __extension__ extern long long int wcstoll(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; 388 389 /* Convert initial portion of wide string NPTR to `unsigned long long int' 390 representation. */ 391 __extension__ extern unsigned long long int wcstoull(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; 392 #endif /* ISO C99. */ 393 394 #ifdef __USE_GNU 395 /* Convert initial portion of wide string NPTR to `long long int' 396 representation. */ 397 __extension__ extern long long int wcstoq(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; 398 399 /* Convert initial portion of wide string NPTR to `unsigned long long int' 400 representation. */ 401 __extension__ extern unsigned long long int wcstouq(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base) __THROW; 402 #endif /* Use GNU. */ 403 404 #ifdef __USE_GNU 405 /* Parallel versions of the functions above which take the locale to 406 use as an additional parameter. These are GNU extensions inspired 407 by the POSIX.1-2008 extended locale API. */ 408 extern long int wcstol_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, locale_t __loc) __THROW; 409 410 extern unsigned long int wcstoul_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, locale_t __loc) __THROW; 411 412 __extension__ extern long long int wcstoll_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, locale_t __loc) __THROW; 413 414 __extension__ extern unsigned long long int wcstoull_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, locale_t __loc) __THROW; 415 416 extern double wcstod_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; 417 418 extern float wcstof_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; 419 420 extern long double wcstold_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; 421 422 # if __HAVE_FLOAT16 423 extern _Float16 wcstof16_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; 424 # endif 425 426 # if __HAVE_FLOAT32 427 extern _Float32 wcstof32_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; 428 # endif 429 430 # if __HAVE_FLOAT64 431 extern _Float64 wcstof64_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; 432 # endif 433 434 # if __HAVE_FLOAT128 435 extern _Float128 wcstof128_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; 436 # endif 437 438 # if __HAVE_FLOAT32X 439 extern _Float32x wcstof32x_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; 440 # endif 441 442 # if __HAVE_FLOAT64X 443 extern _Float64x wcstof64x_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; 444 # endif 445 446 # if __HAVE_FLOAT128X 447 extern _Float128x wcstof128x_l(const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, locale_t __loc) __THROW; 448 # endif 449 #endif /* use GNU */ 450 451 #ifdef __USE_XOPEN2K8 452 /* Copy SRC to DEST, returning the address of the terminating L'\0' in 453 DEST. */ 454 extern wchar_t *wcpcpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src) __THROW; 455 456 /* Copy no more than N characters of SRC to DEST, returning the address of 457 the last character written into DEST. */ 458 extern wchar_t *wcpncpy(wchar_t * __restrict __dest, const wchar_t * __restrict __src, size_t __n) __THROW; 459 #endif 460 461 /* Wide character I/O functions. */ 462 463 #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2) 464 /* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces 465 a wide character string. */ 466 extern __FILE *open_wmemstream(wchar_t ** __bufloc, size_t * __sizeloc) __THROW; 467 #endif 468 469 #if defined __USE_ISOC95 || defined __USE_UNIX98 470 471 /* Select orientation for stream. */ 472 extern int fwide(__FILE * __fp, int __mode) __THROW; 473 474 /* Write formatted output to STREAM. 475 476 This function is a possible cancellation point and therefore not 477 marked with __THROW. */ 478 extern int fwprintf(__FILE * __restrict __stream, const wchar_t * __restrict __format, ...) 479 /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */ ; 480 /* Write formatted output to stdout. 481 482 This function is a possible cancellation point and therefore not 483 marked with __THROW. */ 484 extern int wprintf(const wchar_t * __restrict __format, ...) 485 /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */ ; 486 /* Write formatted output of at most N characters to S. */ 487 extern int swprintf(wchar_t * __restrict __s, size_t __n, const wchar_t * __restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */ ; 488 489 /* Write formatted output to S from argument list ARG. 490 491 This function is a possible cancellation point and therefore not 492 marked with __THROW. */ 493 extern int vfwprintf(__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) 494 /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */ ; 495 /* Write formatted output to stdout from argument list ARG. 496 497 This function is a possible cancellation point and therefore not 498 marked with __THROW. */ 499 extern int vwprintf(const wchar_t * __restrict __format, __gnuc_va_list __arg) 500 /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */ ; 501 /* Write formatted output of at most N character to S from argument 502 list ARG. */ 503 extern int vswprintf(wchar_t * __restrict __s, size_t __n, const wchar_t * __restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */ ; 504 505 /* Read formatted input from STREAM. 506 507 This function is a possible cancellation point and therefore not 508 marked with __THROW. */ 509 extern int fwscanf(__FILE * __restrict __stream, const wchar_t * __restrict __format, ...) 510 /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; 511 /* Read formatted input from stdin. 512 513 This function is a possible cancellation point and therefore not 514 marked with __THROW. */ 515 extern int wscanf(const wchar_t * __restrict __format, ...) 516 /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */ ; 517 /* Read formatted input from S. */ 518 extern int swscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; 519 520 # if defined __USE_ISOC99 && !defined __USE_GNU \ 521 && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ 522 && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) 523 # ifdef __REDIRECT 524 /* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[ 525 GNU extension which conflicts with valid %a followed by letter 526 s, S or [. */ 527 extern int __REDIRECT(fwscanf, (__FILE * __restrict __stream, const wchar_t * __restrict __format, ...), __isoc99_fwscanf) 528 /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; 529 extern int __REDIRECT(wscanf, (const wchar_t * __restrict __format, ...), __isoc99_wscanf) 530 /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */ ; 531 extern int __REDIRECT_NTH(swscanf, (const wchar_t * __restrict __s, const wchar_t * __restrict __format, ...), __isoc99_swscanf) 532 /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */ ; 533 # else 534 extern int __isoc99_fwscanf(__FILE * __restrict __stream, const wchar_t * __restrict __format, ...); 535 extern int __isoc99_wscanf(const wchar_t * __restrict __format, ...); 536 extern int __isoc99_swscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, ...) __THROW; 537 # define fwscanf __isoc99_fwscanf 538 # define wscanf __isoc99_wscanf 539 # define swscanf __isoc99_swscanf 540 # endif 541 # endif 542 543 #endif /* Use ISO C95, C99 and Unix98. */ 544 545 #ifdef __USE_ISOC99 546 /* Read formatted input from S into argument list ARG. 547 548 This function is a possible cancellation point and therefore not 549 marked with __THROW. */ 550 extern int vfwscanf(__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) 551 /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; 552 /* Read formatted input from stdin into argument list ARG. 553 554 This function is a possible cancellation point and therefore not 555 marked with __THROW. */ 556 extern int vwscanf(const wchar_t * __restrict __format, __gnuc_va_list __arg) 557 /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */ ; 558 /* Read formatted input from S into argument list ARG. */ 559 extern int vswscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; 560 561 # if !defined __USE_GNU \ 562 && (!defined __LDBL_COMPAT || !defined __REDIRECT) \ 563 && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K) 564 # ifdef __REDIRECT 565 extern int __REDIRECT(vfwscanf, (__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg), __isoc99_vfwscanf) 566 /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; 567 extern int __REDIRECT(vwscanf, (const wchar_t * __restrict __format, __gnuc_va_list __arg), __isoc99_vwscanf) 568 /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */ ; 569 extern int __REDIRECT_NTH(vswscanf, (const wchar_t * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg), __isoc99_vswscanf) 570 /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */ ; 571 # else 572 extern int __isoc99_vfwscanf(__FILE * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg); 573 extern int __isoc99_vwscanf(const wchar_t * __restrict __format, __gnuc_va_list __arg); 574 extern int __isoc99_vswscanf(const wchar_t * __restrict __s, const wchar_t * __restrict __format, __gnuc_va_list __arg) __THROW; 575 # define vfwscanf __isoc99_vfwscanf 576 # define vwscanf __isoc99_vwscanf 577 # define vswscanf __isoc99_vswscanf 578 # endif 579 # endif 580 581 #endif /* Use ISO C99. */ 582 583 /* Read a character from STREAM. 584 585 These functions are possible cancellation points and therefore not 586 marked with __THROW. */ 587 extern wint_t fgetwc(__FILE * __stream); 588 extern wint_t getwc(__FILE * __stream); 589 590 /* Read a character from stdin. 591 592 This function is a possible cancellation point and therefore not 593 marked with __THROW. */ 594 extern wint_t getwchar(void); 595 596 /* Write a character to STREAM. 597 598 These functions are possible cancellation points and therefore not 599 marked with __THROW. */ 600 extern wint_t fputwc(wchar_t __wc, __FILE * __stream); 601 extern wint_t putwc(wchar_t __wc, __FILE * __stream); 602 603 /* Write a character to stdout. 604 605 This function is a possible cancellation point and therefore not 606 marked with __THROW. */ 607 extern wint_t putwchar(wchar_t __wc); 608 609 /* Get a newline-terminated wide character string of finite length 610 from STREAM. 611 612 This function is a possible cancellation point and therefore not 613 marked with __THROW. */ 614 extern wchar_t *fgetws(wchar_t * __restrict __ws, int __n, __FILE * __restrict __stream); 615 616 /* Write a string to STREAM. 617 618 This function is a possible cancellation point and therefore not 619 marked with __THROW. */ 620 extern int fputws(const wchar_t * __restrict __ws, __FILE * __restrict __stream); 621 622 /* Push a character back onto the input buffer of STREAM. 623 624 This function is a possible cancellation point and therefore not 625 marked with __THROW. */ 626 extern wint_t ungetwc(wint_t __wc, __FILE * __stream); 627 628 #ifdef __USE_GNU 629 /* These are defined to be equivalent to the `char' functions defined 630 in POSIX.1:1996. 631 632 These functions are not part of POSIX and therefore no official 633 cancellation point. But due to similarity with an POSIX interface 634 or due to the implementation they are cancellation points and 635 therefore not marked with __THROW. */ 636 extern wint_t getwc_unlocked(__FILE * __stream); 637 extern wint_t getwchar_unlocked(void); 638 639 /* This is the wide character version of a GNU extension. 640 641 This function is not part of POSIX and therefore no official 642 cancellation point. But due to similarity with an POSIX interface 643 or due to the implementation it is a cancellation point and 644 therefore not marked with __THROW. */ 645 extern wint_t fgetwc_unlocked(__FILE * __stream); 646 647 /* Faster version when locking is not necessary. 648 649 This function is not part of POSIX and therefore no official 650 cancellation point. But due to similarity with an POSIX interface 651 or due to the implementation it is a cancellation point and 652 therefore not marked with __THROW. */ 653 extern wint_t fputwc_unlocked(wchar_t __wc, __FILE * __stream); 654 655 /* These are defined to be equivalent to the `char' functions defined 656 in POSIX.1:1996. 657 658 These functions are not part of POSIX and therefore no official 659 cancellation point. But due to similarity with an POSIX interface 660 or due to the implementation they are cancellation points and 661 therefore not marked with __THROW. */ 662 extern wint_t putwc_unlocked(wchar_t __wc, __FILE * __stream); 663 extern wint_t putwchar_unlocked(wchar_t __wc); 664 665 /* This function does the same as `fgetws' but does not lock the stream. 666 667 This function is not part of POSIX and therefore no official 668 cancellation point. But due to similarity with an POSIX interface 669 or due to the implementation it is a cancellation point and 670 therefore not marked with __THROW. */ 671 extern wchar_t *fgetws_unlocked(wchar_t * __restrict __ws, int __n, __FILE * __restrict __stream); 672 673 /* This function does the same as `fputws' but does not lock the stream. 674 675 This function is not part of POSIX and therefore no official 676 cancellation point. But due to similarity with an POSIX interface 677 or due to the implementation it is a cancellation point and 678 therefore not marked with __THROW. */ 679 extern int fputws_unlocked(const wchar_t * __restrict __ws, __FILE * __restrict __stream); 680 #endif 681 682 /* Format TP into S according to FORMAT. 683 Write no more than MAXSIZE wide characters and return the number 684 of wide characters written, or 0 if it would exceed MAXSIZE. */ 685 extern size_t wcsftime(wchar_t * __restrict __s, size_t __maxsize, const wchar_t * __restrict __format, const struct tm *__restrict __tp) __THROW; 686 687 # ifdef __USE_GNU 688 /* Similar to `wcsftime' but takes the information from 689 the provided locale and not the global locale. */ 690 extern size_t wcsftime_l(wchar_t * __restrict __s, size_t __maxsize, const wchar_t * __restrict __format, const struct tm *__restrict __tp, locale_t __loc) __THROW; 691 # endif 692 693 /* Define some macros helping to catch buffer overflows. */ 694 #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function 695 # include <bits/wchar2.h> 696 #endif 697 698 #ifdef __LDBL_COMPAT 699 # include <bits/wchar-ldbl.h> 700 #endif 701 702 __END_DECLS 703 #endif /* wchar.h */