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