This commit is contained in:
Oliver Lehmann 1989-12-07 07:55:58 +00:00
parent 43ebe4635d
commit 3725e15ff1
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
# include <stdio.h>
/* fake portable I/O routines, for those
sites so backward as to not have the
port. library */
FILE *cin, *cout;
FILE *Fin, *Fout;
FILE *copen(s, c)
register char *s;
register char *c;
{
register FILE *f;
if ((f = fopen(s, c)) == (FILE *) 0)
error("cannot open %s", s);
else if (*c == 'r')
Fin = f;
return (f);
}
cflush(x)
register FILE *x;
{
/* fake! sets file to x */
fflush(Fout);
Fout = x;
}
cexit(i)
register int i;
{
fflush(Fout);
exit(i);
}