source: buchla-68k/libcio/fscanf.c@ 599d89b

Last change on this file since 599d89b was 599d89b, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Missing return values. Missing int declarations.

  • Property mode set to 100644
File size: 768 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 int gchar(int what)
15{
16 if (what EQ 0) {
17
18 if (feof(scnfp))
19 scnlast = EOF;
20 else
21 scnlast = agetc(scnfp);
22 } else
23 scnlast = ungetc(scnlast, scnfp);
24
25 return(scnlast);
26}
27
28int scanf(char *fmt, int *args)
29{
30 scnfp = stdin;
31 scnlast = 0;
32 return(scanfmt(gchar, fmt, &args));
33}
34
35int fscanf(FILE *fp, char *fmt, int *args)
36{
37 scnfp = fp;
38 scnlast = 0;
39 return(scanfmt(gchar, fmt, &args));
40}
Note: See TracBrowser for help on using the repository browser.