source: buchla-68k/orig/IOLIB/FSCANF.C@ 4b63bf3

Last change on this file since 4b63bf3 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 839 bytes
Line 
1/*
2 =============================================================================
3 fscanf.c -- scan a stream file for input for the portable C I/O Library
4 Version 4 -- 1989-01-16 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stdio.h"
9#include "stddefs.h"
10
11static int scnlast;
12static FILE *scnfp;
13
14static
15int
16gchar(what)
17{
18 if (what EQ 0) {
19
20 if (feof(scnfp))
21 scnlast = EOF;
22 else
23 scnlast = agetc(scnfp);
24 } else
25 scnlast = ungetc(scnlast, scnfp);
26
27 return(scnlast);
28}
29
30int
31scanf(fmt, args)
32char *fmt;
33int *args;
34{
35 scnfp = stdin;
36 scnlast = 0;
37 return(scanfmt(gchar, fmt, &args));
38}
39
40int
41fscanf(fp, fmt, args)
42FILE *fp;
43char *fmt;
44int *args;
45{
46 scnfp = fp;
47 scnlast = 0;
48 return(scanfmt(gchar, fmt, &args));
49}
Note: See TracBrowser for help on using the repository browser.