43 |
7u83 |
1 |
/*
|
|
|
2 |
* Copyright (c) 1999 Citrus Project,
|
|
|
3 |
* All rights reserved.
|
|
|
4 |
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
|
|
|
5 |
* All rights reserved.
|
|
|
6 |
*
|
|
|
7 |
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
8 |
* by Julian Coleman.
|
|
|
9 |
*
|
|
|
10 |
* Copyright (c) 2019 The PLANIX Project,
|
|
|
11 |
* All rights reserved.
|
|
|
12 |
*
|
|
|
13 |
* Redistribution and use in source and binary forms, with or without
|
|
|
14 |
* modification, are permitted provided that the following conditions
|
|
|
15 |
* are met:
|
|
|
16 |
* 1. Redistributions of source code must retain the above copyright
|
|
|
17 |
* notice, this list of conditions and the following disclaimer.
|
|
|
18 |
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
19 |
* notice, this list of conditions and the following disclaimer in the
|
|
|
20 |
* documentation and/or other materials provided with the distribution.
|
|
|
21 |
*
|
|
|
22 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
23 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
24 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
25 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
26 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
27 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
28 |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
29 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
30 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
31 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
32 |
* SUCH DAMAGE.
|
|
|
33 |
*
|
|
|
34 |
*/
|
|
|
35 |
|
|
|
36 |
#ifndef _WCHAR_H_
|
|
|
37 |
#define _WCHAR_H_
|
|
|
38 |
|
|
|
39 |
#include <sys/cdefs.h>
|
|
|
40 |
#include <sys/_null.h>
|
|
|
41 |
#include <sys/_types.h>
|
|
|
42 |
#include <machine/_limits.h>
|
|
|
43 |
#include <_ctype.h>
|
|
|
44 |
|
|
|
45 |
#ifndef _MBSTATE_T_DECLARED
|
|
|
46 |
typedef __mbstate_t mbstate_t;
|
|
|
47 |
#define _MBSTATE_T_DECLARED
|
|
|
48 |
#endif
|
|
|
49 |
|
|
|
50 |
#ifndef _SIZE_T_DECLARED
|
|
|
51 |
typedef __size_t size_t;
|
|
|
52 |
#define _SIZE_T_DECLARED
|
|
|
53 |
#endif
|
|
|
54 |
|
|
|
55 |
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE
|
|
|
56 |
#ifndef _VA_LIST_DECLARED
|
|
|
57 |
typedef __va_list va_list;
|
|
|
58 |
#define _VA_LIST_DECLARED
|
|
|
59 |
#endif
|
|
|
60 |
#endif
|
|
|
61 |
|
|
|
62 |
#ifndef __cplusplus
|
|
|
63 |
#ifndef _WCHAR_T_DECLARED
|
|
|
64 |
typedef ___wchar_t wchar_t;
|
|
|
65 |
#define _WCHAR_T_DECLARED
|
|
|
66 |
#endif
|
|
|
67 |
#endif
|
|
|
68 |
|
|
|
69 |
#ifndef _WINT_T_DECLARED
|
|
|
70 |
typedef __wint_t wint_t;
|
|
|
71 |
#define _WINT_T_DECLARED
|
|
|
72 |
#endif
|
|
|
73 |
|
|
|
74 |
#define WCHAR_MIN __WCHAR_MIN
|
|
|
75 |
#define WCHAR_MAX __WCHAR_MAX
|
|
|
76 |
|
|
|
77 |
#ifndef WEOF
|
|
|
78 |
#define WEOF ((wint_t)-1)
|
|
|
79 |
#endif
|
|
|
80 |
|
|
|
81 |
#ifndef _STDFILE_DECLARED
|
|
|
82 |
#define _STDFILE_DECLARED
|
|
|
83 |
typedef struct __sFILE FILE;
|
|
|
84 |
#endif
|
|
|
85 |
struct tm;
|
|
|
86 |
|
|
|
87 |
__BEGIN_DECLS
|
|
|
88 |
wint_t btowc(int);
|
|
|
89 |
wint_t fgetwc(FILE *);
|
|
|
90 |
wchar_t *
|
|
|
91 |
fgetws(wchar_t * __restrict, int, FILE * __restrict);
|
|
|
92 |
wint_t fputwc(wchar_t, FILE *);
|
|
|
93 |
int fputws(const wchar_t * __restrict, FILE * __restrict);
|
|
|
94 |
int fwide(FILE *, int);
|
|
|
95 |
int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
|
|
|
96 |
int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
|
|
|
97 |
wint_t getwc(FILE *);
|
|
|
98 |
wint_t getwchar(void);
|
|
|
99 |
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
|
|
|
100 |
size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
|
|
|
101 |
mbstate_t * __restrict);
|
|
|
102 |
int mbsinit(const mbstate_t *);
|
|
|
103 |
size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
|
|
|
104 |
mbstate_t * __restrict);
|
|
|
105 |
wint_t putwc(wchar_t, FILE *);
|
|
|
106 |
wint_t putwchar(wchar_t);
|
|
|
107 |
int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
|
|
|
108 |
...);
|
|
|
109 |
int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
|
|
|
110 |
wint_t ungetwc(wint_t, FILE *);
|
|
|
111 |
int vfwprintf(FILE * __restrict, const wchar_t * __restrict,
|
|
|
112 |
__va_list);
|
|
|
113 |
int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
|
|
|
114 |
__va_list);
|
|
|
115 |
int vwprintf(const wchar_t * __restrict, __va_list);
|
|
|
116 |
size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
|
|
|
117 |
wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
|
|
|
118 |
wchar_t *wcschr(const wchar_t *, wchar_t) __pure;
|
|
|
119 |
int wcscmp(const wchar_t *, const wchar_t *) __pure;
|
|
|
120 |
int wcscoll(const wchar_t *, const wchar_t *);
|
|
|
121 |
wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
|
|
|
122 |
size_t wcscspn(const wchar_t *, const wchar_t *) __pure;
|
|
|
123 |
size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
|
|
|
124 |
const struct tm * __restrict);
|
|
|
125 |
size_t wcslen(const wchar_t *) __pure;
|
|
|
126 |
wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict,
|
|
|
127 |
size_t);
|
|
|
128 |
int wcsncmp(const wchar_t *, const wchar_t *, size_t) __pure;
|
|
|
129 |
wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
|
|
|
130 |
wchar_t *wcspbrk(const wchar_t *, const wchar_t *) __pure;
|
|
|
131 |
wchar_t *wcsrchr(const wchar_t *, wchar_t) __pure;
|
|
|
132 |
size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
|
|
|
133 |
mbstate_t * __restrict);
|
|
|
134 |
size_t wcsspn(const wchar_t *, const wchar_t *) __pure;
|
|
|
135 |
wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict)
|
|
|
136 |
__pure;
|
|
|
137 |
size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
|
|
|
138 |
int wctob(wint_t);
|
|
|
139 |
double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
|
|
|
140 |
wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
|
|
|
141 |
wchar_t ** __restrict);
|
|
|
142 |
long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
|
|
143 |
unsigned long
|
|
|
144 |
wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
|
|
145 |
wchar_t *wmemchr(const wchar_t *, wchar_t, size_t) __pure;
|
|
|
146 |
int wmemcmp(const wchar_t *, const wchar_t *, size_t) __pure;
|
|
|
147 |
wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
|
|
|
148 |
wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
|
|
|
149 |
wchar_t *wmemset(wchar_t *, wchar_t, size_t);
|
|
|
150 |
int wprintf(const wchar_t * __restrict, ...);
|
|
|
151 |
int wscanf(const wchar_t * __restrict, ...);
|
|
|
152 |
|
|
|
153 |
#ifndef _STDSTREAM_DECLARED
|
|
|
154 |
extern FILE *__stdinp;
|
|
|
155 |
extern FILE *__stdoutp;
|
|
|
156 |
extern FILE *__stderrp;
|
|
|
157 |
#define _STDSTREAM_DECLARED
|
|
|
158 |
#endif
|
|
|
159 |
|
|
|
160 |
#define getwc(fp) fgetwc(fp)
|
|
|
161 |
#define getwchar() fgetwc(__stdinp)
|
|
|
162 |
#define putwc(wc, fp) fputwc(wc, fp)
|
|
|
163 |
#define putwchar(wc) fputwc(wc, __stdoutp)
|
|
|
164 |
|
|
|
165 |
#if __ISO_C_VISIBLE >= 1999
|
|
|
166 |
int vfwscanf(FILE * __restrict, const wchar_t * __restrict,
|
|
|
167 |
__va_list);
|
|
|
168 |
int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
|
|
|
169 |
__va_list);
|
|
|
170 |
int vwscanf(const wchar_t * __restrict, __va_list);
|
|
|
171 |
float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
|
|
|
172 |
long double
|
|
|
173 |
wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
|
|
|
174 |
#ifdef __LONG_LONG_SUPPORTED
|
|
|
175 |
/* LONGLONG */
|
|
|
176 |
long long
|
|
|
177 |
wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
|
|
178 |
/* LONGLONG */
|
|
|
179 |
unsigned long long
|
|
|
180 |
wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
|
|
181 |
#endif
|
|
|
182 |
#endif /* __ISO_C_VISIBLE >= 1999 */
|
|
|
183 |
|
|
|
184 |
#if __XSI_VISIBLE
|
|
|
185 |
int wcswidth(const wchar_t *, size_t);
|
|
|
186 |
int wcwidth(wchar_t);
|
|
|
187 |
#define wcwidth(_c) __wcwidth(_c)
|
|
|
188 |
#endif
|
|
|
189 |
|
|
|
190 |
#if __POSIX_VISIBLE >= 200809
|
|
|
191 |
size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
|
|
|
192 |
size_t, mbstate_t * __restrict);
|
|
|
193 |
FILE *open_wmemstream(wchar_t **, size_t *);
|
|
|
194 |
wchar_t *wcpcpy(wchar_t * __restrict, const wchar_t * __restrict);
|
|
|
195 |
wchar_t *wcpncpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
|
|
|
196 |
wchar_t *wcsdup(const wchar_t *) __malloc_like;
|
|
|
197 |
int wcscasecmp(const wchar_t *, const wchar_t *);
|
|
|
198 |
int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n);
|
|
|
199 |
size_t wcsnlen(const wchar_t *, size_t) __pure;
|
|
|
200 |
size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
|
|
|
201 |
size_t, mbstate_t * __restrict);
|
|
|
202 |
#endif
|
|
|
203 |
|
|
|
204 |
#if __BSD_VISIBLE
|
|
|
205 |
wchar_t *fgetwln(FILE * __restrict, size_t * __restrict);
|
|
|
206 |
size_t wcslcat(wchar_t *, const wchar_t *, size_t);
|
|
|
207 |
size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
|
|
|
208 |
#endif
|
|
|
209 |
|
|
|
210 |
#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
|
|
|
211 |
#include <xlocale/_wchar.h>
|
|
|
212 |
#endif
|
|
|
213 |
__END_DECLS
|
|
|
214 |
|
|
|
215 |
#endif /* !_WCHAR_H_ */
|