1: /*
   2: char id_wsfe[] = "@(#)wsfe.c	1.1";
   3:  *
   4:  * write sequential formatted external routines
   5:  */
   6: 
   7: #include "fio.h"
   8: 
   9: int pr_put(), x_putc(), x_wend(), x_wnew();
  10: extern  int w_ed(), w_ned(), x_tab();
  11: 
  12: char wsfe[] = "write sfe";
  13: ioflag new;
  14: 
  15: s_wsfe(a) cilist *a;    /*start*/
  16: {   int n;
  17:     reading = NO;
  18:     if(n=c_sfe(a,WRITE)) return(n);
  19:     if(!curunit->uwrt && ! nowwriting(curunit)) err(errflag, errno, wsfe)
  20:     curunit->uend = NO;
  21:     if (curunit->uprnt) putn = pr_put;
  22:     else putn = x_putc;
  23:     new = YES;
  24:     doed= w_ed;
  25:     doned= w_ned;
  26:     doend = x_wend;
  27:     dorevert = donewrec = x_wnew;
  28:     dotab = x_tab;
  29:     if(pars_f(fmtbuf)) err(errflag,F_ERFMT,wsfe)
  30:     fmt_bg();
  31:     return(OK);
  32: }
  33: 
  34: x_putc(c)
  35: {
  36:     if(c=='\n') recpos = reclen = cursor = 0;
  37:     else recpos++;
  38:     if (c) putc(c,cf);
  39:     return(OK);
  40: }
  41: 
  42: pr_put(c)
  43: {
  44:     if(c=='\n')
  45:     {   new = YES;
  46:         recpos = reclen = cursor = 0;
  47:     }
  48:     else if(new)
  49:     {   new = NO;
  50:         if(c=='0') c = '\n';
  51:         else if(c=='1') c = '\f';
  52:         else return(OK);
  53:     }
  54:     else recpos++;
  55:     if (c) putc(c,cf);
  56:     return(OK);
  57: }
  58: 
  59: x_wnew()
  60: {
  61:     if(reclen>recpos) fseek(cf,(long)(reclen-recpos),1);
  62:     return((*putn)('\n'));
  63: }
  64: 
  65: x_wend(last) char last;
  66: {
  67:     if(reclen>recpos) fseek(cf,(long)(reclen-recpos),1);
  68:     return((*putn)(last));
  69: }

Defined functions

pr_put defined in line 42; used 2 times
  • in line 9, 21
s_wsfe defined in line 15; never used
x_putc defined in line 34; used 2 times
  • in line 9, 22
x_wend defined in line 65; used 2 times
  • in line 9, 26
x_wnew defined in line 59; used 2 times
  • in line 9, 27

Defined variables

new defined in line 13; used 4 times
wsfe defined in line 12; used 2 times
Last modified: 1983-06-19
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 794
Valid CSS Valid XHTML 1.0 Strict