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