1 | /** @file
|
---|
2 | * FreeBSD 5.3
|
---|
3 | * @changed bird: Disabled all stream related and some other stuff we don't do yet.
|
---|
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 | #include <_ctype.h>
|
---|
79 |
|
---|
80 | #ifndef _MBSTATE_T_DECLARED
|
---|
81 | typedef __mbstate_t mbstate_t;
|
---|
82 | #define _MBSTATE_T_DECLARED
|
---|
83 | #endif
|
---|
84 |
|
---|
85 | #if !defined(_SIZE_T_DECLARED) && !defined(_SIZE_T) /* bird */
|
---|
86 | typedef __size_t size_t;
|
---|
87 | #define _SIZE_T_DECLARED
|
---|
88 | #define _SIZE_T /* bird */
|
---|
89 | #endif
|
---|
90 |
|
---|
91 | #ifndef __cplusplus
|
---|
92 | #ifndef _WCHAR_T_DECLARED
|
---|
93 | typedef __wchar_t wchar_t;
|
---|
94 | #define _WCHAR_T_DECLARED
|
---|
95 | #endif
|
---|
96 | #endif
|
---|
97 |
|
---|
98 | #ifndef _WINT_T_DECLARED
|
---|
99 | typedef __wint_t wint_t;
|
---|
100 | #define _WINT_T_DECLARED
|
---|
101 | #endif
|
---|
102 |
|
---|
103 | #ifndef WCHAR_MIN
|
---|
104 | #define WCHAR_MIN __INT_MIN
|
---|
105 | #define WCHAR_MAX __INT_MAX
|
---|
106 | #endif
|
---|
107 |
|
---|
108 | #ifndef WEOF
|
---|
109 | #define WEOF ((wint_t)-1)
|
---|
110 | #endif
|
---|
111 |
|
---|
112 | struct __sFILE;
|
---|
113 | struct tm;
|
---|
114 |
|
---|
115 | __BEGIN_DECLS
|
---|
116 | wint_t btowc(int);
|
---|
117 | /** @todo wint_t fgetwc(struct __sFILE *); */
|
---|
118 | /** @todo wchar_t *
|
---|
119 | fgetws(wchar_t * __restrict, int, struct __sFILE * __restrict); */
|
---|
120 | /** @todo wint_t fputwc(wchar_t, struct __sFILE *); */
|
---|
121 | /** @todo int fputws(const wchar_t * __restrict, struct __sFILE * __restrict); */
|
---|
122 | int fwide(struct __sFILE *, int);
|
---|
123 | /** @todo int fwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, ...); */
|
---|
124 | /** @todo int fwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, ...); */
|
---|
125 | /** @todo wint_t getwc(struct __sFILE *); */
|
---|
126 | /** @todo wint_t getwchar(void); */
|
---|
127 | size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
|
---|
128 | size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
|
---|
129 | mbstate_t * __restrict);
|
---|
130 | int mbsinit(const mbstate_t *);
|
---|
131 | size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
|
---|
132 | mbstate_t * __restrict);
|
---|
133 | /** @todo wint_t putwc(wchar_t, struct __sFILE *); */
|
---|
134 | /** @todo wint_t putwchar(wchar_t); */
|
---|
135 | /** @todo int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
|
---|
136 | ...); */
|
---|
137 | /** @todo int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...); */
|
---|
138 | /** @todo wint_t ungetwc(wint_t, struct __sFILE *); */
|
---|
139 | /** @todo int vfwprintf(struct __sFILE * __restrict, const wchar_t * __restrict,
|
---|
140 | __va_list); */
|
---|
141 | /** @todo int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
|
---|
142 | __va_list); */
|
---|
143 | /** @todo int vwprintf(const wchar_t * __restrict, __va_list); */
|
---|
144 | size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
|
---|
145 | wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
|
---|
146 | wchar_t *wcschr(const wchar_t *, wchar_t) __pure;
|
---|
147 | int wcscmp(const wchar_t *, const wchar_t *) __pure;
|
---|
148 | int wcscoll(const wchar_t *, const wchar_t *);
|
---|
149 | wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
|
---|
150 | size_t wcscspn(const wchar_t *, const wchar_t *) __pure;
|
---|
151 | size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
|
---|
152 | const struct tm * __restrict);
|
---|
153 | size_t wcslen(const wchar_t *) __pure;
|
---|
154 | wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict,
|
---|
155 | size_t);
|
---|
156 | int wcsncmp(const wchar_t *, const wchar_t *, size_t) __pure;
|
---|
157 | wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
|
---|
158 | wchar_t *wcspbrk(const wchar_t *, const wchar_t *) __pure;
|
---|
159 | wchar_t *wcsrchr(const wchar_t *, wchar_t) __pure;
|
---|
160 | size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
|
---|
161 | mbstate_t * __restrict);
|
---|
162 | size_t wcsspn(const wchar_t *, const wchar_t *) __pure;
|
---|
163 | wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict)
|
---|
164 | __pure;
|
---|
165 | size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
|
---|
166 | int wctob(wint_t);
|
---|
167 | double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
|
---|
168 | wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
|
---|
169 | wchar_t ** __restrict);
|
---|
170 | long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
---|
171 | unsigned long
|
---|
172 | wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
---|
173 | wchar_t *wmemchr(const wchar_t *, wchar_t, size_t) __pure;
|
---|
174 | int wmemcmp(const wchar_t *, const wchar_t *, size_t) __pure;
|
---|
175 | wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
|
---|
176 | wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
|
---|
177 | wchar_t *wmemset(wchar_t *, wchar_t, size_t);
|
---|
178 | /** @todo int wprintf(const wchar_t * __restrict, ...); */
|
---|
179 | /** @todo int wscanf(const wchar_t * __restrict, ...); */
|
---|
180 |
|
---|
181 | /** @todo #ifndef _STDSTREAM_DECLARED */
|
---|
182 | /** @todo extern struct __sFILE *__stdinp; */
|
---|
183 | /** @todo extern struct __sFILE *__stdoutp; */
|
---|
184 | /** @todo extern struct __sFILE *__stderrp; */
|
---|
185 | /** @todo #define _STDSTREAM_DECLARED */
|
---|
186 | /** @todo #endif */
|
---|
187 |
|
---|
188 | /** @todo #define getwc(fp) fgetwc(fp) */
|
---|
189 | /** @todo #define getwchar() fgetwc(__stdinp) */
|
---|
190 | /** @todo #define putwc(wc, fp) fputwc(wc, fp) */
|
---|
191 | /** @todo #define putwchar(wc) fputwc(wc, __stdoutp) */
|
---|
192 |
|
---|
193 | #if __ISO_C_VISIBLE >= 1999
|
---|
194 | /** @todo int vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict,
|
---|
195 | __va_list); */
|
---|
196 | /** @todo int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
|
---|
197 | __va_list); */
|
---|
198 | /** @todo int vwscanf(const wchar_t * __restrict, __va_list); */
|
---|
199 | float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
|
---|
200 | long double
|
---|
201 | wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
|
---|
202 | #ifdef __LONG_LONG_SUPPORTED
|
---|
203 | /* LONGLONG */
|
---|
204 | long long
|
---|
205 | wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
---|
206 | /* LONGLONG */
|
---|
207 | unsigned long long
|
---|
208 | wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
---|
209 | #endif
|
---|
210 | #endif /* __ISO_C_VISIBLE >= 1999 */
|
---|
211 |
|
---|
212 | #if __XSI_VISIBLE
|
---|
213 | int wcswidth(const wchar_t *, size_t);
|
---|
214 | int wcwidth(wchar_t);
|
---|
215 | #define wcwidth(_c) __wcwidth(_c)
|
---|
216 | #endif
|
---|
217 |
|
---|
218 | #if __BSD_VISIBLE
|
---|
219 | /** @todo wchar_t *fgetwln(struct __sFILE * __restrict, size_t * __restrict); */
|
---|
220 | size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
|
---|
221 | size_t, mbstate_t * __restrict);
|
---|
222 | size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
|
---|
223 | size_t, mbstate_t * __restrict);
|
---|
224 | size_t wcslcat(wchar_t *, const wchar_t *, size_t);
|
---|
225 | size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
|
---|
226 | #endif
|
---|
227 | __END_DECLS
|
---|
228 |
|
---|
229 | #endif /* !_WCHAR_H_ */
|
---|