Home | History | Annotate | Line # | Download | only in include
wchar.h revision 1.20
      1  1.20    kleink /*	$NetBSD: wchar.h,v 1.20 2004/05/08 21:57:05 kleink Exp $	*/
      2   1.2    itojun 
      3   1.2    itojun /*-
      4   1.2    itojun  * Copyright (c)1999 Citrus Project,
      5   1.2    itojun  * All rights reserved.
      6   1.2    itojun  *
      7   1.2    itojun  * Redistribution and use in source and binary forms, with or without
      8   1.2    itojun  * modification, are permitted provided that the following conditions
      9   1.2    itojun  * are met:
     10   1.2    itojun  * 1. Redistributions of source code must retain the above copyright
     11   1.2    itojun  *    notice, this list of conditions and the following disclaimer.
     12   1.2    itojun  * 2. Redistributions in binary form must reproduce the above copyright
     13   1.2    itojun  *    notice, this list of conditions and the following disclaimer in the
     14   1.2    itojun  *    documentation and/or other materials provided with the distribution.
     15   1.2    itojun  *
     16   1.2    itojun  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     17   1.2    itojun  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     18   1.2    itojun  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     19   1.2    itojun  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     20   1.2    itojun  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     21   1.2    itojun  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     22   1.2    itojun  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     23   1.2    itojun  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     24   1.2    itojun  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     25   1.2    itojun  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     26   1.2    itojun  * SUCH DAMAGE.
     27   1.2    itojun  */
     28   1.1    kleink 
     29   1.1    kleink /*-
     30   1.1    kleink  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
     31   1.1    kleink  * All rights reserved.
     32   1.1    kleink  *
     33   1.1    kleink  * This code is derived from software contributed to The NetBSD Foundation
     34   1.1    kleink  * by Julian Coleman.
     35   1.1    kleink  *
     36   1.1    kleink  * Redistribution and use in source and binary forms, with or without
     37   1.1    kleink  * modification, are permitted provided that the following conditions
     38   1.1    kleink  * are met:
     39   1.1    kleink  * 1. Redistributions of source code must retain the above copyright
     40   1.1    kleink  *    notice, this list of conditions and the following disclaimer.
     41   1.1    kleink  * 2. Redistributions in binary form must reproduce the above copyright
     42   1.1    kleink  *    notice, this list of conditions and the following disclaimer in the
     43   1.1    kleink  *    documentation and/or other materials provided with the distribution.
     44   1.1    kleink  * 3. All advertising materials mentioning features or use of this software
     45   1.1    kleink  *    must display the following acknowledgement:
     46   1.1    kleink  *        This product includes software developed by the NetBSD
     47   1.1    kleink  *        Foundation, Inc. and its contributors.
     48   1.1    kleink  * 4. Neither the name of The NetBSD Foundation nor the names of its
     49   1.1    kleink  *    contributors may be used to endorse or promote products derived
     50   1.1    kleink  *    from this software without specific prior written permission.
     51   1.1    kleink  *
     52   1.1    kleink  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     53   1.1    kleink  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     54   1.1    kleink  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     55   1.1    kleink  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     56   1.1    kleink  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     57   1.1    kleink  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     58   1.1    kleink  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     59   1.1    kleink  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     60   1.1    kleink  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     61   1.1    kleink  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     62   1.1    kleink  * POSSIBILITY OF SUCH DAMAGE.
     63   1.1    kleink  */
     64   1.1    kleink 
     65   1.1    kleink #ifndef _WCHAR_H_
     66   1.1    kleink #define _WCHAR_H_
     67   1.1    kleink 
     68   1.2    itojun #include <sys/cdefs.h>
     69  1.18     bjh21 #include <sys/featuretest.h>
     70   1.1    kleink #include <machine/ansi.h>
     71  1.20    kleink #include <machine/wchar_limits.h>
     72   1.3    itojun #include <sys/null.h>
     73   1.1    kleink 
     74  1.11      yamt #include <stdio.h> /* for FILE* */
     75  1.11      yamt 
     76   1.1    kleink #ifdef	_BSD_WCHAR_T_
     77   1.1    kleink typedef	_BSD_WCHAR_T_	wchar_t;
     78   1.1    kleink #undef	_BSD_WCHAR_T_
     79   1.1    kleink #endif
     80   1.1    kleink 
     81   1.5    itojun #ifdef	_BSD_MBSTATE_T_
     82   1.5    itojun typedef	_BSD_MBSTATE_T_	mbstate_t;
     83   1.5    itojun #undef	_BSD_MBSTATE_T_
     84   1.5    itojun #endif
     85   1.5    itojun 
     86   1.1    kleink #ifdef	_BSD_WINT_T_
     87   1.1    kleink typedef	_BSD_WINT_T_	wint_t;
     88   1.1    kleink #undef	_BSD_WINT_T_
     89   1.1    kleink #endif
     90   1.1    kleink 
     91   1.1    kleink #ifdef	_BSD_SIZE_T_
     92   1.1    kleink typedef	_BSD_SIZE_T_	size_t;
     93   1.1    kleink #undef	_BSD_SIZE_T_
     94   1.1    kleink #endif
     95   1.2    itojun 
     96   1.4    itojun #ifndef WEOF
     97   1.4    itojun #define	WEOF 	((wint_t)-1)
     98   1.4    itojun #endif
     99   1.4    itojun 
    100  1.11      yamt #define getwc(f) fgetwc(f)
    101  1.11      yamt #define getwchar() getwc(stdin)
    102  1.11      yamt #define putwc(wc, f) fputwc((wc), (f))
    103  1.11      yamt #define putwchar(wc) putwc((wc), stdout)
    104  1.11      yamt 
    105   1.2    itojun __BEGIN_DECLS
    106  1.14  tshiozak wint_t	btowc __P((int));
    107   1.9    kleink size_t	mbrlen __P((const char * __restrict, size_t, mbstate_t * __restrict));
    108   1.9    kleink size_t	mbrtowc __P((wchar_t * __restrict, const char * __restrict, size_t,
    109   1.9    kleink 	    mbstate_t * __restrict));
    110   1.6    itojun int	mbsinit __P((const mbstate_t *));
    111   1.9    kleink size_t	mbsrtowcs __P((wchar_t * __restrict, const char ** __restrict, size_t,
    112   1.9    kleink 	    mbstate_t * __restrict));
    113   1.9    kleink size_t	wcrtomb __P((char * __restrict, wchar_t, mbstate_t * __restrict));
    114   1.9    kleink wchar_t	*wcscat __P((wchar_t * __restrict, const wchar_t * __restrict));
    115   1.4    itojun wchar_t	*wcschr __P((const wchar_t *, wchar_t));
    116   1.4    itojun int	wcscmp __P((const wchar_t *, const wchar_t *));
    117  1.13  tshiozak int	wcscoll __P((const wchar_t *, const wchar_t *));
    118   1.9    kleink wchar_t	*wcscpy __P((wchar_t * __restrict, const wchar_t * __restrict));
    119   1.4    itojun size_t	wcscspn __P((const wchar_t *, const wchar_t *));
    120   1.4    itojun size_t	wcslen __P((const wchar_t *));
    121   1.9    kleink wchar_t	*wcsncat __P((wchar_t * __restrict, const wchar_t * __restrict,
    122   1.9    kleink 	    size_t));
    123   1.4    itojun int	wcsncmp __P((const wchar_t *, const wchar_t *, size_t));
    124   1.9    kleink wchar_t	*wcsncpy __P((wchar_t * __restrict , const wchar_t * __restrict,
    125   1.9    kleink 	    size_t));
    126   1.4    itojun wchar_t	*wcspbrk __P((const wchar_t *, const wchar_t *));
    127   1.4    itojun wchar_t	*wcsrchr __P((const wchar_t *, wchar_t));
    128   1.9    kleink size_t	wcsrtombs __P((char * __restrict, const wchar_t ** __restrict, size_t,
    129   1.9    kleink 	    mbstate_t * __restrict));
    130   1.4    itojun size_t	wcsspn __P((const wchar_t *, const wchar_t *));
    131   1.4    itojun wchar_t	*wcsstr __P((const wchar_t *, const wchar_t *));
    132  1.15  tshiozak wchar_t *wcstok __P((wchar_t * __restrict, const wchar_t * __restrict,
    133  1.15  tshiozak 		     wchar_t ** __restrict));
    134  1.13  tshiozak size_t	wcsxfrm __P((wchar_t *, const wchar_t *, size_t));
    135  1.15  tshiozak wchar_t	*wcswcs __P((const wchar_t *, const wchar_t *));
    136   1.2    itojun wchar_t	*wmemchr __P((const wchar_t *, wchar_t, size_t));
    137   1.2    itojun int	wmemcmp __P((const wchar_t *, const wchar_t *, size_t));
    138   1.9    kleink wchar_t	*wmemcpy __P((wchar_t * __restrict, const wchar_t * __restrict,
    139   1.9    kleink 	    size_t));
    140   1.2    itojun wchar_t	*wmemmove __P((wchar_t *, const wchar_t *, size_t));
    141   1.2    itojun wchar_t	*wmemset __P((wchar_t *, wchar_t, size_t));
    142   1.7    itojun 
    143   1.7    itojun size_t	wcslcat __P((wchar_t *, const wchar_t *, size_t));
    144   1.7    itojun size_t	wcslcpy __P((wchar_t *, const wchar_t *, size_t));
    145   1.8    itojun int	wcswidth __P((const wchar_t *, size_t));
    146  1.14  tshiozak int	wctob __P((wint_t));
    147   1.8    itojun int	wcwidth __P((wchar_t));
    148  1.10      yamt 
    149  1.17  tshiozak unsigned long int wcstoul __P((const wchar_t * __restrict,
    150  1.19    itojun 	wchar_t ** __restrict, int));
    151  1.17  tshiozak long int wcstol __P((const wchar_t * __restrict,
    152  1.19    itojun 	wchar_t ** __restrict, int));
    153  1.10      yamt double wcstod __P((const wchar_t * __restrict, wchar_t ** __restrict));
    154  1.17  tshiozak 
    155  1.18     bjh21 #if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) > 199901L || \
    156  1.18     bjh21     defined(_NETBSD_SOURCE)
    157  1.17  tshiozak /* LONGLONG */
    158  1.17  tshiozak long long int wcstoll __P((const wchar_t * __restrict,
    159  1.19    itojun 	wchar_t ** __restrict, int));
    160  1.17  tshiozak /* LONGLONG */
    161  1.17  tshiozak unsigned long long int wcstoull __P((const wchar_t * __restrict,
    162  1.19    itojun 	wchar_t ** __restrict, int));
    163  1.17  tshiozak #endif
    164  1.11      yamt 
    165  1.11      yamt wint_t ungetwc __P((wint_t, FILE *));
    166  1.11      yamt wint_t fgetwc __P((FILE *));
    167  1.16  tshiozak wchar_t *fgetws __P((wchar_t * __restrict, int, FILE * __restrict));
    168  1.11      yamt wint_t getwc __P((FILE *));
    169  1.11      yamt wint_t getwchar __P((void));
    170  1.12      yamt wint_t fputwc __P((wchar_t, FILE *));
    171  1.16  tshiozak int fputws __P((const wchar_t * __restrict, FILE * __restrict));
    172  1.12      yamt wint_t putwc __P((wchar_t, FILE *));
    173  1.12      yamt wint_t putwchar __P((wchar_t));
    174  1.11      yamt 
    175  1.11      yamt int fwide __P((FILE *, int));
    176   1.2    itojun __END_DECLS
    177   1.1    kleink 
    178   1.1    kleink #endif /* !_WCHAR_H_ */
    179