/*
 * Libraries and headers for PDC release 3.3 (C) 1989 Lionel Hummel.
 * PDC Software Distribution (C) 1989 Lionel Hummel and Paul Petersen.
 * PDC I/O Library (C) 1987 by J.A. Lydiatt.
 *
 * This code is freely redistributable upon the conditions that this
 * notice remains intact and that modified versions of this file not
 * be included as part of the PDC Software Distribution without the
 * express consent of the copyright holders.  No warrantee of any
 * kind is provided with this code.  For further information, contact:
 *
 *  PDC Software Distribution    Internet:                     BIX:
 *  P.O. Box 4006             or hummel@cs.uiuc.edu            lhummel
 *  Urbana, IL  61801-8801       petersen@uicsrd.csrd.uiuc.edu
 */

/*
        fscanf.c - Routines for formatted Input (non-FP version)

        This file is a public domain contribution from Jeff Lydiatt

        ** Modified for Amiga GCC by Ray Burr **

        sscanf(buf, fmt, args)                  Scan from a memory buffer
            char           *buf, *fmt;
            void           *args;

        fscanf(fp, fmt, args)                   Scan from a file pointer
            FILE           *fp;
            char           *fmt;
            void           *args;

        scanf(fmt, args)                        Scan from stdin
            char           *fmt;
            void           *args;
*/

#include <stdio.h>
#include <stdarg.h>

/* Uses _doscan() from libsrc/stdlib/doscan.c or libsrc/math/doscan.c */
int _doscan ();

int
sscanf (const char *s, const char *format, ...)
{
  va_list args;
  int count;

  va_start (args, format);
  count = _doscan (format, args, NULL, s);
  va_end (args);
  return count;
}


int
fscanf (FILE *stream, const char *format, ...)
{
  va_list args;
  int count;

  va_start (args, format);
  count = _doscan (format, args, stream, NULL);
  va_end (args);
  return count;
}


int
scanf (const char *format, ...)
{
  va_list args;
  int count;

  va_start (args, format);
  count = _doscan (format, args, stdin, NULL);
  va_end (args);
  return count;
}
