annotate libcxx/include/wchar.h @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 79ff65ed7e25
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // -*- C++ -*-
anatofuz
parents:
diff changeset
2 //===--------------------------- wchar.h ----------------------------------===//
anatofuz
parents:
diff changeset
3 //
anatofuz
parents:
diff changeset
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
5 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
7 //
anatofuz
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
9
anatofuz
parents:
diff changeset
10 #if defined(__need_wint_t) || defined(__need_mbstate_t)
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
anatofuz
parents:
diff changeset
13 #pragma GCC system_header
anatofuz
parents:
diff changeset
14 #endif
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 #include_next <wchar.h>
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 #elif !defined(_LIBCPP_WCHAR_H)
anatofuz
parents:
diff changeset
19 #define _LIBCPP_WCHAR_H
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 /*
anatofuz
parents:
diff changeset
22 wchar.h synopsis
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 Macros:
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 NULL
anatofuz
parents:
diff changeset
27 WCHAR_MAX
anatofuz
parents:
diff changeset
28 WCHAR_MIN
anatofuz
parents:
diff changeset
29 WEOF
anatofuz
parents:
diff changeset
30
anatofuz
parents:
diff changeset
31 Types:
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 mbstate_t
anatofuz
parents:
diff changeset
34 size_t
anatofuz
parents:
diff changeset
35 tm
anatofuz
parents:
diff changeset
36 wint_t
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...);
anatofuz
parents:
diff changeset
39 int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...);
anatofuz
parents:
diff changeset
40 int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...);
anatofuz
parents:
diff changeset
41 int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...);
anatofuz
parents:
diff changeset
42 int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg);
anatofuz
parents:
diff changeset
43 int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg); // C99
anatofuz
parents:
diff changeset
44 int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg);
anatofuz
parents:
diff changeset
45 int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg); // C99
anatofuz
parents:
diff changeset
46 int vwprintf(const wchar_t* restrict format, va_list arg);
anatofuz
parents:
diff changeset
47 int vwscanf(const wchar_t* restrict format, va_list arg); // C99
anatofuz
parents:
diff changeset
48 int wprintf(const wchar_t* restrict format, ...);
anatofuz
parents:
diff changeset
49 int wscanf(const wchar_t* restrict format, ...);
anatofuz
parents:
diff changeset
50 wint_t fgetwc(FILE* stream);
anatofuz
parents:
diff changeset
51 wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream);
anatofuz
parents:
diff changeset
52 wint_t fputwc(wchar_t c, FILE* stream);
anatofuz
parents:
diff changeset
53 int fputws(const wchar_t* restrict s, FILE* restrict stream);
anatofuz
parents:
diff changeset
54 int fwide(FILE* stream, int mode);
anatofuz
parents:
diff changeset
55 wint_t getwc(FILE* stream);
anatofuz
parents:
diff changeset
56 wint_t getwchar();
anatofuz
parents:
diff changeset
57 wint_t putwc(wchar_t c, FILE* stream);
anatofuz
parents:
diff changeset
58 wint_t putwchar(wchar_t c);
anatofuz
parents:
diff changeset
59 wint_t ungetwc(wint_t c, FILE* stream);
anatofuz
parents:
diff changeset
60 double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr);
anatofuz
parents:
diff changeset
61 float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99
anatofuz
parents:
diff changeset
62 long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr); // C99
anatofuz
parents:
diff changeset
63 long wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
anatofuz
parents:
diff changeset
64 long long wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99
anatofuz
parents:
diff changeset
65 unsigned long wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
anatofuz
parents:
diff changeset
66 unsigned long long wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); // C99
anatofuz
parents:
diff changeset
67 wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2);
anatofuz
parents:
diff changeset
68 wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
anatofuz
parents:
diff changeset
69 wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2);
anatofuz
parents:
diff changeset
70 wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
anatofuz
parents:
diff changeset
71 int wcscmp(const wchar_t* s1, const wchar_t* s2);
anatofuz
parents:
diff changeset
72 int wcscoll(const wchar_t* s1, const wchar_t* s2);
anatofuz
parents:
diff changeset
73 int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n);
anatofuz
parents:
diff changeset
74 size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
anatofuz
parents:
diff changeset
75 const wchar_t* wcschr(const wchar_t* s, wchar_t c);
anatofuz
parents:
diff changeset
76 wchar_t* wcschr( wchar_t* s, wchar_t c);
anatofuz
parents:
diff changeset
77 size_t wcscspn(const wchar_t* s1, const wchar_t* s2);
anatofuz
parents:
diff changeset
78 size_t wcslen(const wchar_t* s);
anatofuz
parents:
diff changeset
79 const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2);
anatofuz
parents:
diff changeset
80 wchar_t* wcspbrk( wchar_t* s1, const wchar_t* s2);
anatofuz
parents:
diff changeset
81 const wchar_t* wcsrchr(const wchar_t* s, wchar_t c);
anatofuz
parents:
diff changeset
82 wchar_t* wcsrchr( wchar_t* s, wchar_t c);
anatofuz
parents:
diff changeset
83 size_t wcsspn(const wchar_t* s1, const wchar_t* s2);
anatofuz
parents:
diff changeset
84 const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2);
anatofuz
parents:
diff changeset
85 wchar_t* wcsstr( wchar_t* s1, const wchar_t* s2);
anatofuz
parents:
diff changeset
86 wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr);
anatofuz
parents:
diff changeset
87 const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n);
anatofuz
parents:
diff changeset
88 wchar_t* wmemchr( wchar_t* s, wchar_t c, size_t n);
anatofuz
parents:
diff changeset
89 int wmemcmp(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
anatofuz
parents:
diff changeset
90 wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
anatofuz
parents:
diff changeset
91 wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n);
anatofuz
parents:
diff changeset
92 wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n);
anatofuz
parents:
diff changeset
93 size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format,
anatofuz
parents:
diff changeset
94 const tm* restrict timeptr);
anatofuz
parents:
diff changeset
95 wint_t btowc(int c);
anatofuz
parents:
diff changeset
96 int wctob(wint_t c);
anatofuz
parents:
diff changeset
97 int mbsinit(const mbstate_t* ps);
anatofuz
parents:
diff changeset
98 size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps);
anatofuz
parents:
diff changeset
99 size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps);
anatofuz
parents:
diff changeset
100 size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps);
anatofuz
parents:
diff changeset
101 size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len,
anatofuz
parents:
diff changeset
102 mbstate_t* restrict ps);
anatofuz
parents:
diff changeset
103 size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
anatofuz
parents:
diff changeset
104 mbstate_t* restrict ps);
anatofuz
parents:
diff changeset
105
anatofuz
parents:
diff changeset
106 */
anatofuz
parents:
diff changeset
107
anatofuz
parents:
diff changeset
108 #include <__config>
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
109 #include <stddef.h>
150
anatofuz
parents:
diff changeset
110
anatofuz
parents:
diff changeset
111 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
anatofuz
parents:
diff changeset
112 #pragma GCC system_header
anatofuz
parents:
diff changeset
113 #endif
anatofuz
parents:
diff changeset
114
anatofuz
parents:
diff changeset
115 #ifdef __cplusplus
anatofuz
parents:
diff changeset
116 #define __CORRECT_ISO_CPP_WCHAR_H_PROTO
anatofuz
parents:
diff changeset
117 #endif
anatofuz
parents:
diff changeset
118
anatofuz
parents:
diff changeset
119 #include_next <wchar.h>
anatofuz
parents:
diff changeset
120
anatofuz
parents:
diff changeset
121 // Determine whether we have const-correct overloads for wcschr and friends.
anatofuz
parents:
diff changeset
122 #if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_)
anatofuz
parents:
diff changeset
123 # define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
anatofuz
parents:
diff changeset
124 #elif defined(__GLIBC_PREREQ)
anatofuz
parents:
diff changeset
125 # if __GLIBC_PREREQ(2, 10)
anatofuz
parents:
diff changeset
126 # define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
anatofuz
parents:
diff changeset
127 # endif
anatofuz
parents:
diff changeset
128 #elif defined(_LIBCPP_MSVCRT)
anatofuz
parents:
diff changeset
129 # if defined(_CRT_CONST_CORRECT_OVERLOADS)
anatofuz
parents:
diff changeset
130 # define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
anatofuz
parents:
diff changeset
131 # endif
anatofuz
parents:
diff changeset
132 #endif
anatofuz
parents:
diff changeset
133
anatofuz
parents:
diff changeset
134 #if defined(__cplusplus) && !defined(_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD)
anatofuz
parents:
diff changeset
135 extern "C++" {
anatofuz
parents:
diff changeset
136 inline _LIBCPP_INLINE_VISIBILITY
anatofuz
parents:
diff changeset
137 wchar_t* __libcpp_wcschr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcschr(__s, __c);}
anatofuz
parents:
diff changeset
138 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
anatofuz
parents:
diff changeset
139 const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
anatofuz
parents:
diff changeset
140 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
anatofuz
parents:
diff changeset
141 wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return __libcpp_wcschr(__s, __c);}
anatofuz
parents:
diff changeset
142
anatofuz
parents:
diff changeset
143 inline _LIBCPP_INLINE_VISIBILITY
anatofuz
parents:
diff changeset
144 wchar_t* __libcpp_wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcspbrk(__s1, __s2);}
anatofuz
parents:
diff changeset
145 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
anatofuz
parents:
diff changeset
146 const wchar_t* wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcspbrk(__s1, __s2);}
anatofuz
parents:
diff changeset
147 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
anatofuz
parents:
diff changeset
148 wchar_t* wcspbrk( wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcspbrk(__s1, __s2);}
anatofuz
parents:
diff changeset
149
anatofuz
parents:
diff changeset
150 inline _LIBCPP_INLINE_VISIBILITY
anatofuz
parents:
diff changeset
151 wchar_t* __libcpp_wcsrchr(const wchar_t* __s, wchar_t __c) {return (wchar_t*)wcsrchr(__s, __c);}
anatofuz
parents:
diff changeset
152 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
anatofuz
parents:
diff changeset
153 const wchar_t* wcsrchr(const wchar_t* __s, wchar_t __c) {return __libcpp_wcsrchr(__s, __c);}
anatofuz
parents:
diff changeset
154 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
anatofuz
parents:
diff changeset
155 wchar_t* wcsrchr( wchar_t* __s, wchar_t __c) {return __libcpp_wcsrchr(__s, __c);}
anatofuz
parents:
diff changeset
156
anatofuz
parents:
diff changeset
157 inline _LIBCPP_INLINE_VISIBILITY
anatofuz
parents:
diff changeset
158 wchar_t* __libcpp_wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return (wchar_t*)wcsstr(__s1, __s2);}
anatofuz
parents:
diff changeset
159 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
anatofuz
parents:
diff changeset
160 const wchar_t* wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcsstr(__s1, __s2);}
anatofuz
parents:
diff changeset
161 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
anatofuz
parents:
diff changeset
162 wchar_t* wcsstr( wchar_t* __s1, const wchar_t* __s2) {return __libcpp_wcsstr(__s1, __s2);}
anatofuz
parents:
diff changeset
163
anatofuz
parents:
diff changeset
164 inline _LIBCPP_INLINE_VISIBILITY
anatofuz
parents:
diff changeset
165 wchar_t* __libcpp_wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return (wchar_t*)wmemchr(__s, __c, __n);}
anatofuz
parents:
diff changeset
166 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
anatofuz
parents:
diff changeset
167 const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);}
anatofuz
parents:
diff changeset
168 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
anatofuz
parents:
diff changeset
169 wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return __libcpp_wmemchr(__s, __c, __n);}
anatofuz
parents:
diff changeset
170 }
anatofuz
parents:
diff changeset
171 #endif
anatofuz
parents:
diff changeset
172
anatofuz
parents:
diff changeset
173 #if defined(__cplusplus) && defined(_LIBCPP_MSVCRT_LIKE)
anatofuz
parents:
diff changeset
174 extern "C" {
anatofuz
parents:
diff changeset
175 size_t mbsnrtowcs(wchar_t *__restrict dst, const char **__restrict src,
anatofuz
parents:
diff changeset
176 size_t nmc, size_t len, mbstate_t *__restrict ps);
anatofuz
parents:
diff changeset
177 size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
anatofuz
parents:
diff changeset
178 size_t nwc, size_t len, mbstate_t *__restrict ps);
anatofuz
parents:
diff changeset
179 } // extern "C++"
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
180 #endif // __cplusplus && _LIBCPP_MSVCRT
150
anatofuz
parents:
diff changeset
181
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
182 #endif // _LIBCPP_WCHAR_H