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

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

Point of no return.

  • Property mode set to 100644
File size: 764 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
8#include "stdio.h"
9#include "stddefs.h"
10
11static int scnlast;
12static FILE *scnfp;
13
[0580615]14static int gchar(what)
[f40a309]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
[0580615]28int scanf(char *fmt, int *args)
[f40a309]29{
30 scnfp = stdin;
31 scnlast = 0;
32 return(scanfmt(gchar, fmt, &args));
33}
34
[0580615]35int fscanf(FILE *fp, char *fmt, int *args)
[f40a309]36{
37 scnfp = fp;
38 scnlast = 0;
39 return(scanfmt(gchar, fmt, &args));
40}
Note: See TracBrowser for help on using the repository browser.