wscanf.c revision 103856
1103856Stjr/*-
2103856Stjr * Copyright (c) 2002 Tim J. Robbins
3103856Stjr * All rights reserved.
4103856Stjr *
5103856Stjr * Redistribution and use in source and binary forms, with or without
6103856Stjr * modification, are permitted provided that the following conditions
7103856Stjr * are met:
8103856Stjr * 1. Redistributions of source code must retain the above copyright
9103856Stjr *    notice, this list of conditions and the following disclaimer.
10103856Stjr * 2. Redistributions in binary form must reproduce the above copyright
11103856Stjr *    notice, this list of conditions and the following disclaimer in the
12103856Stjr *    documentation and/or other materials provided with the distribution.
13103856Stjr *
14103856Stjr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15103856Stjr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16103856Stjr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17103856Stjr * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18103856Stjr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19103856Stjr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20103856Stjr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21103856Stjr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22103856Stjr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23103856Stjr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24103856Stjr * SUCH DAMAGE.
25103856Stjr */
26103856Stjr
27103856Stjr#include <sys/cdefs.h>
28103856Stjr__FBSDID("$FreeBSD: head/lib/libc/stdio/wscanf.c 103856 2002-09-23 12:40:06Z tjr $");
29103856Stjr
30103856Stjr#include <stdarg.h>
31103856Stjr#include <stdio.h>
32103856Stjr#include <wchar.h>
33103856Stjr
34103856Stjrint
35103856Stjrwscanf(const wchar_t * __restrict fmt, ...)
36103856Stjr{
37103856Stjr	va_list ap;
38103856Stjr	int r;
39103856Stjr
40103856Stjr	va_start(ap, fmt);
41103856Stjr	r = vfwscanf(stdin, fmt, ap);
42103856Stjr	va_end(ap);
43103856Stjr
44103856Stjr	return (r);
45103856Stjr}
46