#define isblnk(x) (ltab[x+1]&B)
#define issep(x) (ltab[x+1]&SP)
#define isapos(x) (ltab[x+1]&AP)
#define isexp(x) (ltab[x+1]&EX)
#define isdigit(x) (ltab[x+1]&D)
#define endlinp(x) (ltab[x+1]&EIN)
#define GETC(x) (x=(*getn)())
int l_read(),t_getc(),ungetc();
{ EIN
, /* offset one for EOF */
/* 0- 15 */ 0,0,AP
,0,0,0,0,0,0,B
,SP
|B
|EIN
,0,0,0,0,0, /* ^B,TAB,NEWLINE */
/* 16- 31 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* 32- 47 */ SP
|B
,0,AP
,0,0,0,0,AP
,0,0,0,0,SP
,0,0,EIN
, /* space,",',comma,/ */
/* 48- 63 */ D
,D
,D
,D
,D
,D
,D
,D
,D
,D
,0,0,0,0,0,0, /* digits 0-9 */
/* 64- 79 */ 0,0,0,0,EX
,EX
,0,0,0,0,0,0,0,0,0,0, /* D,E */
/* 80- 95 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
/* 96-111 */ 0,0,0,0,EX
,EX
,0,0,0,0,0,0,0,0,0,0, /* d,e */
/* 112-127 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
s_rsle(a
) cilist
*a
; /* start read sequential list external */
if(n
=c_le(a
,READ
)) return(n
);
if(curunit
->uwrt
) nowreading(curunit
);
if(curunit
->uend
) return(EOF
);
if((ch
=getc(cf
))!=EOF
) return(ch
);
if(curunit
->uend
) return(OK
);
while(!endlinp(GETC(ch
)));
l_read(number
,ptr
,len
,type
) ftnint
*number
,type
; flex
*ptr
; ftnlen len
;
if(leof
) err(endflag
, EOF
, lrd
)
while(isblnk(GETC(ch
))); /* skip blanks */
else if(lcount
==0) /* repeat count == 0 ? */
{ ERR(t_sep()); /* look for non-blank, allow 1 comma */
if(lquit
) return(OK
); /* slash found */
if(leof
) err(endflag
,EOF
,lrd
)
else if(external
&& ferror(cf
)) err(errflag
,errno
,lrd
)
if(ltype
) switch((int)type
)
b_char(lchar
,(char *)ptr
,len
);
if(lcount
) return(lcount
);
if(flg
&& lr_comm()) return(OK
);
da
=rd_int(&a
); /* repeat count ? */
if (a
<= 0.) return(122);
db
=rd_int(&b
); /* whole part of number */
if(GETC(ch
)=='.' && isdigit(GETC(ch
)))
dc
=rd_int(&c
); /* fractional part of number */
dd
=rd_int(&d
); /* exponent */
else if (ch
== '+' || ch
== '-')
for(i
=0;i
<dc
;i
++) c
/=10.;
{ for(i
=0;i
<d
;i
++) b
*= 10.;
for(i
=0;i
< -d
;i
++) b
/= 10.;
if(GETC(ch
)=='-') sign
= -1;
return(y
==0.0?sign
:i
); /* 0:[+]&&y==0, -1:-&&y==0, >0:#digits&&y!=0 */
if(lr_comm()) return(OK
);
if(n
=get_repet()) return(n
); /* get repeat count */
if(GETC(ch
)!='(') err(errflag
,112,"no (")
l_R(0); /* get real part */
l_R(0); /* get imag part */
if(ch
!=')') err(errflag
,112,"no )")
if(lr_comm()) return(OK
);
if(n
=get_repet()) return(n
); /* get repeat count */
if(GETC(ch
)=='.') GETC(ch
);
if(isblnk(ch
) || issep(ch
))
else if(ch
==EOF
) return(EOF
);
else err(errflag
,112,"logical not T or F");
while(!issep(GETC(ch
)) && !isblnk(ch
) && ch
!='\n' && ch
!=EOF
);
if(lr_comm()) return(OK
);
if(n
=get_repet()) return(n
); /* get repeat count */
if(isapos(GETC(ch
))) quote
=ch
;
else if(isblnk(ch
) || issep(ch
) || ch
==EOF
|| ch
=='\n')
{ if(ch
==EOF
) return(EOF
);
{ quote
= '\0'; /* to allow single word non-quoted */
if(lchar
!=NULL
) free(lchar
);
p
=lchar
=(char *)malloc(BUFSIZE
);
if(lchar
==NULL
) err(errflag
,113,lrd
)
{ while( ( (quote
&& GETC(ch
)!=quote
) ||
(!quote
&& !issep(GETC(ch
)) && !isblnk(ch
) ) )
&& ch
!='\n' && ch
!=EOF
&& ++i
<size
)
lchar
=(char *)realloc(lchar
, size
+1);
if(lchar
==NULL
) err(errflag
,113,lrd
)
else if(ch
==EOF
) return(EOF
);
{ if(*(p
-1) == '\\') *(p
-1) = ch
;
else if(quote
&& GETC(ch
)==quote
)
{ if(++i
<size
) *p
++ = ch
;
if(issep(ch
)) while(isblnk(GETC(ch
)));