summaryrefslogtreecommitdiff
path: root/scanf/fscanf.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-11-15 22:24:50 +0100
committerKevin Ryde <user42@zip.com.au>2001-11-15 22:24:50 +0100
commitcc9aa932213e08202b0cc306f739a21d5d5ea613 (patch)
tree6f31d721fec56218071391c09d986f7315bc80fe /scanf/fscanf.c
parent74990db073a093a85774be2e6a4e44eaaf5e812d (diff)
downloadgmp-cc9aa932213e08202b0cc306f739a21d5d5ea613.tar.gz
* scanf/doscan.c, scanf/fscanf.c, scanf/fscanffuns.c, scanf/scanf.c,
scanf/sscanf.c, scanf/sscanffuns.c, scanf/vfscanf.c, scanf/vscanf.c, scanf/vsscanf.c, scanf/Makefile.am, tests/misc/t-scanf.c: New files.
Diffstat (limited to 'scanf/fscanf.c')
-rw-r--r--scanf/fscanf.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/scanf/fscanf.c b/scanf/fscanf.c
new file mode 100644
index 000000000..d61137ec5
--- /dev/null
+++ b/scanf/fscanf.c
@@ -0,0 +1,59 @@
+/* gmp_fscanf -- formatted input from a FILE.
+
+Copyright 2001 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at your
+option) any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MP Library; see the file COPYING.LIB. If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA. */
+
+#include "config.h"
+
+#if HAVE_STDARG
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+
+int
+#if HAVE_STDARG
+gmp_fscanf (FILE *fp, const char *fmt, ...)
+#else
+gmp_fscanf (va_alist)
+ va_dcl
+#endif
+{
+ va_list ap;
+ int ret;
+#if HAVE_STDARG
+ va_start (ap, fmt);
+#else
+ FILE *fp;
+ const char *fmt;
+ va_start (ap);
+ fp = va_arg (ap, FILE *);
+ fmt = va_arg (ap, const char *);
+#endif
+
+ ret = __gmp_doscan (&__gmp_fscanf_funs, fp, fmt, ap);
+ va_end (ap);
+ return ret;
+}