xref: /netbsd/external/lgpl3/gmp/dist/scanf/scanf.c (revision 671ea119)
14a1767b4Smrg /* gmp_scanf -- formatted input from stdin.
24a1767b4Smrg 
34a1767b4Smrg Copyright 2001 Free Software Foundation, Inc.
44a1767b4Smrg 
54a1767b4Smrg This file is part of the GNU MP Library.
64a1767b4Smrg 
74a1767b4Smrg The GNU MP Library is free software; you can redistribute it and/or modify
8*f81b1c5bSmrg it under the terms of either:
9*f81b1c5bSmrg 
10*f81b1c5bSmrg   * the GNU Lesser General Public License as published by the Free
11*f81b1c5bSmrg     Software Foundation; either version 3 of the License, or (at your
124a1767b4Smrg     option) any later version.
134a1767b4Smrg 
14*f81b1c5bSmrg or
15*f81b1c5bSmrg 
16*f81b1c5bSmrg   * the GNU General Public License as published by the Free Software
17*f81b1c5bSmrg     Foundation; either version 2 of the License, or (at your option) any
18*f81b1c5bSmrg     later version.
19*f81b1c5bSmrg 
20*f81b1c5bSmrg or both in parallel, as here.
21*f81b1c5bSmrg 
224a1767b4Smrg The GNU MP Library is distributed in the hope that it will be useful, but
234a1767b4Smrg WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24*f81b1c5bSmrg or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
25*f81b1c5bSmrg for more details.
264a1767b4Smrg 
27*f81b1c5bSmrg You should have received copies of the GNU General Public License and the
28*f81b1c5bSmrg GNU Lesser General Public License along with the GNU MP Library.  If not,
29*f81b1c5bSmrg see https://www.gnu.org/licenses/.  */
304a1767b4Smrg 
314a1767b4Smrg #include <stdarg.h>
324a1767b4Smrg #include <stdio.h>
334a1767b4Smrg 
344a1767b4Smrg #include "gmp-impl.h"
354a1767b4Smrg 
364a1767b4Smrg 
374a1767b4Smrg int
gmp_scanf(const char * fmt,...)384a1767b4Smrg gmp_scanf (const char *fmt, ...)
394a1767b4Smrg {
404a1767b4Smrg   va_list  ap;
414a1767b4Smrg   int      ret;
424a1767b4Smrg   va_start (ap, fmt);
434a1767b4Smrg 
444a1767b4Smrg   ret = __gmp_doscan (&__gmp_fscanf_funs, stdin, fmt, ap);
454a1767b4Smrg   va_end (ap);
464a1767b4Smrg   return ret;
474a1767b4Smrg }
48