rsfe.c File Reference

#include "f2c.h"
#include "fio.h"
#include "fmt.h"

Include dependency graph for rsfe.c:

Go to the source code of this file.

Functions

int xrd_SL (Void)
int x_getc (Void)
int x_endp (Void)
int x_rev (Void)
integer s_rsfe (cilist *a)


Function Documentation

integer s_rsfe ( cilist a  ) 

Definition at line 59 of file rsfe.c.

References a, c_sfe(), cilist::ciend, err, errno, f__cblank, f__cf, f__cplus, f__cursor, f__curunit, f__doed, f__doend, f__doned, f__donewrec, f__dorevert, f__elist, f__external, f__fmtbuf, f__formatted, f__getn, f__init, f__nowreading(), f__reading, f__recpos, f__scale, f__sequential, f_init(), fmt_bg(), n, pars_f(), rd_ed(), rd_ned(), unit::ublnk, unit::uend, unit::ufd, unit::uwrt, x_endp(), x_getc(), x_rev(), and xrd_SL().

Referenced by bfrdr().

00061 {       int n;
00062         if(!f__init) f_init();
00063         f__reading=1;
00064         f__sequential=1;
00065         f__formatted=1;
00066         f__external=1;
00067         if(n=c_sfe(a)) return(n);
00068         f__elist=a;
00069         f__cursor=f__recpos=0;
00070         f__scale=0;
00071         f__fmtbuf=a->cifmt;
00072         f__cf=f__curunit->ufd;
00073         if(pars_f(f__fmtbuf)<0) err(a->cierr,100,"startio");
00074         f__getn= x_getc;
00075         f__doed= rd_ed;
00076         f__doned= rd_ned;
00077         fmt_bg();
00078         f__doend=x_endp;
00079         f__donewrec=xrd_SL;
00080         f__dorevert=x_rev;
00081         f__cblank=f__curunit->ublnk;
00082         f__cplus=0;
00083         if(f__curunit->uwrt && f__nowreading(f__curunit))
00084                 err(a->cierr,errno,"read start");
00085         if(f__curunit->uend)
00086                 err(f__elist->ciend,(EOF),"read start");
00087         return(0);
00088 }

Here is the call graph for this function:

Here is the caller graph for this function:

int x_endp ( Void   ) 

Definition at line 44 of file rsfe.c.

References f__curunit, unit::uend, and xrd_SL().

Referenced by s_rsfe().

00045 {
00046         xrd_SL();
00047         return f__curunit->uend == 1 ? EOF : 0;
00048 }

Here is the call graph for this function:

Here is the caller graph for this function:

int x_getc ( Void   ) 

Definition at line 23 of file rsfe.c.

References errno, f__cf, f__curunit, f__recpos, unit::uend, ungetc(), and void().

Referenced by s_rsfe().

00024 {       int ch;
00025         if(f__curunit->uend) return(EOF);
00026         ch = getc(f__cf);
00027         if(ch!=EOF && ch!='\n')
00028         {       f__recpos++;
00029                 return(ch);
00030         }
00031         if(ch=='\n')
00032         {       (void) ungetc(ch,f__cf);
00033                 return(ch);
00034         }
00035         if(f__curunit->uend || feof(f__cf))
00036         {       errno=0;
00037                 f__curunit->uend=1;
00038                 return(-1);
00039         }
00040         return(-1);
00041 }

Here is the call graph for this function:

Here is the caller graph for this function:

int x_rev ( Void   ) 

Definition at line 51 of file rsfe.c.

References void(), and xrd_SL().

Referenced by s_rsfe().

00052 {
00053         (void) xrd_SL();
00054         return(0);
00055 }

Here is the call graph for this function:

Here is the caller graph for this function:

int xrd_SL ( Void   ) 

Definition at line 10 of file rsfe.c.

References f__cf, f__cursor, f__curunit, f__recpos, and unit::uend.

00011 {       int ch;
00012         if(!f__curunit->uend)
00013                 while((ch=getc(f__cf))!='\n')
00014                         if (ch == EOF) {
00015                                 f__curunit->uend = 1;
00016                                 break;
00017                                 }
00018         f__cursor=f__recpos=0;
00019         return(1);
00020 }


Generated on Sun Mar 4 15:05:24 2007 for Scilab [trunk] by  doxygen 1.5.1