wchar.h revision 103097
1118652Sache/*- 2118652Sache * Copyright (c)1999 Citrus Project, 3118652Sache * All rights reserved. 4118652Sache * 5118652Sache * Redistribution and use in source and binary forms, with or without 6118652Sache * modification, are permitted provided that the following conditions 7118652Sache * are met: 8118652Sache * 1. Redistributions of source code must retain the above copyright 9118652Sache * notice, this list of conditions and the following disclaimer. 10118652Sache * 2. Redistributions in binary form must reproduce the above copyright 11118652Sache * notice, this list of conditions and the following disclaimer in the 12118652Sache * documentation and/or other materials provided with the distribution. 13118652Sache * 14118652Sache * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15118653Sache * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16118652Sache * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17118652Sache * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18118652Sache * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19118652Sache * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20118652Sache * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21118652Sache * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22118652Sache * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23118652Sache * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24118652Sache * SUCH DAMAGE. 25118652Sache * 26118652Sache * $FreeBSD: head/include/wchar.h 103097 2002-09-08 13:27:26Z tjr $ 27118652Sache */ 28118652Sache 29118652Sache/*- 30118652Sache * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. 31118652Sache * All rights reserved. 32118652Sache * 33118652Sache * This code is derived from software contributed to The NetBSD Foundation 34118652Sache * by Julian Coleman. 35118652Sache * 36118652Sache * Redistribution and use in source and binary forms, with or without 37118652Sache * modification, are permitted provided that the following conditions 38118652Sache * are met: 39118652Sache * 1. Redistributions of source code must retain the above copyright 40118652Sache * notice, this list of conditions and the following disclaimer. 41118652Sache * 2. Redistributions in binary form must reproduce the above copyright 42118652Sache * notice, this list of conditions and the following disclaimer in the 43118652Sache * documentation and/or other materials provided with the distribution. 44118652Sache * 3. All advertising materials mentioning features or use of this software 45118652Sache * must display the following acknowledgement: 46118652Sache * This product includes software developed by the NetBSD 47118652Sache * Foundation, Inc. and its contributors. 48118652Sache * 4. Neither the name of The NetBSD Foundation nor the names of its 49118652Sache * contributors may be used to endorse or promote products derived 50118652Sache * from this software without specific prior written permission. 51118652Sache * 52118652Sache * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 53118652Sache * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 54118652Sache * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 55118652Sache * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 56118652Sache * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 57118652Sache * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 58118652Sache * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 59118652Sache * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 60118652Sache * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 61118652Sache * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 62118652Sache * POSSIBILITY OF SUCH DAMAGE. 63118652Sache * 64118652Sache * $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $ 65118652Sache */ 66118652Sache 67118652Sache#ifndef _WCHAR_H_ 68118652Sache#define _WCHAR_H_ 69118652Sache 70118652Sache#include <sys/cdefs.h> 71118652Sache#include <sys/_types.h> 72118652Sache 73118652Sache#include <stdio.h> 74118652Sache 75118652Sache#ifndef NULL 76118652Sache#define NULL 0 77118652Sache#endif 78118652Sache 79118652Sache#ifndef _MBSTATE_T_DECLARED 80118652Sachetypedef __mbstate_t mbstate_t; 81118652Sache#define _MBSTATE_T_DECLARED 82118652Sache#endif 83118652Sache 84118652Sache#ifndef _SIZE_T_DECLARED 85118652Sachetypedef __size_t size_t; 86118652Sache#define _SIZE_T_DECLARED 87118652Sache#endif 88118652Sache 89118652Sache#ifndef __cplusplus 90118652Sache#ifndef _WCHAR_T_DECLARED 91118652Sachetypedef __wchar_t wchar_t; 92118652Sache#define _WCHAR_T_DECLARED 93118652Sache#endif 94118652Sache#endif 95118652Sache 96118652Sache#ifndef _WCTYPE_T 97118652Sachetypedef unsigned long wctype_t; 98118652Sache#define _WCTYPE_T 99118652Sache#endif 100118652Sache 101118652Sache#ifndef _WINT_T_DECLARED 102118652Sachetypedef __wint_t wint_t; 103118652Sache#define _WINT_T_DECLARED 104118652Sache#endif 105118652Sache 106118652Sache#ifndef WEOF 107118652Sache#define WEOF ((wint_t)-1) 108118652Sache#endif 109118652Sache 110118652Sache__BEGIN_DECLS 111118652Sachewint_t btowc(int); 112118652Sachewint_t fgetwc(FILE *); 113118652Sachewchar_t * 114118652Sache fgetws(wchar_t * __restrict, int, FILE * __restrict); 115118652Sachewint_t fputwc(wchar_t, FILE *); 116118652Sacheint fputws(const wchar_t * __restrict, FILE * __restrict); 117118652Sacheint fwide(FILE *, int); 118118652Sachewint_t getwc(FILE *); 119118652Sachewint_t getwchar(void); 120118652Sachesize_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict); 121118652Sachesize_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, 122118652Sache mbstate_t * __restrict); 123118652Sacheint mbsinit(const mbstate_t *); 124118652Sachesize_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t, 125118652Sache mbstate_t * __restrict); 126118652Sachewint_t putwc(wchar_t, FILE *); 127118652Sachewint_t putwchar(wchar_t); 128118652Sachewint_t ungetwc(wint_t, FILE *); 129118652Sachesize_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); 130118652Sachewchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict); 131118652Sachewchar_t *wcschr(const wchar_t *, wchar_t); 132118652Sacheint wcscmp(const wchar_t *, const wchar_t *); 133118652Sachewchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict); 134118652Sachesize_t wcscspn(const wchar_t *, const wchar_t *); 135118652Sachesize_t wcslcat(wchar_t *, const wchar_t *, size_t); 136118652Sachesize_t wcslcpy(wchar_t *, const wchar_t *, size_t); 137118652Sachesize_t wcslen(const wchar_t *); 138118652Sachewchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, 139118652Sache size_t); 140118652Sacheint wcsncmp(const wchar_t *, const wchar_t *, size_t); 141118652Sachewchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t); 142118652Sachewchar_t *wcspbrk(const wchar_t *, const wchar_t *); 143118652Sachewchar_t *wcsrchr(const wchar_t *, wchar_t); 144118652Sachesize_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t, 145118652Sache mbstate_t * __restrict); 146118652Sachesize_t wcsspn(const wchar_t *, const wchar_t *); 147118652Sachewchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict); 148118652Sacheint wctob(wint_t); 149118652Sachewchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict, 150118652Sache wchar_t ** __restrict); 151118652Sachelong wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int); 152118652Sacheunsigned long 153118652Sache wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int); 154118652Sachewchar_t *wmemchr(const wchar_t *, wchar_t, size_t); 155118652Sacheint wmemcmp(const wchar_t *, const wchar_t *, size_t); 156118652Sachewchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t); 157118652Sachewchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); 158118652Sachewchar_t *wmemset(wchar_t *, wchar_t, size_t); 159118652Sache 160118652Sache#if __XSI_VISIBLE 161118652Sacheint wcswidth(const wchar_t *, size_t); 162118652Sacheint wcwidth(wchar_t); 163118652Sache#endif 164118652Sache__END_DECLS 165118652Sache 166118652Sache#define getwc(fp) fgetwc(fp) 167118652Sache#define getwchar() fgetwc(stdin) 168118652Sache#define putwc(wc, fp) fputwc(wc, fp) 169118652Sache#define putwchar(wc) fputwc(wc, stdout) 170118652Sache 171118652Sache#endif /* !_WCHAR_H_ */ 172118652Sache