| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2008 The Android Open Source Project | 
|  | 3 | * All rights reserved. | 
|  | 4 | * | 
|  | 5 | * Redistribution and use in source and binary forms, with or without | 
|  | 6 | * modification, are permitted provided that the following conditions | 
|  | 7 | * are met: | 
|  | 8 | *  * Redistributions of source code must retain the above copyright | 
|  | 9 | *    notice, this list of conditions and the following disclaimer. | 
|  | 10 | *  * Redistributions in binary form must reproduce the above copyright | 
|  | 11 | *    notice, this list of conditions and the following disclaimer in | 
|  | 12 | *    the documentation and/or other materials provided with the | 
|  | 13 | *    distribution. | 
|  | 14 | * | 
|  | 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 
|  | 16 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 
|  | 17 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 
|  | 18 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | 
|  | 19 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | 
|  | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | 
|  | 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | 
|  | 22 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 
|  | 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 
|  | 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | 
|  | 25 | * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 
|  | 26 | * SUCH DAMAGE. | 
|  | 27 | */ | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 28 |  | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 29 | #ifndef _WCHAR_H_ | 
|  | 30 | #define _WCHAR_H_ | 
|  | 31 |  | 
|  | 32 | #include <sys/cdefs.h> | 
|  | 33 | #include <stdio.h> | 
|  | 34 |  | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 35 | #include <stdarg.h> | 
| Elliott Hughes | 0cc0d25 | 2012-10-01 15:12:40 -0700 | [diff] [blame] | 36 | #include <stddef.h> | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 37 | #include <time.h> | 
| Elliott Hughes | b20c244 | 2014-11-06 15:04:08 -0800 | [diff] [blame] | 38 | #include <xlocale.h> | 
| Elliott Hughes | 83c07b5 | 2014-04-21 18:09:46 -0700 | [diff] [blame] | 39 |  | 
| Elliott Hughes | 0fe8885 | 2016-07-27 10:45:05 -0700 | [diff] [blame] | 40 | #include <bits/mbstate_t.h> | 
| Elliott Hughes | 5704c42 | 2016-01-25 18:06:24 -0800 | [diff] [blame] | 41 | #include <bits/wchar_limits.h> | 
| Elliott Hughes | 7ba106c | 2016-04-28 18:22:06 -0700 | [diff] [blame] | 42 | #include <bits/wctype.h> | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 43 |  | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 44 | __BEGIN_DECLS | 
|  | 45 |  | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 46 | wint_t btowc(int __ch); | 
|  | 47 | int fwprintf(FILE* __fp, const wchar_t* __fmt, ...); | 
|  | 48 | int fwscanf(FILE* __fp, const wchar_t* __fmt, ...); | 
|  | 49 | wint_t fgetwc(FILE* __fp); | 
|  | 50 | wchar_t* fgetws(wchar_t* __buf, int __size, FILE* __fp); | 
|  | 51 | wint_t fputwc(wchar_t __wc, FILE* __fp); | 
|  | 52 | int fputws(const wchar_t* __s, FILE* __fp); | 
|  | 53 | int fwide(FILE* __fp, int __mode); | 
|  | 54 | wint_t getwc(FILE* __fp); | 
|  | 55 | wint_t getwchar(void); | 
|  | 56 | int mbsinit(const mbstate_t* __ps); | 
|  | 57 | size_t mbrlen(const char* __s, size_t __n, mbstate_t* __ps); | 
|  | 58 | size_t mbrtowc(wchar_t* __buf, const char* __s, size_t __n, mbstate_t* __ps); | 
|  | 59 | size_t mbsrtowcs(wchar_t* __dst, const char** __src, size_t __dst_n, mbstate_t* __ps); | 
|  | 60 | size_t mbsnrtowcs(wchar_t* __dst, const char** __src, size_t __src_n, size_t __dst_n, mbstate_t* __ps) __INTRODUCED_IN(21); | 
|  | 61 | wint_t putwc(wchar_t __wc, FILE* __fp); | 
|  | 62 | wint_t putwchar(wchar_t __wc); | 
|  | 63 | int swprintf(wchar_t* __buf, size_t __n, const wchar_t* __fmt, ...); | 
|  | 64 | int swscanf(const wchar_t* __s, const wchar_t* __fmt, ...); | 
|  | 65 | wint_t ungetwc(wint_t __wc, FILE* __fp); | 
|  | 66 | int vfwprintf(FILE* __fp, const wchar_t* __fmt, va_list __args); | 
|  | 67 | int vfwscanf(FILE* __fp, const wchar_t* __fmt, va_list __args) __INTRODUCED_IN(21); | 
|  | 68 | int vswprintf(wchar_t* __buf, size_t __n, const wchar_t* __fmt, va_list __args); | 
|  | 69 | int vswscanf(const wchar_t* __s, const wchar_t* __fmt, va_list __args) __INTRODUCED_IN(21); | 
|  | 70 | int vwprintf(const wchar_t* __fmt, va_list __args); | 
|  | 71 | int vwscanf(const wchar_t* __fmt, va_list __args) __INTRODUCED_IN(21); | 
|  | 72 | wchar_t* wcpcpy(wchar_t* __dst, const wchar_t* __src); | 
|  | 73 | wchar_t* wcpncpy(wchar_t* __dst, const wchar_t* __src, size_t __n); | 
|  | 74 | size_t wcrtomb(char* __buf, wchar_t __wc, mbstate_t* __ps); | 
|  | 75 | int wcscasecmp(const wchar_t* __lhs, const wchar_t* __rhs); | 
|  | 76 | int wcscasecmp_l(const wchar_t* __lhs, const wchar_t* __rhs, locale_t __l) __INTRODUCED_IN(23); | 
|  | 77 | wchar_t* wcscat(wchar_t* __dst, const wchar_t* __src); | 
|  | 78 | wchar_t* wcschr(const wchar_t* __s, wchar_t __wc); | 
|  | 79 | int wcscmp(const wchar_t* __lhs, const wchar_t* __rhs); | 
|  | 80 | int wcscoll(const wchar_t* __lhs, const wchar_t* __rhs); | 
|  | 81 | wchar_t* wcscpy(wchar_t* __dst, const wchar_t* __src); | 
|  | 82 | size_t wcscspn(const wchar_t* __s, const wchar_t* __accept); | 
|  | 83 | size_t wcsftime(wchar_t* __buf, size_t __n, const wchar_t* __fmt, const struct tm* __tm); | 
| Elliott Hughes | 3376c23 | 2018-02-13 23:14:12 -0800 | [diff] [blame] | 84 | size_t wcsftime_l(wchar_t* __buf, size_t __n, const wchar_t* __fmt, const struct tm* __tm, locale_t __l) __INTRODUCED_IN(28); | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 85 | size_t wcslen(const wchar_t* __s); | 
|  | 86 | int wcsncasecmp(const wchar_t* __lhs, const wchar_t* __rhs, size_t __n); | 
|  | 87 | int wcsncasecmp_l(const wchar_t* __lhs, const wchar_t* __rhs, size_t __n, locale_t __l) __INTRODUCED_IN(23); | 
|  | 88 | wchar_t* wcsncat(wchar_t* __dst, const wchar_t* __src, size_t __n); | 
|  | 89 | int wcsncmp(const wchar_t* __lhs, const wchar_t* __rhs, size_t __n); | 
|  | 90 | wchar_t* wcsncpy(wchar_t* __dst, const wchar_t* __src, size_t __n); | 
|  | 91 | size_t wcsnrtombs(char* __dst, const wchar_t** __src, size_t __src_n, size_t __dst_n, mbstate_t* __ps) __INTRODUCED_IN(21); | 
|  | 92 | wchar_t* wcspbrk(const wchar_t* __s, const wchar_t* __accept); | 
|  | 93 | wchar_t* wcsrchr(const wchar_t* __s, wchar_t __wc); | 
|  | 94 | size_t wcsrtombs(char* __dst, const wchar_t** __src, size_t __dst_n, mbstate_t* __ps); | 
|  | 95 | size_t wcsspn(const wchar_t* __s, const wchar_t* __accept); | 
|  | 96 | wchar_t* wcsstr(const wchar_t* __haystack, const wchar_t* __needle); | 
|  | 97 | double wcstod(const wchar_t* __s, wchar_t** __end_ptr); | 
| Elliott Hughes | 3376c23 | 2018-02-13 23:14:12 -0800 | [diff] [blame] | 98 | double wcstod_l(const wchar_t* __s, wchar_t** __end_ptr, locale_t __l) __INTRODUCED_IN(28); | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 99 | float wcstof(const wchar_t* __s, wchar_t** __end_ptr) __INTRODUCED_IN(21); | 
| Elliott Hughes | 3376c23 | 2018-02-13 23:14:12 -0800 | [diff] [blame] | 100 | float wcstof_l(const wchar_t* __s, wchar_t** __end_ptr, locale_t __l) __INTRODUCED_IN(28); | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 101 | wchar_t* wcstok(wchar_t* __s, const wchar_t* __delimiter, wchar_t** __ptr); | 
|  | 102 | long wcstol(const wchar_t* __s, wchar_t** __end_ptr, int __base); | 
| Elliott Hughes | 3376c23 | 2018-02-13 23:14:12 -0800 | [diff] [blame] | 103 | long wcstol_l(const wchar_t* __s, wchar_t** __end_ptr, int __base, locale_t __l) __INTRODUCED_IN(28); | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 104 | long long wcstoll(const wchar_t* __s, wchar_t** __end_ptr, int __base) __INTRODUCED_IN(21); | 
| Elliott Hughes | 50cda38 | 2017-09-14 15:30:08 -0700 | [diff] [blame] | 105 | long double wcstold(const wchar_t* __s, wchar_t** __end_ptr) __RENAME_LDBL(wcstod, 3, 21); | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 106 | unsigned long wcstoul(const wchar_t* __s, wchar_t** __end_ptr, int __base); | 
| Elliott Hughes | 3376c23 | 2018-02-13 23:14:12 -0800 | [diff] [blame] | 107 | unsigned long wcstoul_l(const wchar_t* __s, wchar_t** __end_ptr, int __base, locale_t __l) __INTRODUCED_IN(28); | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 108 | unsigned long long wcstoull(const wchar_t* __s, wchar_t** __end_ptr, int __base) __INTRODUCED_IN(21); | 
|  | 109 | int wcswidth(const wchar_t* __s, size_t __n); | 
|  | 110 | size_t wcsxfrm(wchar_t* __dst, const wchar_t* __src, size_t __n); | 
|  | 111 | int wctob(wint_t __wc); | 
|  | 112 | int wcwidth(wchar_t __wc); | 
|  | 113 | wchar_t* wmemchr(const wchar_t* __src, wchar_t __wc, size_t __n); | 
|  | 114 | int wmemcmp(const wchar_t* __lhs, const wchar_t* __rhs, size_t __n); | 
|  | 115 | wchar_t* wmemcpy(wchar_t* __dst, const wchar_t* __src, size_t __n); | 
| Elliott Hughes | 3cfb52a | 2015-02-18 21:29:13 -0800 | [diff] [blame] | 116 | #if defined(__USE_GNU) | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 117 | wchar_t* wmempcpy(wchar_t* __dst, const wchar_t* __src, size_t __n) __INTRODUCED_IN(23); | 
| Elliott Hughes | 3cfb52a | 2015-02-18 21:29:13 -0800 | [diff] [blame] | 118 | #endif | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 119 | wchar_t* wmemmove(wchar_t* __dst, const wchar_t* __src, size_t __n); | 
|  | 120 | wchar_t* wmemset(wchar_t* __dst, wchar_t __wc, size_t __n); | 
|  | 121 | int wprintf(const wchar_t* __fmt, ...); | 
|  | 122 | int wscanf(const wchar_t* __fmt, ...); | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 123 |  | 
| Elliott Hughes | 5bc78c8 | 2016-11-16 11:35:43 -0800 | [diff] [blame] | 124 | #if __ANDROID_API__ >= __ANDROID_API_L__ | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 125 | long long wcstoll_l(const wchar_t* __s, wchar_t** __end_ptr, int __base, locale_t __l) __INTRODUCED_IN(21); | 
|  | 126 | unsigned long long wcstoull_l(const wchar_t* __s, wchar_t** __end_ptr, int __base, locale_t __l) __INTRODUCED_IN(21); | 
|  | 127 | long double wcstold_l(const wchar_t* __s, wchar_t** __end_ptr, locale_t __l) __INTRODUCED_IN(21); | 
| Dan Albert | dfb5ce4 | 2014-07-09 22:51:34 +0000 | [diff] [blame] | 128 |  | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 129 | int wcscoll_l(const wchar_t* __lhs, const wchar_t* __rhs, locale_t __l) __attribute_pure__ | 
| Dan Albert | f45d76a | 2016-09-21 01:57:51 -0700 | [diff] [blame] | 130 | __INTRODUCED_IN(21); | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 131 | size_t wcsxfrm_l(wchar_t* __dst, const wchar_t* __src, size_t __n, locale_t __l) __INTRODUCED_IN(21); | 
| Josh Gao | 6cd9fb0 | 2016-09-23 14:06:05 -0700 | [diff] [blame] | 132 | #else | 
|  | 133 | // Implemented as static inlines before 21. | 
|  | 134 | #endif | 
| Dan Albert | dfb5ce4 | 2014-07-09 22:51:34 +0000 | [diff] [blame] | 135 |  | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 136 | size_t wcslcat(wchar_t* __dst, const wchar_t* __src, size_t __n); | 
|  | 137 | size_t wcslcpy(wchar_t* __dst, const wchar_t* __src, size_t __n); | 
| Elliott Hughes | 53e4329 | 2014-02-24 18:00:43 -0800 | [diff] [blame] | 138 |  | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 139 | FILE* open_wmemstream(wchar_t** __ptr, size_t* __size_ptr) __INTRODUCED_IN(23); | 
|  | 140 | wchar_t* wcsdup(const wchar_t* __s); | 
|  | 141 | size_t wcsnlen(const wchar_t* __s, size_t __n); | 
| Elliott Hughes | eb93ebf | 2013-03-01 18:35:56 -0800 | [diff] [blame] | 142 |  | 
| The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 143 | __END_DECLS | 
|  | 144 |  | 
| Elliott Hughes | ff26a16 | 2017-08-17 22:34:21 +0000 | [diff] [blame] | 145 | #endif |