1103856Stjr/*- 2103856Stjr * Copyright (c) 2002 Tim J. Robbins 3103856Stjr * All rights reserved. 4103856Stjr * 5227753Stheraven * Copyright (c) 2011 The FreeBSD Foundation 6227753Stheraven * All rights reserved. 7227753Stheraven * Portions of this software were developed by David Chisnall 8227753Stheraven * under sponsorship from the FreeBSD Foundation. 9227753Stheraven * 10103856Stjr * Redistribution and use in source and binary forms, with or without 11103856Stjr * modification, are permitted provided that the following conditions 12103856Stjr * are met: 13103856Stjr * 1. Redistributions of source code must retain the above copyright 14103856Stjr * notice, this list of conditions and the following disclaimer. 15103856Stjr * 2. Redistributions in binary form must reproduce the above copyright 16103856Stjr * notice, this list of conditions and the following disclaimer in the 17103856Stjr * documentation and/or other materials provided with the distribution. 18103856Stjr * 19103856Stjr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 20103856Stjr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21103856Stjr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22103856Stjr * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 23103856Stjr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24103856Stjr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25103856Stjr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26103856Stjr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27103856Stjr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28103856Stjr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29103856Stjr * SUCH DAMAGE. 30103856Stjr */ 31103856Stjr 32103856Stjr#include <sys/cdefs.h> 33103856Stjr__FBSDID("$FreeBSD: releng/11.0/lib/libc/stdio/swscanf.c 227753 2011-11-20 14:45:42Z theraven $"); 34103856Stjr 35103856Stjr#include <stdarg.h> 36103856Stjr#include <stdio.h> 37103856Stjr#include <wchar.h> 38227753Stheraven#include <xlocale.h> 39103856Stjr 40103856Stjrint 41103856Stjrswscanf(const wchar_t * __restrict str, const wchar_t * __restrict fmt, ...) 42103856Stjr{ 43103856Stjr va_list ap; 44103856Stjr int r; 45103856Stjr 46103856Stjr va_start(ap, fmt); 47103856Stjr r = vswscanf(str, fmt, ap); 48103856Stjr va_end(ap); 49103856Stjr 50103856Stjr return (r); 51103856Stjr} 52227753Stheravenint 53227753Stheravenswscanf_l(const wchar_t * __restrict str, locale_t locale, 54227753Stheraven const wchar_t * __restrict fmt, ...) 55227753Stheraven{ 56227753Stheraven va_list ap; 57227753Stheraven int r; 58227753Stheraven 59227753Stheraven va_start(ap, fmt); 60227753Stheraven r = vswscanf_l(str, locale, fmt, ap); 61227753Stheraven va_end(ap); 62227753Stheraven 63227753Stheraven return (r); 64227753Stheraven} 65