BSD 4_1c_2 release
[unix-history] / usr / src / ucb / eyacc / ey5.c
static char *sccsid = "@(#)ey5.c 4.1 (Berkeley) 3/1/81";
/* (c) 1979 Regents of the University of California */
/* fake portable I/O routines, for those
sites so backward as to not have the
port. library */
/* munged for standard i/o library: peter and louise 5 may 80 */
#include <stdio.h>
FILE *cin, *cout;
FILE *copen( s, c )
char *s;
char c;
{
FILE *f;
if( c == 'r' ){
f = fopen( s, "r" );
} else if( c == 'a' ){
f = fopen( s, "a" );
fseek( f, 0L, 2 );
} else { /* c == w */
f = fopen( s, "w" );
}
return( f );
}
cflush(x) FILE *x; { /* fake! sets file to x */
fflush( cout );
cout = x;
}
system(){
error( "The function \"system\" is called" );
}
cclose(i) FILE *i; {
fclose(i);
}
cexit(i){
fflush( cout );
if ( i != 0 ) {
abort();
}
exit(i);
}