1*9b9d2a55Sguenther /* $OpenBSD: fwscanf.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */
22d31a56bSstsp
32d31a56bSstsp /*-
42d31a56bSstsp * Copyright (c) 2002 Tim J. Robbins
52d31a56bSstsp * All rights reserved.
62d31a56bSstsp *
72d31a56bSstsp * Redistribution and use in source and binary forms, with or without
82d31a56bSstsp * modification, are permitted provided that the following conditions
92d31a56bSstsp * are met:
102d31a56bSstsp * 1. Redistributions of source code must retain the above copyright
112d31a56bSstsp * notice, this list of conditions and the following disclaimer.
122d31a56bSstsp * 2. Redistributions in binary form must reproduce the above copyright
132d31a56bSstsp * notice, this list of conditions and the following disclaimer in the
142d31a56bSstsp * documentation and/or other materials provided with the distribution.
152d31a56bSstsp *
162d31a56bSstsp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
172d31a56bSstsp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
182d31a56bSstsp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
192d31a56bSstsp * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
202d31a56bSstsp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
212d31a56bSstsp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
222d31a56bSstsp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
232d31a56bSstsp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
242d31a56bSstsp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
252d31a56bSstsp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
262d31a56bSstsp * SUCH DAMAGE.
272d31a56bSstsp */
282d31a56bSstsp
292d31a56bSstsp #include <stdarg.h>
302d31a56bSstsp #include <stdio.h>
312d31a56bSstsp #include <wchar.h>
322d31a56bSstsp
332d31a56bSstsp int
fwscanf(FILE * __restrict fp,const wchar_t * __restrict fmt,...)342d31a56bSstsp fwscanf(FILE * __restrict fp, const wchar_t * __restrict fmt, ...)
352d31a56bSstsp {
362d31a56bSstsp va_list ap;
372d31a56bSstsp int r;
382d31a56bSstsp
392d31a56bSstsp va_start(ap, fmt);
402d31a56bSstsp r = vfwscanf(fp, fmt, ap);
412d31a56bSstsp va_end(ap);
422d31a56bSstsp
432d31a56bSstsp return (r);
442d31a56bSstsp }
45*9b9d2a55Sguenther DEF_STRONG(fwscanf);
46