1// -*- C++ -*-
2//===--------------------------- cwchar -----------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_CWCHAR
11#define _LIBCPP_CWCHAR
12
13/*
14    cwchar synopsis
15
16Macros:
17
18    NULL
19    WCHAR_MAX
20    WCHAR_MIN
21    WEOF
22
23namespace std
24{
25
26Types:
27
28    mbstate_t
29    size_t
30    tm
31    wint_t
32
33int fwprintf(FILE* restrict stream, const wchar_t* restrict format, ...);
34int fwscanf(FILE* restrict stream, const wchar_t* restrict format, ...);
35int swprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, ...);
36int swscanf(const wchar_t* restrict s, const wchar_t* restrict format, ...);
37int vfwprintf(FILE* restrict stream, const wchar_t* restrict format, va_list arg);
38int vfwscanf(FILE* restrict stream, const wchar_t* restrict format, va_list arg);  // C99
39int vswprintf(wchar_t* restrict s, size_t n, const wchar_t* restrict format, va_list arg);
40int vswscanf(const wchar_t* restrict s, const wchar_t* restrict format, va_list arg);  // C99
41int vwprintf(const wchar_t* restrict format, va_list arg);
42int vwscanf(const wchar_t* restrict format, va_list arg);  // C99
43int wprintf(const wchar_t* restrict format, ...);
44int wscanf(const wchar_t* restrict format, ...);
45wint_t fgetwc(FILE* stream);
46wchar_t* fgetws(wchar_t* restrict s, int n, FILE* restrict stream);
47wint_t fputwc(wchar_t c, FILE* stream);
48int fputws(const wchar_t* restrict s, FILE* restrict stream);
49int fwide(FILE* stream, int mode);
50wint_t getwc(FILE* stream);
51wint_t getwchar();
52wint_t putwc(wchar_t c, FILE* stream);
53wint_t putwchar(wchar_t c);
54wint_t ungetwc(wint_t c, FILE* stream);
55double wcstod(const wchar_t* restrict nptr, wchar_t** restrict endptr);
56float wcstof(const wchar_t* restrict nptr, wchar_t** restrict endptr);         // C99
57long double wcstold(const wchar_t* restrict nptr, wchar_t** restrict endptr);  // C99
58long wcstol(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
59long long wcstoll(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);  // C99
60unsigned long wcstoul(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);
61unsigned long long wcstoull(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base);  // C99
62wchar_t* wcscpy(wchar_t* restrict s1, const wchar_t* restrict s2);
63wchar_t* wcsncpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
64wchar_t* wcscat(wchar_t* restrict s1, const wchar_t* restrict s2);
65wchar_t* wcsncat(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
66int wcscmp(const wchar_t* s1, const wchar_t* s2);
67int wcscoll(const wchar_t* s1, const wchar_t* s2);
68int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n);
69size_t wcsxfrm(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
70const wchar_t* wcschr(const wchar_t* s, wchar_t c);
71      wchar_t* wcschr(      wchar_t* s, wchar_t c);
72size_t wcscspn(const wchar_t* s1, const wchar_t* s2);
73size_t wcslen(const wchar_t* s);
74const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2);
75      wchar_t* wcspbrk(      wchar_t* s1, const wchar_t* s2);
76const wchar_t* wcsrchr(const wchar_t* s, wchar_t c);
77      wchar_t* wcsrchr(      wchar_t* s, wchar_t c);
78size_t wcsspn(const wchar_t* s1, const wchar_t* s2);
79const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2);
80      wchar_t* wcsstr(      wchar_t* s1, const wchar_t* s2);
81wchar_t* wcstok(wchar_t* restrict s1, const wchar_t* restrict s2, wchar_t** restrict ptr);
82const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n);
83      wchar_t* wmemchr(      wchar_t* s, wchar_t c, size_t n);
84int wmemcmp(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
85wchar_t* wmemcpy(wchar_t* restrict s1, const wchar_t* restrict s2, size_t n);
86wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n);
87wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n);
88size_t wcsftime(wchar_t* restrict s, size_t maxsize, const wchar_t* restrict format,
89                const tm* restrict timeptr);
90wint_t btowc(int c);
91int wctob(wint_t c);
92int mbsinit(const mbstate_t* ps);
93size_t mbrlen(const char* restrict s, size_t n, mbstate_t* restrict ps);
94size_t mbrtowc(wchar_t* restrict pwc, const char* restrict s, size_t n, mbstate_t* restrict ps);
95size_t wcrtomb(char* restrict s, wchar_t wc, mbstate_t* restrict ps);
96size_t mbsrtowcs(wchar_t* restrict dst, const char** restrict src, size_t len,
97                 mbstate_t* restrict ps);
98size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
99                 mbstate_t* restrict ps);
100
101}  // std
102
103*/
104
105#include <__config>
106#include <cwctype>
107#include <wchar.h>
108
109#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
110#pragma GCC system_header
111#endif
112
113_LIBCPP_BEGIN_NAMESPACE_STD
114
115using ::mbstate_t;
116using ::size_t;
117using ::tm;
118using ::wint_t;
119using ::FILE;
120using ::fwprintf;
121using ::fwscanf;
122using ::swprintf;
123using ::vfwprintf;
124using ::vswprintf;
125using ::swscanf;
126using ::vfwscanf;
127using ::vswscanf;
128using ::fgetwc;
129using ::fgetws;
130using ::fputwc;
131using ::fputws;
132using ::fwide;
133using ::getwc;
134using ::putwc;
135using ::ungetwc;
136using ::wcstod;
137using ::wcstof;
138using ::wcstold;
139using ::wcstol;
140#ifndef _LIBCPP_HAS_NO_LONG_LONG
141using ::wcstoll;
142#endif // _LIBCPP_HAS_NO_LONG_LONG
143using ::wcstoul;
144#ifndef _LIBCPP_HAS_NO_LONG_LONG
145using ::wcstoull;
146#endif // _LIBCPP_HAS_NO_LONG_LONG
147using ::wcscpy;
148using ::wcsncpy;
149using ::wcscat;
150using ::wcsncat;
151using ::wcscmp;
152using ::wcscoll;
153using ::wcsncmp;
154using ::wcsxfrm;
155using ::wcschr;
156using ::wcspbrk;
157using ::wcsrchr;
158using ::wcsstr;
159using ::wmemchr;
160using ::wcscspn;
161using ::wcslen;
162using ::wcsspn;
163using ::wcstok;
164using ::wmemcmp;
165using ::wmemcpy;
166using ::wmemmove;
167using ::wmemset;
168using ::wcsftime;
169using ::btowc;
170using ::wctob;
171using ::mbsinit;
172using ::mbrlen;
173using ::mbrtowc;
174using ::wcrtomb;
175using ::mbsrtowcs;
176using ::wcsrtombs;
177
178#ifndef _LIBCPP_HAS_NO_STDIN
179using ::getwchar;
180using ::vwscanf;
181using ::wscanf;
182#endif
183
184#ifndef _LIBCPP_HAS_NO_STDOUT
185using ::putwchar;
186using ::vwprintf;
187using ::wprintf;
188#endif
189
190_LIBCPP_END_NAMESPACE_STD
191
192#endif  // _LIBCPP_CWCHAR
193