swscanf.c revision 103856
150276Speter/*-
276726Speter * Copyright (c) 2002 Tim J. Robbins
350276Speter * All rights reserved.
450276Speter *
550276Speter * Redistribution and use in source and binary forms, with or without
650276Speter * modification, are permitted provided that the following conditions
750276Speter * are met:
850276Speter * 1. Redistributions of source code must retain the above copyright
950276Speter *    notice, this list of conditions and the following disclaimer.
1050276Speter * 2. Redistributions in binary form must reproduce the above copyright
1150276Speter *    notice, this list of conditions and the following disclaimer in the
1250276Speter *    documentation and/or other materials provided with the distribution.
1350276Speter *
1450276Speter * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1550276Speter * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1650276Speter * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1750276Speter * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1850276Speter * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1950276Speter * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2050276Speter * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2150276Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2250276Speter * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2350276Speter * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2450276Speter * SUCH DAMAGE.
2550276Speter */
2650276Speter
2750276Speter#include <sys/cdefs.h>
2850276Speter__FBSDID("$FreeBSD: head/lib/libc/stdio/swscanf.c 103856 2002-09-23 12:40:06Z tjr $");
2950276Speter
3050276Speter#include <stdarg.h>
3150276Speter#include <stdio.h>
3250276Speter#include <wchar.h>
3350276Speter
3476726Speterint
3550276Speterswscanf(const wchar_t * __restrict str, const wchar_t * __restrict fmt, ...)
3650276Speter{
3750276Speter	va_list ap;
3850276Speter	int r;
3950276Speter
4050276Speter	va_start(ap, fmt);
4150276Speter	r = vswscanf(str, fmt, ap);
4250276Speter	va_end(ap);
4350276Speter
4450276Speter	return (r);
4550276Speter}
4650276Speter