xref: /freebsd/lib/libc/stdio/vwscanf.c (revision 559a218c9b257775fb249b67945fe4a05b7a6b9f)
11f4ff850STim J. Robbins /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3d915a14eSPedro F. Giffuni  *
41f4ff850STim J. Robbins  * Copyright (c) 2002 Tim J. Robbins
51f4ff850STim J. Robbins  * All rights reserved.
61f4ff850STim J. Robbins  *
73c87aa1dSDavid Chisnall  * Copyright (c) 2011 The FreeBSD Foundation
85b5fa75aSEd Maste  *
93c87aa1dSDavid Chisnall  * Portions of this software were developed by David Chisnall
103c87aa1dSDavid Chisnall  * under sponsorship from the FreeBSD Foundation.
113c87aa1dSDavid Chisnall  *
121f4ff850STim J. Robbins  * Redistribution and use in source and binary forms, with or without
131f4ff850STim J. Robbins  * modification, are permitted provided that the following conditions
141f4ff850STim J. Robbins  * are met:
151f4ff850STim J. Robbins  * 1. Redistributions of source code must retain the above copyright
161f4ff850STim J. Robbins  *    notice, this list of conditions and the following disclaimer.
171f4ff850STim J. Robbins  * 2. Redistributions in binary form must reproduce the above copyright
181f4ff850STim J. Robbins  *    notice, this list of conditions and the following disclaimer in the
191f4ff850STim J. Robbins  *    documentation and/or other materials provided with the distribution.
201f4ff850STim J. Robbins  *
211f4ff850STim J. Robbins  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
221f4ff850STim J. Robbins  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231f4ff850STim J. Robbins  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241f4ff850STim J. Robbins  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
251f4ff850STim J. Robbins  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261f4ff850STim J. Robbins  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271f4ff850STim J. Robbins  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281f4ff850STim J. Robbins  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291f4ff850STim J. Robbins  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301f4ff850STim J. Robbins  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311f4ff850STim J. Robbins  * SUCH DAMAGE.
321f4ff850STim J. Robbins  */
331f4ff850STim J. Robbins 
341f4ff850STim J. Robbins #include <stdarg.h>
351f4ff850STim J. Robbins #include <stdio.h>
361f4ff850STim J. Robbins #include <wchar.h>
373c87aa1dSDavid Chisnall #include <xlocale.h>
381f4ff850STim J. Robbins 
391f4ff850STim J. Robbins int
vwscanf(const wchar_t * __restrict fmt,va_list ap)401f4ff850STim J. Robbins vwscanf(const wchar_t * __restrict fmt, va_list ap)
411f4ff850STim J. Robbins {
421f4ff850STim J. Robbins 	return (vfwscanf(stdin, fmt, ap));
431f4ff850STim J. Robbins }
443c87aa1dSDavid Chisnall int
vwscanf_l(locale_t locale,const wchar_t * __restrict fmt,va_list ap)453c87aa1dSDavid Chisnall vwscanf_l(locale_t locale, const wchar_t * __restrict fmt, va_list ap)
463c87aa1dSDavid Chisnall {
473c87aa1dSDavid Chisnall 	return (vfwscanf_l(stdin, locale, fmt, ap));
483c87aa1dSDavid Chisnall }
49