2001-05-15 19:35:57 +00:00
|
|
|
/*-
|
|
|
|
* Copyright (c)1999 Citrus Project,
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*-
|
|
|
|
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
* by Julian Coleman.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the NetBSD
|
|
|
|
* Foundation, Inc. and its contributors.
|
|
|
|
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
* contributors may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
2001-07-10 17:50:46 +00:00
|
|
|
*
|
|
|
|
* $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
|
2001-05-15 19:35:57 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _WCHAR_H_
|
|
|
|
#define _WCHAR_H_
|
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
2003-12-07 21:10:06 +00:00
|
|
|
#include <sys/_null.h>
|
2002-08-21 16:20:02 +00:00
|
|
|
#include <sys/_types.h>
|
2003-04-28 22:40:05 +00:00
|
|
|
#include <machine/_limits.h>
|
2004-08-12 12:19:11 +00:00
|
|
|
#include <_ctype.h>
|
2002-08-13 09:30:41 +00:00
|
|
|
|
2002-08-21 16:20:02 +00:00
|
|
|
#ifndef _MBSTATE_T_DECLARED
|
|
|
|
typedef __mbstate_t mbstate_t;
|
|
|
|
#define _MBSTATE_T_DECLARED
|
2002-08-06 05:19:33 +00:00
|
|
|
#endif
|
|
|
|
|
2002-08-21 16:20:02 +00:00
|
|
|
#ifndef _SIZE_T_DECLARED
|
|
|
|
typedef __size_t size_t;
|
|
|
|
#define _SIZE_T_DECLARED
|
2002-08-06 05:19:33 +00:00
|
|
|
#endif
|
|
|
|
|
2002-07-09 05:13:30 +00:00
|
|
|
#ifndef __cplusplus
|
2002-08-21 16:20:02 +00:00
|
|
|
#ifndef _WCHAR_T_DECLARED
|
|
|
|
typedef __wchar_t wchar_t;
|
|
|
|
#define _WCHAR_T_DECLARED
|
2001-05-15 19:35:57 +00:00
|
|
|
#endif
|
2002-07-09 05:13:30 +00:00
|
|
|
#endif
|
2001-05-15 19:35:57 +00:00
|
|
|
|
2002-08-21 16:20:02 +00:00
|
|
|
#ifndef _WINT_T_DECLARED
|
|
|
|
typedef __wint_t wint_t;
|
|
|
|
#define _WINT_T_DECLARED
|
2001-05-15 19:35:57 +00:00
|
|
|
#endif
|
|
|
|
|
2003-04-28 22:40:05 +00:00
|
|
|
#ifndef WCHAR_MIN
|
|
|
|
#define WCHAR_MIN __INT_MIN
|
|
|
|
#define WCHAR_MAX __INT_MAX
|
|
|
|
#endif
|
|
|
|
|
2001-05-15 19:35:57 +00:00
|
|
|
#ifndef WEOF
|
|
|
|
#define WEOF ((wint_t)-1)
|
|
|
|
#endif
|
|
|
|
|
2002-09-10 09:43:28 +00:00
|
|
|
struct __sFILE;
|
2002-09-11 08:57:11 +00:00
|
|
|
struct tm;
|
2002-09-10 09:43:28 +00:00
|
|
|
|
2001-05-15 19:35:57 +00:00
|
|
|
__BEGIN_DECLS
|
2002-08-06 06:26:06 +00:00
|
|
|
wint_t btowc(int);
|
2002-09-10 09:43:28 +00:00
|
|
|
wint_t fgetwc(struct __sFILE *);
|
2002-08-13 09:30:41 +00:00
|
|
|
wchar_t *
|
2002-09-10 09:43:28 +00:00
|
|
|
fgetws(wchar_t * __restrict, int, struct __sFILE * __restrict);
|
|
|
|
wint_t fputwc(wchar_t, struct __sFILE *);
|
|
|
|
int fputws(const wchar_t * __restrict, struct __sFILE * __restrict);
|
|
|
|
int fwide(struct __sFILE *, int);
|
2002-09-21 13:00:30 +00:00
|
|
|
int fwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, ...);
|
2002-09-23 12:40:06 +00:00
|
|
|
int fwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, ...);
|
2002-09-10 09:43:28 +00:00
|
|
|
wint_t getwc(struct __sFILE *);
|
2002-08-13 09:30:41 +00:00
|
|
|
wint_t getwchar(void);
|
2002-03-23 17:24:55 +00:00
|
|
|
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
|
|
|
|
size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
|
|
|
|
mbstate_t * __restrict);
|
|
|
|
int mbsinit(const mbstate_t *);
|
|
|
|
size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
|
|
|
|
mbstate_t * __restrict);
|
2002-09-10 09:43:28 +00:00
|
|
|
wint_t putwc(wchar_t, struct __sFILE *);
|
2002-08-13 09:30:41 +00:00
|
|
|
wint_t putwchar(wchar_t);
|
2002-09-21 13:00:30 +00:00
|
|
|
int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
|
|
|
|
...);
|
2002-09-23 12:40:06 +00:00
|
|
|
int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
|
2002-09-10 09:43:28 +00:00
|
|
|
wint_t ungetwc(wint_t, struct __sFILE *);
|
2002-09-21 13:00:30 +00:00
|
|
|
int vfwprintf(struct __sFILE * __restrict, const wchar_t * __restrict,
|
|
|
|
__va_list);
|
|
|
|
int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
|
|
|
|
__va_list);
|
|
|
|
int vwprintf(const wchar_t * __restrict, __va_list);
|
2002-03-23 17:24:55 +00:00
|
|
|
size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
|
|
|
|
wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
|
2004-07-23 02:29:37 +00:00
|
|
|
wchar_t *wcschr(const wchar_t *, wchar_t) __pure;
|
|
|
|
int wcscmp(const wchar_t *, const wchar_t *) __pure;
|
2002-10-04 03:18:26 +00:00
|
|
|
int wcscoll(const wchar_t *, const wchar_t *);
|
2002-03-23 17:24:55 +00:00
|
|
|
wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
|
2004-07-23 02:29:37 +00:00
|
|
|
size_t wcscspn(const wchar_t *, const wchar_t *) __pure;
|
2002-09-11 08:57:11 +00:00
|
|
|
size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
|
|
|
|
const struct tm * __restrict);
|
2004-07-23 02:29:37 +00:00
|
|
|
size_t wcslen(const wchar_t *) __pure;
|
2002-03-23 17:24:55 +00:00
|
|
|
wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict,
|
|
|
|
size_t);
|
2004-07-23 02:29:37 +00:00
|
|
|
int wcsncmp(const wchar_t *, const wchar_t *, size_t) __pure;
|
2002-03-23 17:24:55 +00:00
|
|
|
wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
|
2004-07-23 02:29:37 +00:00
|
|
|
wchar_t *wcspbrk(const wchar_t *, const wchar_t *) __pure;
|
|
|
|
wchar_t *wcsrchr(const wchar_t *, wchar_t) __pure;
|
2002-03-23 17:24:55 +00:00
|
|
|
size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
|
|
|
|
mbstate_t * __restrict);
|
2004-07-23 02:29:37 +00:00
|
|
|
size_t wcsspn(const wchar_t *, const wchar_t *) __pure;
|
|
|
|
wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict)
|
|
|
|
__pure;
|
2002-10-04 03:18:26 +00:00
|
|
|
size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
|
2002-08-03 13:49:55 +00:00
|
|
|
int wctob(wint_t);
|
2002-09-15 08:38:51 +00:00
|
|
|
double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
|
2002-09-07 08:16:57 +00:00
|
|
|
wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
|
|
|
|
wchar_t ** __restrict);
|
2002-09-08 13:27:26 +00:00
|
|
|
long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
|
|
|
unsigned long
|
|
|
|
wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
2004-07-23 02:29:37 +00:00
|
|
|
wchar_t *wmemchr(const wchar_t *, wchar_t, size_t) __pure;
|
|
|
|
int wmemcmp(const wchar_t *, const wchar_t *, size_t) __pure;
|
2002-08-06 06:26:06 +00:00
|
|
|
wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
|
|
|
|
wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
|
|
|
|
wchar_t *wmemset(wchar_t *, wchar_t, size_t);
|
2002-09-21 13:00:30 +00:00
|
|
|
int wprintf(const wchar_t * __restrict, ...);
|
2002-09-23 12:40:06 +00:00
|
|
|
int wscanf(const wchar_t * __restrict, ...);
|
2002-08-20 22:44:40 +00:00
|
|
|
|
2004-05-27 10:08:44 +00:00
|
|
|
#ifndef _STDSTREAM_DECLARED
|
|
|
|
extern struct __sFILE *__stdinp;
|
|
|
|
extern struct __sFILE *__stdoutp;
|
|
|
|
extern struct __sFILE *__stderrp;
|
|
|
|
#define _STDSTREAM_DECLARED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define getwc(fp) fgetwc(fp)
|
|
|
|
#define getwchar() fgetwc(__stdinp)
|
2004-06-07 10:31:10 +00:00
|
|
|
#define putwc(wc, fp) fputwc(wc, fp)
|
2004-05-27 10:08:44 +00:00
|
|
|
#define putwchar(wc) fputwc(wc, __stdoutp)
|
|
|
|
|
2002-10-27 11:30:36 +00:00
|
|
|
#if __ISO_C_VISIBLE >= 1999
|
|
|
|
int vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict,
|
|
|
|
__va_list);
|
|
|
|
int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
|
|
|
|
__va_list);
|
|
|
|
int vwscanf(const wchar_t * __restrict, __va_list);
|
2003-03-13 06:29:53 +00:00
|
|
|
float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
|
|
|
|
long double
|
|
|
|
wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
|
2002-10-27 11:30:36 +00:00
|
|
|
#ifdef __LONG_LONG_SUPPORTED
|
|
|
|
/* LONGLONG */
|
|
|
|
long long
|
|
|
|
wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
|
|
|
/* LONGLONG */
|
|
|
|
unsigned long long
|
|
|
|
wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int);
|
|
|
|
#endif
|
|
|
|
#endif /* __ISO_C_VISIBLE >= 1999 */
|
|
|
|
|
2002-08-20 22:44:40 +00:00
|
|
|
#if __XSI_VISIBLE
|
|
|
|
int wcswidth(const wchar_t *, size_t);
|
|
|
|
int wcwidth(wchar_t);
|
2004-08-12 12:19:11 +00:00
|
|
|
#define wcwidth(_c) __wcwidth(_c)
|
2002-08-20 22:44:40 +00:00
|
|
|
#endif
|
2002-09-21 08:55:16 +00:00
|
|
|
|
|
|
|
#if __BSD_VISIBLE
|
2004-07-16 06:06:09 +00:00
|
|
|
wchar_t *fgetwln(struct __sFILE * __restrict, size_t * __restrict);
|
2004-07-21 10:54:57 +00:00
|
|
|
size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
|
|
|
|
size_t, mbstate_t * __restrict);
|
|
|
|
size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
|
|
|
|
size_t, mbstate_t * __restrict);
|
2002-09-21 08:55:16 +00:00
|
|
|
size_t wcslcat(wchar_t *, const wchar_t *, size_t);
|
|
|
|
size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
|
|
|
|
#endif
|
2001-05-15 19:35:57 +00:00
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#endif /* !_WCHAR_H_ */
|