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

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

Zero redundant declarations.

  • Property mode set to 100644
File size: 778 bytes
RevLine 
[f40a309]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
[b28a12e]8#include "ram.h"
[e225e77]9
[7258c6a]10static int16_t scnlast;
[f40a309]11static FILE *scnfp;
12
[7258c6a]13static int16_t gchar(int16_t what)
[f40a309]14{
15 if (what EQ 0) {
16
17 if (feof(scnfp))
18 scnlast = EOF;
19 else
20 scnlast = agetc(scnfp);
21 } else
22 scnlast = ungetc(scnlast, scnfp);
23
24 return(scnlast);
25}
26
[7258c6a]27int16_t scanf(int8_t *fmt, int16_t *args)
[f40a309]28{
29 scnfp = stdin;
30 scnlast = 0;
31 return(scanfmt(gchar, fmt, &args));
32}
33
[7258c6a]34int16_t fscanf(FILE *fp, int8_t *fmt, int16_t *args)
[f40a309]35{
36 scnfp = fp;
37 scnlast = 0;
38 return(scanfmt(gchar, fmt, &args));
39}
[6262b5c]40
Note: See TracBrowser for help on using the repository browser.