source: trunk/src/emx/include/wchar.h@ 1697

Last change on this file since 1697 was 1697, checked in by bird, 21 years ago

imported FreeBSD 5.3 code and broke stuff.

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 9.0 KB
Line 
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
83typedef __mbstate_t mbstate_t;
84#define _MBSTATE_T_DECLARED
85#endif
86
87#if !defined(_SIZE_T_DECLARED) && !defined(_SIZE_T) /* bird */
88typedef __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
95typedef __wchar_t wchar_t;
96#define _WCHAR_T_DECLARED
97#endif
98#endif
99
100#ifndef _WINT_T_DECLARED
101typedef __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 */
115struct __sFILE;
116#endif /* bird */
117struct tm;
118
119__BEGIN_DECLS
120#if 0 /* bird */
121wint_t btowc(int);
122wint_t fgetwc(struct __sFILE *);
123wchar_t *
124 fgetws(wchar_t * __restrict, int, struct __sFILE * __restrict);
125wint_t fputwc(wchar_t, struct __sFILE *);
126int fputws(const wchar_t * __restrict, struct __sFILE * __restrict);
127int fwide(struct __sFILE *, int);
128int fwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, ...);
129int fwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, ...);
130wint_t getwc(struct __sFILE *);
131wint_t getwchar(void);
132size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
133#endif /* bird */
134size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
135 mbstate_t * __restrict);
136#if 0 /* bird */
137int mbsinit(const mbstate_t *);
138size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
139 mbstate_t * __restrict);
140wint_t putwc(wchar_t, struct __sFILE *);
141wint_t putwchar(wchar_t);
142int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
143 ...);
144int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
145wint_t ungetwc(wint_t, struct __sFILE *);
146int vfwprintf(struct __sFILE * __restrict, const wchar_t * __restrict,
147 __va_list);
148int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
149 __va_list);
150int vwprintf(const wchar_t * __restrict, __va_list);
151#endif /* bird */
152size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
153#if 0 /* bird */
154wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
155wchar_t *wcschr(const wchar_t *, wchar_t) __pure;
156int wcscmp(const wchar_t *, const wchar_t *) __pure;
157int wcscoll(const wchar_t *, const wchar_t *);
158wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
159size_t wcscspn(const wchar_t *, const wchar_t *) __pure;
160size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
161 const struct tm * __restrict);
162size_t wcslen(const wchar_t *) __pure;
163wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict,
164 size_t);
165int wcsncmp(const wchar_t *, const wchar_t *, size_t) __pure;
166wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
167wchar_t *wcspbrk(const wchar_t *, const wchar_t *) __pure;
168wchar_t *wcsrchr(const wchar_t *, wchar_t) __pure;
169size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
170 mbstate_t * __restrict);
171size_t wcsspn(const wchar_t *, const wchar_t *) __pure;
172wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict)
173 __pure;
174size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
175int wctob(wint_t);
176double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
177wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
178 wchar_t ** __restrict);
179long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
180unsigned long
181 wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
182wchar_t *wmemchr(const wchar_t *, wchar_t, size_t) __pure;
183int wmemcmp(const wchar_t *, const wchar_t *, size_t) __pure;
184wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
185wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
186wchar_t *wmemset(wchar_t *, wchar_t, size_t);
187int wprintf(const wchar_t * __restrict, ...);
188int wscanf(const wchar_t * __restrict, ...);
189
190#ifndef _STDSTREAM_DECLARED
191extern struct __sFILE *__stdinp;
192extern struct __sFILE *__stdoutp;
193extern 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
203int vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict,
204 __va_list);
205int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
206 __va_list);
207int vwscanf(const wchar_t * __restrict, __va_list);
208float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
209long double
210 wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
211#ifdef __LONG_LONG_SUPPORTED
212/* LONGLONG */
213long long
214 wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
215/* LONGLONG */
216unsigned 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
222int wcswidth(const wchar_t *, size_t);
223int wcwidth(wchar_t);
224#define wcwidth(_c) __wcwidth(_c)
225#endif
226
227#if __BSD_VISIBLE
228wchar_t *fgetwln(struct __sFILE * __restrict, size_t * __restrict);
229size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
230 size_t, mbstate_t * __restrict);
231size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
232 size_t, mbstate_t * __restrict);
233size_t wcslcat(wchar_t *, const wchar_t *, size_t);
234size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
235#endif
236#endif /* bird */
237__END_DECLS
238
239#endif /* !_WCHAR_H_ */
Note: See TracBrowser for help on using the repository browser.