mbrtowc.c revision 127835
1182007Sroberto/*-
2182007Sroberto * Copyright (c) 2002-2004 Tim J. Robbins.
3182007Sroberto * All rights reserved.
4182007Sroberto *
5182007Sroberto * Redistribution and use in source and binary forms, with or without
654359Sroberto * modification, are permitted provided that the following conditions
7182007Sroberto * are met:
8182007Sroberto * 1. Redistributions of source code must retain the above copyright
9182007Sroberto *    notice, this list of conditions and the following disclaimer.
10182007Sroberto * 2. Redistributions in binary form must reproduce the above copyright
11182007Sroberto *    notice, this list of conditions and the following disclaimer in the
12182007Sroberto *    documentation and/or other materials provided with the distribution.
13182007Sroberto *
14182007Sroberto * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15182007Sroberto * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16182007Sroberto * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17182007Sroberto * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18182007Sroberto * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19182007Sroberto * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20182007Sroberto * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2154359Sroberto * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22182007Sroberto * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23182007Sroberto * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24182007Sroberto * SUCH DAMAGE.
2554359Sroberto */
26182007Sroberto
27182007Sroberto#include <sys/cdefs.h>
28182007Sroberto__FBSDID("$FreeBSD: head/lib/libc/locale/mbrtowc.c 127835 2004-04-04 11:31:29Z tjr $");
29182007Sroberto
30182007Sroberto#include <wchar.h>
31182007Sroberto
3254359Srobertoextern size_t (*__mbrtowc)(wchar_t * __restrict, const char * __restrict,
3354359Sroberto    size_t, mbstate_t * __restrict);
3454359Sroberto
3554359Srobertosize_t
3654359Srobertombrtowc(wchar_t * __restrict pwc, const char * __restrict s,
37182007Sroberto    size_t n, mbstate_t * __restrict ps)
38182007Sroberto{
39182007Sroberto
40132451Sroberto	return (__mbrtowc(pwc, s, n, ps));
41106163Sroberto}
4254359Sroberto