1169695Skan/*- 2169695Skan * Copyright (c) 2002 Tim J. Robbins 3169695Skan * All rights reserved. 4169695Skan * 5169695Skan * Copyright (c) 2011 The FreeBSD Foundation 6169695Skan * All rights reserved. 7169695Skan * Portions of this software were developed by David Chisnall 8169695Skan * under sponsorship from the FreeBSD Foundation. 9169695Skan * 10169695Skan * Redistribution and use in source and binary forms, with or without 11169695Skan * modification, are permitted provided that the following conditions 12169695Skan * are met: 13169695Skan * 1. Redistributions of source code must retain the above copyright 14169695Skan * notice, this list of conditions and the following disclaimer. 15169695Skan * 2. Redistributions in binary form must reproduce the above copyright 16169695Skan * notice, this list of conditions and the following disclaimer in the 17169695Skan * documentation and/or other materials provided with the distribution. 18169695Skan * 19169695Skan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 20169695Skan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21169695Skan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22169695Skan * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 23169695Skan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24169695Skan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25169695Skan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26169695Skan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27169695Skan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28169695Skan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29169695Skan * SUCH DAMAGE. 30169695Skan */ 31169695Skan 32169695Skan#include <sys/cdefs.h> 33169695Skan__FBSDID("$FreeBSD: releng/10.3/lib/libc/stdio/wscanf.c 227753 2011-11-20 14:45:42Z theraven $"); 34169695Skan 35169695Skan#include <stdarg.h> 36169695Skan#include <stdio.h> 37169695Skan#include <wchar.h> 38169695Skan#include <xlocale.h> 39169695Skan 40169695Skanint 41169695Skanwscanf(const wchar_t * __restrict fmt, ...) 42169695Skan{ 43169695Skan va_list ap; 44169695Skan int r; 45169695Skan 46169695Skan va_start(ap, fmt); 47169695Skan r = vfwscanf(stdin, fmt, ap); 48169695Skan va_end(ap); 49169695Skan 50169695Skan return (r); 51169695Skan} 52169695Skanint 53169695Skanwscanf_l(locale_t locale, const wchar_t * __restrict fmt, ...) 54169695Skan{ 55169695Skan va_list ap; 56169695Skan int r; 57169695Skan 58169695Skan va_start(ap, fmt); 59169695Skan r = vfwscanf_l(stdin, locale, fmt, ap); 60169695Skan va_end(ap); 61169695Skan 62169695Skan return (r); 63169695Skan} 64169695Skan