source: branches/libc-0.6/src/emx/include/wchar.h

Last change on this file was 2120, checked in by bird, 20 years ago

o Added fwide() (dummy until LIBC07).
o Renamed struct _FILE to struct sFILE to match BSD.

  • Property cvs2svn:cvs-rev set to 1.3
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 9.3 KB
Line 
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
81typedef __mbstate_t mbstate_t;
82#define _MBSTATE_T_DECLARED
83#endif
84
85#if !defined(_SIZE_T_DECLARED) && !defined(_SIZE_T) /* bird */
86typedef __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
93typedef __wchar_t wchar_t;
94#define _WCHAR_T_DECLARED
95#endif
96#endif
97
98#ifndef _WINT_T_DECLARED
99typedef __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
112struct __sFILE;
113struct tm;
114
115__BEGIN_DECLS
116wint_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); */
122int 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); */
127size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
128size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
129 mbstate_t * __restrict);
130int mbsinit(const mbstate_t *);
131size_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); */
144size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
145wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
146wchar_t *wcschr(const wchar_t *, wchar_t) __pure;
147int wcscmp(const wchar_t *, const wchar_t *) __pure;
148int wcscoll(const wchar_t *, const wchar_t *);
149wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
150size_t wcscspn(const wchar_t *, const wchar_t *) __pure;
151size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
152 const struct tm * __restrict);
153size_t wcslen(const wchar_t *) __pure;
154wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict,
155 size_t);
156int wcsncmp(const wchar_t *, const wchar_t *, size_t) __pure;
157wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
158wchar_t *wcspbrk(const wchar_t *, const wchar_t *) __pure;
159wchar_t *wcsrchr(const wchar_t *, wchar_t) __pure;
160size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
161 mbstate_t * __restrict);
162size_t wcsspn(const wchar_t *, const wchar_t *) __pure;
163wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict)
164 __pure;
165size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
166int wctob(wint_t);
167double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
168wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
169 wchar_t ** __restrict);
170long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
171unsigned long
172 wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
173wchar_t *wmemchr(const wchar_t *, wchar_t, size_t) __pure;
174int wmemcmp(const wchar_t *, const wchar_t *, size_t) __pure;
175wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
176wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
177wchar_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); */
199float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
200long double
201 wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
202#ifdef __LONG_LONG_SUPPORTED
203/* LONGLONG */
204long long
205 wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
206/* LONGLONG */
207unsigned 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
213int wcswidth(const wchar_t *, size_t);
214int 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); */
220size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
221 size_t, mbstate_t * __restrict);
222size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
223 size_t, mbstate_t * __restrict);
224size_t wcslcat(wchar_t *, const wchar_t *, size_t);
225size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
226#endif
227__END_DECLS
228
229#endif /* !_WCHAR_H_ */
Note: See TracBrowser for help on using the repository browser.