mbrlen.c revision 102050
176259Sgreen/*-
276259Sgreen * Copyright (c) 2002 Tim J. Robbins.
365668Skris * All rights reserved.
465668Skris *
565668Skris * Redistribution and use in source and binary forms, with or without
665668Skris * modification, are permitted provided that the following conditions
765668Skris * are met:
865668Skris * 1. Redistributions of source code must retain the above copyright
965668Skris *    notice, this list of conditions and the following disclaimer.
1065668Skris * 2. Redistributions in binary form must reproduce the above copyright
1165668Skris *    notice, this list of conditions and the following disclaimer in the
1265668Skris *    documentation and/or other materials provided with the distribution.
1365668Skris *
1465668Skris * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1565668Skris * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1665668Skris * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1765668Skris * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1865668Skris * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1965668Skris * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2065668Skris * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2165668Skris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2265668Skris * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2365668Skris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2465668Skris * SUCH DAMAGE.
2565668Skris */
2669587Sgreen
2776259Sgreen#include <sys/cdefs.h>
2869587Sgreen__FBSDID("$FreeBSD: head/lib/libc/locale/mbrlen.c 102050 2002-08-18 06:30:10Z tjr $");
2976259Sgreen
3076259Sgreen#include <wchar.h>
3169587Sgreen
3269587Sgreensize_t
3376259Sgreenmbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps __unused)
3476259Sgreen{
3576259Sgreen
3676259Sgreen	return (mbrtowc(NULL, s, n, NULL));
3769587Sgreen}
3860573Skris