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