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

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

Compiled full ROM in Hatari.

  • Property mode set to 100644
File size: 839 bytes
RevLine 
[109c83b]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.