1 /*- 2 * Copyright (c) 1980 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.proprietary.c% 6 */ 7 8 #ifndef lint 9 static char sccsid[] = "@(#)rfi.c 5.2 (Berkeley) 04/12/91"; 10 #endif /* not lint */ 11 12 /* 13 * internal (character array) i/o: read formatted, sequential and direct 14 */ 15 16 #include "fio.h" 17 18 extern int rd_ed(),rd_ned(); 19 extern int z_getc(),z_rnew(),z_tab(); 20 21 LOCAL 22 c_rfi() 23 { 24 reading = YES; 25 doed=rd_ed; 26 doned=rd_ned; 27 getn=z_getc; 28 doend = donewrec = z_rnew; 29 dorevert = z_rnew; 30 dotab = z_tab; 31 } 32 33 s_rsfi(a) icilist *a; 34 { 35 int n; 36 37 c_rfi(); 38 if( n = c_si(a) ) return (n); 39 if(pars_f()) err(errflag,F_ERFMT,"rsfio") 40 fmt_bg(); 41 return( OK ); 42 } 43 44 s_rdfi(a) icilist *a; 45 { 46 int n; 47 48 c_rfi(); 49 if( n = c_di(a) ) return (n); 50 if(pars_f()) err(errflag,F_ERFMT,"rdfio") 51 fmt_bg(); 52 return( OK ); 53 } 54 55 e_rsfi() 56 { int n; 57 n = en_fio(); 58 fmtbuf = NULL; 59 return(n); 60 } 61 62 e_rdfi() 63 { 64 return(e_rsfi()); 65 } 66