7 rd_ed(p,ptr,len) char *ptr; struct syl *p; ftnlen len;
9 for(;cursor>0;cursor--) if((ch=(*getn)())<0) return(ch);
11 { if(recpos+cursor < 0) /*err(elist->cierr,110,"fmt")*/
12 cursor = -recpos; /* is this in the standard? */
17 else if(curunit && curunit->useek)
18 (void) fseek(cf,(long) cursor,SEEK_CUR);
20 err(elist->cierr,106,"fmt");
26 default: fprintf(stderr,"rd_ed, unexpected code: %d\n", p->op);
28 case I: ch = (rd_I((uint *)ptr,p->p1,len, 10));
30 case IM: ch = (rd_I((uint *)ptr,p->p1,len, 10));
32 case O: ch = (rd_I((uint *)ptr, p->p1, len, 8));
34 case L: ch = (rd_L((ftnint *)ptr,p->p1));
36 case A: ch = (rd_A(ptr,len));
39 ch = (rd_AW(ptr,p->p1,len));
45 case F: ch = (rd_F((ufloat *)ptr,p->p1,p->p2,len));
48 if(ch == 0) return(ch);
49 else if(ch == EOF) return(EOF);
53 rd_ned(p) struct syl *p;
57 default: fprintf(stderr,"rd_ned, unexpected code: %d\n", p->op);
60 return(rd_POS(*(char **)&p->p2));
61 case H: return(rd_H(p->p1,*(char **)&p->p2));
62 case SLASH: return((*donewrec)());
64 case X: cursor += p->p1;
66 case T: cursor=p->p1-recpos - 1;
68 case TL: cursor -= p->p1;
69 if(cursor < -recpos) /* TL1000, 1X */
74 rd_I(n,w,len, base) ftnlen len; uint *n; register int base;
82 if (ch==',' || ch=='\n') break;
87 while (*ps==' ') ps++;
88 if (*ps=='-') { sign=1; ps++; }
89 else { sign=0; if (*ps=='+') ps++; }
90 loop: while (*ps>='0' && *ps<='9') { x=x*base+(*ps-'0'); ps++; }
91 if (*ps==' ') {if (cblank) x *= base; ps++; goto loop;}
93 if(len==sizeof(integer)) n->il=x;
94 else if(len == sizeof(char)) n->ic = x;
96 if (*ps) return(errno=115); else return(0);
104 if (ch==','||ch=='\n') break;
109 ps=s; while (*ps==' ') ps++;
111 if (*ps=='t' || *ps == 'T') { *n=1; return(0); }
112 else if (*ps == 'f' || *ps == 'F') { *n=0; return(0); }
113 else return(errno=116);
122 char s[FMAX+EXPMAXDIGS+4];
124 register char *sp, *spe, *sp1;
137 } while (ch == ' ' && w);
139 case '-': *sp++ = ch; sp1++; spe++;
147 if (!w--) goto zero; GET(ch); }
149 { if (!w--) goto zero; GET(ch); }
150 if (ch == ' ' && cblank)
155 if (sp < spe) *sp++ = ch;
163 { ch = '0'; goto digloop1; }
170 if (sp == sp1) { /* no digits yet */
179 if (cblank) goto skip01;
186 { *sp++ = ch; --exp; }
193 { ch = '0'; goto digloop2; }
200 case '-': se = 1; goto signonly;
201 case '+': se = 0; goto signonly;
234 { ch = '\n'; break; }
246 if (e > EXPMAX && sp > sp1)
261 return (errno = 115);
268 sprintf(sp+1, "e%ld", exp);
274 if (len == sizeof(real))
282 rd_A(p,len) char *p; ftnlen len;
290 rd_AW(p,w,len) char *p; ftnlen len;
293 { for(i=0;i<w-len;i++)
305 for(i=0;i<len-w;i++) *p++=' ';
311 if((ch=(*getn)())<0) return(ch);
312 else *s++ = ch=='\n'?' ':ch;
320 if(*s==quote && *(s+1)!=quote) break;
321 else if((ch=(*getn)())<0) return(ch);
322 else *s = ch=='\n'?' ':ch;