1 /* 2 * Copyright (c) 1980 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 * @(#)wfi.c 5.1 06/07/85 7 */ 8 9 /* 10 * internal (character array) i/o: write formatted, sequential and direct 11 */ 12 13 #include "fio.h" 14 15 extern int w_ed(),w_ned(); 16 extern int z_wnew(), z_putc(), z_tab(); 17 18 LOCAL 19 c_wfi() 20 { 21 reading = NO; 22 doed=w_ed; 23 doned=w_ned; 24 putn=z_putc; 25 doend = donewrec = z_wnew; 26 dorevert = z_wnew; 27 dotab = z_tab; 28 } 29 30 s_wsfi(a) icilist *a; 31 { 32 int n; 33 34 c_wfi(); 35 if( n = c_si(a) ) return (n); 36 if(pars_f()) err(errflag,F_ERFMT,"wsfio") 37 fmt_bg(); 38 return( OK ); 39 } 40 41 s_wdfi(a) icilist *a; 42 { 43 int n; 44 45 c_wfi(); 46 if( n = c_di(a) ) return (n) ; 47 if(pars_f()) err(errflag,F_ERFMT,"wdfio") 48 fmt_bg(); 49 return( OK ); 50 } 51 52 e_wsfi() 53 { 54 int n; 55 n = en_fio(); 56 fmtbuf = NULL; 57 return(n); 58 } 59 60 61 e_wdfi() 62 { 63 return(e_wsfi()); 64 } 65