00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <cmplrs/fio.h>
00042 #include <mutex.h>
00043 #include "fmt.h"
00044 #include "vmsflags.h"
00045 #include "rdfmt.h"
00046 #include "iio.h"
00047 #include "iomode.h"
00048 #include "err.h"
00049 #include "bcompat.h"
00050 #include "../include/cmplrs/f_errno.h"
00051 #include "typecheck.h"
00052
00053 extern double atof(const char *str);
00054 extern int fmt_check;
00055
00056 #define MAX_INPUT_SIZE 84
00057
00058 int __s_rsfi_com (icilist64 *a, unit **fu, int f90sw)
00059 {
00060 int n;
00061 unit *ftnunit;
00062
00063 if (!f77init)
00064 f_init ();
00065 ftnunit = *fu = Internal_File;
00066 while (fu != &f77curunit && test_and_set( &ftnunit->lock_unit, 1L ))
00067 ;
00068
00069 #ifdef I90
00070 ftnunit->f90sw = f90sw;
00071 #endif
00072 if (n = c_si (a, ftnunit))
00073 return (n);
00074 ftnunit->uwrt &= ~WR_OP;
00075 ftnunit->f77doed = rd_ed;
00076 ftnunit->f77doned = rd_ned;
00077 ftnunit->f77getn = z_getc;
00078 ftnunit->f77gets = z_gets;
00079 ftnunit->f77ungetn = z_ungetc;
00080 ftnunit->f77donewrec = z_rSL;
00081 ftnunit->f77dorevert = ftnunit->f77doend = z_rnew;
00082 ftnunit->f77recend = ftnunit->f77errlist.icirlen;
00083 return (0);
00084 }
00085
00086 int s_rsfi (icilist *a)
00087 {
00088 #if 11
00089 icilist64 dst;
00090 get_icilist64(&dst, a);
00091 return __s_rsfi_com(&dst, &f77curunit, 0);
00092 #else
00093 return( __s_rsfi_com( a, &f77curunit, 0 ) );
00094 #endif
00095 }
00096
00097 int s_rsfi_mp (icilist *a, unit **fu)
00098 {
00099 #if 11
00100 icilist64 dst;
00101 get_icilist64(&dst, a);
00102 return __s_rsfi_com(&dst, fu, 0);
00103 #else
00104 return( __s_rsfi_com( a, fu, 0 ) );
00105 #endif
00106 }
00107
00108
00109 #if 11
00110
00111 int s_rsfi64 (icilist64 *a)
00112 {
00113 return( __s_rsfi_com( a, &f77curunit, 0 ) );
00114 }
00115
00116 int s_rsfi64_mp (icilist64 *a, unit **fu)
00117 {
00118 return( __s_rsfi_com( a, fu, 0 ) );
00119 }
00120
00121 #endif
00122
00123 int
00124 rd_ed (unit * ftnunit, struct f77syl *p, char *ptr, ftnlen len, ftnint type)
00125 {
00126 int ch=0;
00127 XINT needed_size=0;
00128
00129 for (; ftnunit->f77cursor > 0; ftnunit->f77cursor--)
00130 if ((ch = (*ftnunit->f77getn) (ftnunit)) < 0)
00131 return (ch);
00132 if (ftnunit->f77cursor < 0) {
00133 if (ftnunit->f77cursor < -ftnunit->f77recpos)
00134 ftnunit->f77cursor = -ftnunit->f77recpos;
00135 for (; ftnunit->f77cursor < 0; ftnunit->f77cursor++)
00136 if ((*ftnunit->f77ungetn) (ftnunit, ch) < 0) {
00137 err(ftnunit->f77errlist.cierr, 106, "fmt");
00138 }
00139 }
00140 #ifdef I90
00141 if (ftnunit->f90sw == 1 ) {
00142 if ( p->op == A ) {
00143 needed_size = len;
00144 } else if ( p->op == AW ) {
00145 needed_size = ( p->p1 < len ? p->p1 : len );
00146 } else {
00147 needed_size = p->p1;
00148 }
00149 if ( ftnunit->f77recpos + needed_size > ftnunit->f77recend ) {
00150 if ( ftnunit->unpad != 0) {
00151 if (ftnunit->f90nadv == 1) {
00152 ftnunit->f90eor = 1;
00153 if (ftnunit->f77errlist.cisize) {
00154 *ftnunit->f77errlist.cisize += ftnunit->f77recend - ftnunit->f77recpos;
00155 }
00156 return(0);
00157 } else {
00158 err(ftnunit->f77errlist.cierr,177,"fmt");
00159 }
00160 } else {
00161 if (ftnunit->f90nadv == 1) {
00162 ftnunit->f90eor = 1;
00163 if (ftnunit->f77errlist.cisize) {
00164 *ftnunit->f77errlist.cisize += ftnunit->f77recend - ftnunit->f77recpos;
00165 }
00166 }
00167 }
00168 } else {
00169 if (ftnunit->f77errlist.cisize) {
00170 *ftnunit->f77errlist.cisize += needed_size;
00171 }
00172 }
00173 if ( test_type(p->op,type) != 0 )
00174 err(ftnunit->f77errlist.cierr,117,"rdfmt");
00175 }
00176 #endif
00177 if (fmt_check && _RCHK[p->op][type]) {
00178 err(CILISTERR, F_TYPECONFLICT, "formatted read");
00179 }
00180 switch (p->op) {
00181 default:
00182
00183
00184
00185
00186 return (100);
00187 case I:
00188 case IM:
00189 ch = (rd_I (ftnunit, (uinteger *) ptr, p->p1, len));
00190 break;
00191 #ifdef I90
00192 case B:
00193 case BM:
00194 ch = (rd_B (ftnunit, (unsigned char *) ptr, p->p1, len));
00195 break;
00196 #endif
00197 case O:
00198 case OM:
00199 ch = (rd_OZ (ftnunit, (unsigned char *) ptr, p->p1, len, 8));
00200 break;
00201 case Z:
00202 case ZM:
00203 ch = (rd_OZ (ftnunit, (unsigned char *) ptr, p->p1, len, 16));
00204 break;
00205 case L:
00206 ch = (rd_L (ftnunit, (uinteger *) ptr, p->p1, len));
00207 break;
00208 case A:
00209 ch = (rd_A (ftnunit, ptr, len));
00210 break;
00211 case AW:
00212 ch = (rd_AW (ftnunit, ptr, p->p1, len));
00213 break;
00214 case E:
00215 case EE:
00216 case D:
00217 case F:
00218 #ifdef I90
00219 case ES:
00220 case EN:
00221 case ESE:
00222 case ENE:
00223 #endif
00224 ch = (rd_F (ftnunit, (ufloat *) ptr, p->p1, p->p2, len));
00225 break;
00226 case G:
00227 case GE:
00228 switch(type) {
00229 default:
00230 case TYCHAR:
00231 if (p->p1 != 0 ) {
00232 ch = (rd_AW (ftnunit, ptr, p->p1, len));
00233 } else {
00234 ch = (rd_A (ftnunit, ptr, len));
00235 }
00236 break;
00237 case TYLOGICAL1:
00238 case TYLOGICAL2:
00239 case TYLOGICAL4:
00240 case TYLOGICAL8:
00241 ch = (rd_L (ftnunit, (uinteger *) ptr, p->p1, len));
00242 break;
00243 case TYBYTE:
00244 case TYSHORT:
00245 case TYINT:
00246 case TYLONGLONG:
00247 ch = (rd_I (ftnunit, (uinteger *) ptr, p->p1, len));
00248 break;
00249 case TYREAL:
00250 case TYDREAL:
00251 case TYQUAD:
00252 case TYCOMPLEX:
00253 case TYDCOMPLEX:
00254 case TYQUADCOMPLEX:
00255 ch = (rd_F (ftnunit, (ufloat *) ptr, p->p1, p->p2, len));
00256 break;
00257 }
00258 break;
00259 case Q:
00260 ch = (rd_Q (ftnunit, (uinteger *) ptr, len));
00261 break;
00262 }
00263 if (ch == 0 || ftnunit->f77errlist.iciunit || (f77vms_flag_[VMS_EF] && ch < 0))
00264 return (errno = ch);
00265 else if (feof (ftnunit->ufd))
00266 return (EOF);
00267 clearerr(ftnunit->ufd);
00268 return (errno);
00269 }
00270
00271 #ifdef I90
00272 static int
00273 rd_slash( unit *ftnunit, long repeat_count )
00274 {
00275 int rslt;
00276 while ( repeat_count-- ) {
00277 rslt = (*ftnunit->f77donewrec)(ftnunit);
00278 if (rslt) return (rslt);
00279 }
00280 return (0);
00281 }
00282 #endif
00283
00284 int
00285 rd_ned (unit *ftnunit, struct f77syl *p)
00286 {
00287 switch (p->op) {
00288 default:
00289
00290
00291
00292
00293 return (100);
00294 case APOS:
00295 return (rd_POS (ftnunit, (char *) p->p1));
00296
00297 case H:
00298 return (rd_H (ftnunit, p->p1));
00299
00300 case SLASH:
00301 #ifdef I90
00302 return (rd_slash (ftnunit, p->p1));
00303 #else
00304 return ((*ftnunit->f77donewrec) (ftnunit));
00305 #endif
00306 case TR:
00307 case X:
00308 ftnunit->f77cursor += p->p1;
00309 return (0);
00310 case T:
00311 ftnunit->f77cursor = p->p1 - ftnunit->f77recpos - 1;
00312 return (0);
00313 case TL:
00314 ftnunit->f77cursor -= p->p1;
00315 if (ftnunit->f77cursor < (-ftnunit->f77recpos))
00316 ftnunit->f77cursor = -ftnunit->f77recpos;
00317 return (0);
00318 }
00319 }
00320
00321 int
00322 rd_I (unit *ftnunit, uinteger *n, long w, ftnlen len)
00323 {
00324 register ftnll x = 0;
00325 int sign, ch;
00326 char s[MAX_INPUT_SIZE];
00327 register char *ps, c;
00328 int i, ich;
00329 char cc;
00330
00331 if (w == 0)
00332 w = len < 4 ? 7 : len < 8 ? 12 : 21;
00333 if ((int) w >= MAX_INPUT_SIZE) {
00334 ch = GETS (s, MAX_INPUT_SIZE-1, ',');
00335 for (i = MAX_INPUT_SIZE-1; i < w; i++) {
00336 ich = GETS (&cc, 1, ',');
00337 if (!ch) break;
00338 if (!isspace(cc))
00339 return (errno = 186);
00340 }
00341 } else
00342 ch = GETS (s, (int) w, ',');
00343 if (ch < 0)
00344 return (ch);
00345 ps = s;
00346 ps[ch] = '\0';
00347 while (*ps == ' ')
00348 ps++;
00349 if (*ps == '-') {
00350 sign = 1;
00351 ps++;
00352 } else {
00353 sign = 0;
00354 if (*ps == '+')
00355 ps++;
00356 }
00357 for (c = (*ps);; c = (*++ps)) {
00358 if (c >= '0' && c <= '9')
00359 x = x * 10 + c - '0';
00360 else if (c == ' ') {
00361
00362
00363
00364 if (ftnunit->f77cblank)
00365 x = x * 10;
00366 } else {
00367 if (ftnunit->f77cblank && c == '\0' && ch < w)
00368 while (ch++ < w) x = x *10;
00369 break;
00370 }
00371 }
00372
00373 if (sign)
00374 x = -x;
00375 if (len == sizeof (short))
00376 n->is = (short) x;
00377 else if (len == sizeof (char))
00378 n->ic = (signed char) x;
00379 else if (len == sizeof (ftnll))
00380 n->ill = x;
00381 else
00382 n->ii = (int) x;
00383 if (*ps)
00384 return (errno = 115);
00385 return (0);
00386 }
00387
00388 int
00389 rd_OZ (unit *ftnunit, unsigned char *n, long w, ftnlen len, int base)
00390 {
00391 unsigned char s[84];
00392 register unsigned char *ps, *vbuf;
00393 register int c=0;
00394 register unsigned int d, bits, shift;
00395
00396 ps = s;
00397 shift = base == 8 ? 3 : 4;
00398 if (w == 0)
00399 w = (int) (len < 4 ? 7 : (len < 8 ? 12 :
00400 (len > 8 ? (len * 8 + shift - 1) / shift : 23)));
00401 while (w--) {
00402 GET (c);
00403 if (c == ',' || c == '\n')
00404 break;
00405 if (c == ' ' && ps == s)
00406 continue;
00407 *ps = (char) c;
00408 ps++;
00409 }
00410
00411 d = bits = 0;
00412
00413 #ifdef _MIPSEB
00414 vbuf = n + len - 1;
00415 #else
00416 vbuf = n;
00417 #endif
00418
00419
00420 while (--ps >= s) {
00421
00422 c = *ps;
00423 if (c >= '0' && c <= '9')
00424 c -= '0';
00425 else if (c >= 'a' && c <= 'f')
00426 c -= 'a' - 10;
00427 else if (c >= 'A' && c <= 'F')
00428 c -= 'A' - 10;
00429 else if (c == ' ') {
00430 if (ftnunit->f77cblank)
00431 c = 0;
00432 else
00433 continue;
00434 }
00435
00436 else if ((ps == s) && (c == '+' || c == '-'))
00437 continue;
00438 else
00439 return (errno = 115);
00440 if (c >= base)
00441 return (errno = 115);
00442
00443 d |= (c << bits);
00444 bits += shift;
00445
00446 if (bits >= 8) {
00447 #ifdef _MIPSEB
00448 if (vbuf < n && d != 0)
00449 return (errno = 115);
00450 if (vbuf >= n)
00451 (*vbuf--) = (char) (d & 0xff);
00452 #else
00453 if (vbuf >= (n + len) && d != 0)
00454 return (errno = 115);
00455 if (vbuf < (n + len))
00456 (*vbuf++) = (char) (d & 0xff);
00457 #endif
00458 d = d >> 8;
00459 bits -= 8;
00460 }
00461 }
00462
00463 #ifdef _MIPSEB
00464 if (d) {
00465 if (vbuf < n)
00466 return (errno = 115);
00467 (*vbuf--) = (char) (d & 0xff);
00468 }
00469 while (vbuf >= n)
00470 (*vbuf--) = '\0';
00471
00472 if (c == '-') {
00473 for (vbuf = n; vbuf < (n + len); vbuf++)
00474 *vbuf = (unsigned char) (~(*vbuf));
00475 (*(vbuf - 1))++;
00476 }
00477 #else
00478 if (d) {
00479 if (vbuf >= (n + len))
00480 return (errno = 115);
00481 (*vbuf++) = d & 0xff;
00482 }
00483 while (vbuf < (n + len))
00484 (*vbuf++) = '\0';
00485
00486 if (c == '-') {
00487 for (vbuf = (n + len - 1); vbuf >= (n); vbuf--)
00488 *vbuf = ~(*vbuf);
00489 *(vbuf + 1) = *(vbuf + 1) + 0x80;
00490 }
00491 #endif
00492
00493 return (0);
00494
00495 }
00496
00497 #ifdef I90
00498 int rd_B (unit *ftnunit, unsigned char *n, long w, ftnlen len)
00499 {
00500 unsigned char s[84];
00501 register unsigned char *ps, *vbuf;
00502 register int c=0;
00503 register unsigned int d, bits, shift = 1;
00504
00505 ps = s;
00506
00507
00508
00509 while (w--) {
00510 GET (c);
00511 if (c == ',' || c == '\n')
00512 break;
00513 if (c == ' ' && ps == s)
00514 continue;
00515 *ps = (char) c;
00516 ps++;
00517 }
00518
00519 d = bits = 0;
00520
00521 #ifdef _MIPSEB
00522 vbuf = n + len - 1;
00523 #else
00524 vbuf = n;
00525 #endif
00526
00527 while (--ps >= s) {
00528
00529 c = *ps;
00530 switch(c) {
00531 case ' ':
00532 if ( !ftnunit->f77cblank ) continue;
00533 case '0':
00534 break;
00535 case '1':
00536 d |= 1 << bits;
00537 break;
00538 case '+':
00539 case '-':
00540 if ( ps == s ) continue;
00541 default:
00542 return (errno = 115);
00543 }
00544 bits += shift;
00545
00546 if (bits >= 8) {
00547 #ifdef _MIPSEB
00548 if (vbuf < n && d != 0)
00549 return (errno = 115);
00550 if (vbuf >= n)
00551 (*vbuf--) = (char) (d & 0xff);
00552 #else
00553 if (vbuf >= (n + len) && d != 0)
00554 return (errno = 115);
00555 if (vbuf < (n + len))
00556 (*vbuf++) = (char) (d & 0xff);
00557 #endif
00558 d = d >> 8;
00559 bits -= 8;
00560 }
00561 }
00562
00563 #ifdef _MIPSEB
00564 if (d) {
00565 if (vbuf < n)
00566 return (errno = 115);
00567 (*vbuf--) = (char) (d & 0xff);
00568 }
00569 while (vbuf >= n)
00570 (*vbuf--) = '\0';
00571
00572 if (c == '-') {
00573 for (vbuf = n; vbuf < (n + len); vbuf++)
00574 *vbuf = (unsigned char) (~(*vbuf));
00575 (*(vbuf - 1))++;
00576 }
00577 #else
00578 if (d) {
00579 if (vbuf >= (n + len))
00580 return (errno = 115);
00581 (*vbuf++) = d & 0xff;
00582 }
00583 while (vbuf < (n + len))
00584 (*vbuf++) = '\0';
00585
00586 if (c == '-') {
00587 for (vbuf = (n + len - 1); vbuf >= (n); vbuf--)
00588 *vbuf = ~(*vbuf);
00589 *(vbuf + 1) = *(vbuf + 1) + 0x80;
00590 }
00591 #endif
00592
00593 return (0);
00594
00595 }
00596 #endif
00597
00598 int
00599 rd_Q (unit *ftnunit, uinteger *n, ftnlen len)
00600 {
00601 int x;
00602
00603 x = ftnunit->f77recpos < ftnunit->f77recend ? ftnunit->f77recend - ftnunit->f77recpos : 0;
00604 if (len == sizeof (short))
00605 n->is = (short) x;
00606 else if (len == sizeof (char))
00607 n->ic = (signed char) x;
00608 else if (len == sizeof (ftnll))
00609 n->ill = x;
00610 else
00611 n->ii = x;
00612 return (0);
00613 }
00614
00615 int
00616 rd_L (unit *ftnunit, uinteger *n, long w, ftnlen len)
00617 {
00618 int ch;
00619 char s[84], *ps;
00620
00621 ps = s;
00622 w = w ? w : 2;
00623 while (w) {
00624 GET (ch);
00625 if (ch == ',' || ch == '\n')
00626 break;
00627 *ps = (char) ch;
00628 ps++;
00629 w--;
00630 }
00631 *ps = '\0';
00632 ps = s;
00633 while (*ps == ' ')
00634 ps++;
00635 if (*ps == '.')
00636 ps++;
00637 if (*ps == 't' || *ps == 'T')
00638 ch = 1;
00639 else if (*ps == 'f' || *ps == 'F')
00640 ch = 0;
00641 else
00642 return (errno = 116);
00643 if (len == sizeof (short))
00644 n->is = (short) ch;
00645 else if (len == sizeof (char))
00646 n->ic = (signed char) ch;
00647 else if (len == sizeof (ftnll))
00648 n->ill = ch;
00649 else
00650 n->ii = ch;
00651 return (0);
00652 }
00653
00654
00655 int
00656 rd_F (unit *ftnunit, ufloat *p, long w, long d, ftnlen len)
00657 {
00658 char s[MAX_INPUT_SIZE], *sp, *c, *exppos=NULL;
00659 int ch, nfrac, exp, dot, se;
00660 int extrachars=0;
00661 int i, ich;
00662 char cc;
00663
00664 dot = 1;
00665 if (w == 0) {
00666 if (len < 8) {
00667 w = 15;
00668 d = 7;
00669 } else if (len == 8) {
00670 w = 25;
00671 d = 16;
00672 }
00673 else {
00674 w = 40;
00675 d = 32;
00676 }
00677 }
00678 if ((int) w >= MAX_INPUT_SIZE) {
00679 ch = GETS (sp = s, MAX_INPUT_SIZE-1, ',');
00680 for (i = MAX_INPUT_SIZE-1; i < w; i++) {
00681 ich = GETS (&cc, 1, ',');
00682 if (!ch) break;
00683 if (!isspace(cc))
00684 return (errno = 186);
00685 }
00686 } else
00687 ch = GETS (sp = s, (int) w, ',');
00688 if (ch < 0)
00689 return (ch);
00690 sp[ch] = '\0';
00691 while (*sp == ' ')
00692 sp++;
00693 if (*sp == '-') {
00694 sp++;
00695 } else {
00696 if (*sp == '+')
00697 sp++;
00698 }
00699 loop1:
00700 while (*sp >= '0' && *sp <= '9') {
00701 sp++;
00702 }
00703 if (*sp == ' ') {
00704 if (ftnunit->f77cblank) { *sp++='0'; }
00705 else {c=sp; while (*c) { *c=*(c+1); c++; } }
00706 goto loop1;
00707 }
00708 nfrac = 0;
00709 if (*sp == '.') {
00710 {c=sp; while (*c) { *c=*(c+1); c++; } }
00711 dot = 0;
00712 loop2:
00713 while (*sp >= '0' && *sp <= '9') {
00714 nfrac--;
00715 sp++;
00716 }
00717 if (*sp == ' ') {
00718 if (ftnunit->f77cblank) { *sp++='0'; nfrac--; }
00719 else {c=sp; while (*c) { *c=*(c+1); c++; } }
00720 goto loop2;
00721 }
00722 }
00723 if (*sp == 'd' || *sp == 'e' || *sp == 'D' || *sp == 'E'
00724 || *sp == 'q' || *sp == 'Q') {
00725 {
00726 exppos=sp;
00727 *sp++='e';
00728 }
00729 } else if (*sp != '+' && *sp != '-')
00730 {
00731 nfrac -= ftnunit->f77scale;
00732 exppos=sp;
00733 }
00734 while (*sp == ' ') {c=sp; while (*c) { *c=*(c+1); c++; } }
00735 if (*sp == '-') {
00736 if (exppos==NULL) exppos=sp;
00737 sp++;
00738 se = 1;
00739 } else {
00740 if (exppos==NULL) exppos=sp;
00741 se = 0;
00742 if (*sp == '+')
00743 sp++;
00744 }
00745 exp = 0;
00746 loop3:
00747 while (*sp >= '0' && *sp <= '9') {
00748 exp = exp * 10 + (*sp - '0');
00749 sp++;
00750 }
00751 if (*sp == ' ') {
00752 if (ftnunit->f77cblank)
00753 exp *= 10;
00754 sp++;
00755 goto loop3;
00756 }
00757
00758 if (*sp) extrachars=1;
00759 if (se)
00760 exp = nfrac - exp;
00761 else
00762 exp += nfrac;
00763 if (dot)
00764 exp -= d;
00765 *exppos++='e';
00766
00767 if (exp < 0)
00768 {
00769 *exppos++='-';
00770 exp = - exp;
00771 }
00772 if (exp > 999) exp=999;
00773 if (exp > 99)
00774 {
00775 *exppos++ = (char) ((exp/100) + '0');
00776 exp = exp % 100;
00777 if (exp < 10)
00778 *exppos++ = '0';
00779 }
00780 if (exp > 9)
00781 {
00782 *exppos++ = (char) ((exp/10) + '0');
00783 exp = exp % 10;
00784 }
00785 *exppos++ = (char) (exp + '0');
00786 *exppos = '\0';
00787
00788 if (len < sizeof (double))
00789 p->pf = atof(s);
00790 else if (len == sizeof (double))
00791 p->pd = atof(s);
00792 else
00793 p->pld = atold(s);
00794 if (extrachars)
00795 return (errno = 115);
00796 else
00797 return (0);
00798 }
00799
00800 int
00801 rd_A (unit *ftnunit, char *p, ftnlen len)
00802 {
00803 register int i;
00804
00805 i = GETS (p, (int)len, '\n');
00806 if (i < 0)
00807 return (i);
00808 while (i < len)
00809 p[i++] = ' ';
00810 return (0);
00811 }
00812
00813 int
00814 rd_AW (unit *ftnunit, char *p, long w, ftnlen len)
00815 {
00816 register int i, ch;
00817
00818 while (w > len) {
00819 GET (ch);
00820 w--;
00821 }
00822 i = GETS (p, (int)w, '\n');
00823 if (i < 0)
00824 return i;
00825 while (i < len)
00826 p[i++] = ' ';
00827 return (0);
00828 }
00829
00830 int
00831 rd_H (unit *ftnunit, long n)
00832 {
00833 int i, ch;
00834
00835 for (i = 0; i < n; i++)
00836 if ((ch = (*ftnunit->f77getn) (ftnunit)) < 0)
00837 return (ch);
00838
00839
00840
00841
00842
00843 return (0);
00844 }
00845
00846 int
00847 rd_POS (unit *ftnunit, char *s)
00848 {
00849 char quote;
00850 int ch;
00851
00852 quote = *s++;
00853 for (; *s; s++)
00854 if (*s == quote && *(s + 1) != quote)
00855 break;
00856 else if ((ch = (*ftnunit->f77getn) (ftnunit)) < 0)
00857 return (ch);
00858
00859
00860
00861
00862
00863 return (0);
00864 }