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:   }

Defined functions

cclose defined in line 46; never used
cflush defined in line 37; used 4 times
copen defined in line 19; used 4 times
system defined in line 42; used 8 times

Defined variables

sccsid defined in line 8; never used
Last modified: 1985-04-30
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2562
Valid CSS Valid XHTML 1.0 Strict