1: /*
   2: char	id_rdfe[] = "@(#)rdfe.c	1.1";
   3:  *
   4:  * read direct formatted external i/o
   5:  */
   6: 
   7: #include "fio.h"
   8: 
   9: int y_getc(), y_rnew();
  10: extern  int rd_ed(), rd_ned(), y_tab();
  11: 
  12: char rdfe[] = "read dfe";
  13: 
  14: s_rdfe(a) cilist *a;
  15: {
  16:     int n;
  17:     reading = YES;
  18:     if(n=c_dfe(a,READ)) return(n);
  19:     if(curunit->uwrt && ! nowreading(curunit)) err(errflag, errno, rdfe)
  20:     getn = y_getc;
  21:     doed = rd_ed;
  22:     doned = rd_ned;
  23:     dotab = y_tab;
  24:     dorevert = doend = donewrec = y_rnew;
  25:     if(pars_f(fmtbuf)) err(errflag,F_ERFMT,rdfe)
  26:     fmt_bg();
  27:     return(OK);
  28: }
  29: 
  30: y_getc()
  31: {
  32:     int ch;
  33:     if(curunit->uend) return(EOF);
  34:     if(curunit->url==1 || recpos++ < curunit->url)
  35:     {
  36:         if((ch=getc(cf))!=EOF)
  37:         {
  38:                 return(ch);
  39:         }
  40:         if(feof(cf))
  41:         {
  42:             curunit->uend = YES;
  43:             return(EOF);
  44:         }
  45:         err(errflag,errno,rdfe);
  46:     }
  47:     else return(' ');
  48: }
  49: 
  50: y_rnew()
  51: {   if(curunit->url != 1)
  52:     {   fseek(cf,(long)curunit->url*(++recnum),0);
  53:         recpos = reclen = cursor = 0;
  54:     }
  55:     return(OK);
  56: }
  57: 
  58: y_rend()
  59: {
  60:     return(OK);
  61: }

Defined functions

s_rdfe defined in line 14; never used
y_getc defined in line 30; used 2 times
  • in line 9, 20
y_rend defined in line 58; never used
y_rnew defined in line 50; used 2 times
  • in line 9, 24

Defined variables

rdfe defined in line 12; used 8 times
Last modified: 1983-06-19
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 737
Valid CSS Valid XHTML 1.0 Strict