|
|
1.1 ! root 1: static char *sccsid = "@(#)ey5.c 4.1 (Berkeley) 3/1/81"; ! 2: /* (c) 1979 Regents of the University of California */ ! 3: /* fake portable I/O routines, for those ! 4: sites so backward as to not have the ! 5: port. library */ ! 6: /* munged for standard i/o library: peter and louise 5 may 80 */ ! 7: #include <stdio.h> ! 8: ! 9: FILE *cin, *cout; ! 10: ! 11: FILE *copen( s, c ) ! 12: char *s; ! 13: char c; ! 14: { ! 15: FILE *f; ! 16: ! 17: if( c == 'r' ){ ! 18: f = fopen( s, "r" ); ! 19: } else if( c == 'a' ){ ! 20: f = fopen( s, "a" ); ! 21: fseek( f, 0L, 2 ); ! 22: } else { /* c == w */ ! 23: f = fopen( s, "w" ); ! 24: } ! 25: ! 26: return( f ); ! 27: } ! 28: ! 29: cflush(x) FILE *x; { /* fake! sets file to x */ ! 30: fflush( cout ); ! 31: cout = x; ! 32: } ! 33: ! 34: system(){ ! 35: error( "The function \"system\" is called" ); ! 36: } ! 37: ! 38: cclose(i) FILE *i; { ! 39: fclose(i); ! 40: } ! 41: ! 42: cexit(i){ ! 43: fflush( cout ); ! 44: if ( i != 0 ) { ! 45: abort(); ! 46: } ! 47: exit(i); ! 48: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.