wchar.h revision 106035
176633Stshiozak/*-
276633Stshiozak * Copyright (c)1999 Citrus Project,
376633Stshiozak * All rights reserved.
476633Stshiozak *
576633Stshiozak * Redistribution and use in source and binary forms, with or without
676633Stshiozak * modification, are permitted provided that the following conditions
776633Stshiozak * are met:
876633Stshiozak * 1. Redistributions of source code must retain the above copyright
976633Stshiozak *    notice, this list of conditions and the following disclaimer.
1076633Stshiozak * 2. Redistributions in binary form must reproduce the above copyright
1176633Stshiozak *    notice, this list of conditions and the following disclaimer in the
1276633Stshiozak *    documentation and/or other materials provided with the distribution.
1376633Stshiozak *
1476633Stshiozak * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1576633Stshiozak * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1676633Stshiozak * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1776633Stshiozak * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1876633Stshiozak * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1976633Stshiozak * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2076633Stshiozak * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2176633Stshiozak * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2276633Stshiozak * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2376633Stshiozak * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2476633Stshiozak * SUCH DAMAGE.
2576633Stshiozak *
2676633Stshiozak * $FreeBSD: head/include/wchar.h 106035 2002-10-27 11:30:36Z tjr $
2776633Stshiozak */
2876633Stshiozak
2976633Stshiozak/*-
3076633Stshiozak * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
3176633Stshiozak * All rights reserved.
3276633Stshiozak *
3376633Stshiozak * This code is derived from software contributed to The NetBSD Foundation
3476633Stshiozak * by Julian Coleman.
3576633Stshiozak *
3676633Stshiozak * Redistribution and use in source and binary forms, with or without
3776633Stshiozak * modification, are permitted provided that the following conditions
3876633Stshiozak * are met:
3976633Stshiozak * 1. Redistributions of source code must retain the above copyright
4076633Stshiozak *    notice, this list of conditions and the following disclaimer.
4176633Stshiozak * 2. Redistributions in binary form must reproduce the above copyright
4276633Stshiozak *    notice, this list of conditions and the following disclaimer in the
4376633Stshiozak *    documentation and/or other materials provided with the distribution.
4476633Stshiozak * 3. All advertising materials mentioning features or use of this software
4576633Stshiozak *    must display the following acknowledgement:
4676633Stshiozak *        This product includes software developed by the NetBSD
4776633Stshiozak *        Foundation, Inc. and its contributors.
4876633Stshiozak * 4. Neither the name of The NetBSD Foundation nor the names of its
4976633Stshiozak *    contributors may be used to endorse or promote products derived
5076633Stshiozak *    from this software without specific prior written permission.
5176633Stshiozak *
5276633Stshiozak * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
5376633Stshiozak * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
5476633Stshiozak * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
5576633Stshiozak * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
5676633Stshiozak * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
5776633Stshiozak * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
5876633Stshiozak * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
5976633Stshiozak * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
6076633Stshiozak * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
6176633Stshiozak * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
6276633Stshiozak * POSSIBILITY OF SUCH DAMAGE.
6379555Sobrien *
6479555Sobrien *	$NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
6576633Stshiozak */
6676633Stshiozak
6776633Stshiozak#ifndef _WCHAR_H_
6876633Stshiozak#define _WCHAR_H_
6976633Stshiozak
7076633Stshiozak#include <sys/cdefs.h>
71102227Smike#include <sys/_types.h>
72101776Stjr
7376636Stshiozak#ifndef NULL
74103269Stjr#define	NULL	0
7576636Stshiozak#endif
7676633Stshiozak
77102227Smike#ifndef _MBSTATE_T_DECLARED
78102227Smiketypedef	__mbstate_t	mbstate_t;
79102227Smike#define	_MBSTATE_T_DECLARED
80101409Stjr#endif
81101409Stjr
82102227Smike#ifndef _SIZE_T_DECLARED
83102227Smiketypedef	__size_t	size_t;
84102227Smike#define	_SIZE_T_DECLARED
85101409Stjr#endif
86101409Stjr
8799640Sobrien#ifndef	__cplusplus
88102227Smike#ifndef _WCHAR_T_DECLARED
89102227Smiketypedef	__wchar_t	wchar_t;
90102227Smike#define	_WCHAR_T_DECLARED
9176633Stshiozak#endif
9299640Sobrien#endif
9376633Stshiozak
94102227Smike#ifndef _WINT_T_DECLARED
95102227Smiketypedef	__wint_t	wint_t;
96102227Smike#define	_WINT_T_DECLARED
9776633Stshiozak#endif
9876633Stshiozak
9976633Stshiozak#ifndef WEOF
10076633Stshiozak#define	WEOF 	((wint_t)-1)
10176633Stshiozak#endif
10276633Stshiozak
103103177Stjrstruct __sFILE;
104103218Stjrstruct tm;
105103177Stjr
10676633Stshiozak__BEGIN_DECLS
107101411Stjrwint_t	btowc(int);
108103177Stjrwint_t	fgetwc(struct __sFILE *);
109101776Stjrwchar_t	*
110103177Stjr	fgetws(wchar_t * __restrict, int, struct __sFILE * __restrict);
111103177Stjrwint_t	fputwc(wchar_t, struct __sFILE *);
112103177Stjrint	fputws(const wchar_t * __restrict, struct __sFILE * __restrict);
113103177Stjrint	fwide(struct __sFILE *, int);
114103739Stjrint	fwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, ...);
115103856Stjrint	fwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, ...);
116103177Stjrwint_t	getwc(struct __sFILE *);
117101776Stjrwint_t	getwchar(void);
11893032Simpsize_t	mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
11993032Simpsize_t	mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
12093032Simp	    mbstate_t * __restrict);
12193032Simpint	mbsinit(const mbstate_t *);
12293032Simpsize_t	mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
12393032Simp	    mbstate_t * __restrict);
124103177Stjrwint_t	putwc(wchar_t, struct __sFILE *);
125101776Stjrwint_t	putwchar(wchar_t);
126103739Stjrint	swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
127103739Stjr	    ...);
128103856Stjrint	swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
129103177Stjrwint_t	ungetwc(wint_t, struct __sFILE *);
130103739Stjrint	vfwprintf(struct __sFILE * __restrict, const wchar_t * __restrict,
131103739Stjr	    __va_list);
132103739Stjrint	vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
133103739Stjr	    __va_list);
134103739Stjrint	vwprintf(const wchar_t * __restrict, __va_list);
13593032Simpsize_t	wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
13693032Simpwchar_t	*wcscat(wchar_t * __restrict, const wchar_t * __restrict);
13793032Simpwchar_t	*wcschr(const wchar_t *, wchar_t);
13893032Simpint	wcscmp(const wchar_t *, const wchar_t *);
139104443Stjrint	wcscoll(const wchar_t *, const wchar_t *);
14093032Simpwchar_t	*wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
14193032Simpsize_t	wcscspn(const wchar_t *, const wchar_t *);
142103218Stjrsize_t	wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
143103218Stjr	    const struct tm * __restrict);
14493032Simpsize_t	wcslen(const wchar_t *);
14593032Simpwchar_t	*wcsncat(wchar_t * __restrict, const wchar_t * __restrict,
14693032Simp	    size_t);
14793032Simpint	wcsncmp(const wchar_t *, const wchar_t *, size_t);
14893032Simpwchar_t	*wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
14993032Simpwchar_t	*wcspbrk(const wchar_t *, const wchar_t *);
15093032Simpwchar_t	*wcsrchr(const wchar_t *, wchar_t);
15193032Simpsize_t	wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
15293032Simp	    mbstate_t * __restrict);
15393032Simpsize_t	wcsspn(const wchar_t *, const wchar_t *);
154103058Stjrwchar_t	*wcsstr(const wchar_t * __restrict, const wchar_t * __restrict);
155104443Stjrsize_t	wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
156102142Sacheint	wctob(wint_t);
157103339Stjrdouble	wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
158103067Stjrwchar_t	*wcstok(wchar_t * __restrict, const wchar_t * __restrict,
159103067Stjr	    wchar_t ** __restrict);
160103097Stjrlong	 wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
161103097Stjrunsigned long
162103097Stjr	 wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
163101411Stjrwchar_t	*wmemchr(const wchar_t *, wchar_t, size_t);
164101411Stjrint	wmemcmp(const wchar_t *, const wchar_t *, size_t);
165101411Stjrwchar_t	*wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
166101411Stjrwchar_t	*wmemmove(wchar_t *, const wchar_t *, size_t);
167101411Stjrwchar_t	*wmemset(wchar_t *, wchar_t, size_t);
168103739Stjrint	wprintf(const wchar_t * __restrict, ...);
169103856Stjrint	wscanf(const wchar_t * __restrict, ...);
170102198Stjr
171106035Stjr#if __ISO_C_VISIBLE >= 1999
172106035Stjrint	vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict,
173106035Stjr	    __va_list);
174106035Stjrint	vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
175106035Stjr	    __va_list);
176106035Stjrint	vwscanf(const wchar_t * __restrict, __va_list);
177106035Stjr#ifdef __LONG_LONG_SUPPORTED
178106035Stjr/* LONGLONG */
179106035Stjrlong long
180106035Stjr	wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
181106035Stjr/* LONGLONG */
182106035Stjrunsigned long long
183106035Stjr	 wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int);
184106035Stjr#endif
185106035Stjr#endif	/* __ISO_C_VISIBLE >= 1999 */
186106035Stjr
187102198Stjr#if __XSI_VISIBLE
188102198Stjrint	wcswidth(const wchar_t *, size_t);
189102198Stjrint	wcwidth(wchar_t);
190102198Stjr#endif
191103737Stjr
192103737Stjr#if __BSD_VISIBLE
193103737Stjrsize_t	wcslcat(wchar_t *, const wchar_t *, size_t);
194103737Stjrsize_t	wcslcpy(wchar_t *, const wchar_t *, size_t);
195103737Stjr#endif
19676633Stshiozak__END_DECLS
19776633Stshiozak
19876633Stshiozak#endif /* !_WCHAR_H_ */
199