Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

rsfe.c File Reference

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

Go to the source code of this file.


Functions

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

Function Documentation

integer s_rsfe cilist   a
 

Definition at line 49 of file rsfe.c.

References a, c_sfe(), err, f__nowreading(), f_init(), fmt_bg(), pars_f(), x_endp(), x_getc(), x_rev(), and xrd_SL().

Referenced by MAIN__().

00051 {       int n;
00052         if(!f__init) f_init();
00053         if(n=c_sfe(a)) return(n);
00054         f__reading=1;
00055         f__sequential=1;
00056         f__formatted=1;
00057         f__external=1;
00058         f__elist=a;
00059         f__cursor=f__recpos=0;
00060         f__scale=0;
00061         f__fmtbuf=a->cifmt;
00062         f__curunit= &f__units[a->ciunit];
00063         f__cf=f__curunit->ufd;
00064         if(pars_f(f__fmtbuf)<0) err(a->cierr,100,"startio");
00065         f__getn= x_getc;
00066         f__doed= rd_ed;
00067         f__doned= rd_ned;
00068         fmt_bg();
00069         f__doend=x_endp;
00070         f__donewrec=xrd_SL;
00071         f__dorevert=x_rev;
00072         f__cblank=f__curunit->ublnk;
00073         f__cplus=0;
00074         if(f__curunit->uwrt && f__nowreading(f__curunit))
00075                 err(a->cierr,errno,"read start");
00076         if(f__curunit->uend)
00077                 err(f__elist->ciend,(EOF),"read start");
00078         return(0);
00079 }

x_endp Void   
 

Definition at line 36 of file rsfe.c.

References xrd_SL().

Referenced by s_rsfe().

00037 {
00038         xrd_SL();
00039         return f__curunit->uend == 1 ? EOF : 0;
00040 }

x_getc Void   
 

Definition at line 17 of file rsfe.c.

References ungetc().

Referenced by s_rsfe().

00018 {       int ch;
00019         if(f__curunit->uend) return(EOF);
00020         ch = getc(f__cf);
00021         if(ch!=EOF && ch!='\n')
00022         {       f__recpos++;
00023                 return(ch);
00024         }
00025         if(ch=='\n')
00026         {       (void) ungetc(ch,f__cf);
00027                 return(ch);
00028         }
00029         if(f__curunit->uend || feof(f__cf))
00030         {       errno=0;
00031                 f__curunit->uend=1;
00032                 return(-1);
00033         }
00034         return(-1);
00035 }

x_rev Void   
 

Definition at line 41 of file rsfe.c.

References xrd_SL().

Referenced by s_rsfe().

00042 {
00043         (void) xrd_SL();
00044         return(0);
00045 }

xrd_SL Void   
 

Definition at line 6 of file rsfe.c.

Referenced by s_rsfe().

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

Powered by Plone

This site conforms to the following standards: