2001-05-17 02:59:29 +08:00
|
|
|
#include "config.h"
|
1998-02-01 09:37:08 +08:00
|
|
|
#include <ctype.h>
|
|
|
|
#include "f2c.h"
|
|
|
|
#include "fio.h"
|
|
|
|
|
|
|
|
/* Compile with -DF8X_NML_ELIDE_QUOTES to permit eliding quotation */
|
|
|
|
/* marks in namelist input a la the Fortran 8X Draft published in */
|
|
|
|
/* the May 1989 issue of Fortran Forum. */
|
|
|
|
|
|
|
|
|
|
|
|
extern char *f__fmtbuf;
|
|
|
|
extern int f__fmtlen;
|
|
|
|
|
|
|
|
#ifdef Allow_TYQUAD
|
|
|
|
static longint f__llx;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#undef abs
|
|
|
|
#undef min
|
|
|
|
#undef max
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "fmt.h"
|
|
|
|
#include "lio.h"
|
|
|
|
#include "fp.h"
|
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
int (*f__lioproc) (ftnint *, char *, ftnlen, ftnint), (*l_getc) (void),
|
|
|
|
(*l_ungetc) (int, FILE *);
|
1999-03-17 16:21:44 +08:00
|
|
|
|
1998-02-01 09:37:08 +08:00
|
|
|
int l_eof;
|
|
|
|
|
|
|
|
#define isblnk(x) (f__ltab[x+1]&B)
|
|
|
|
#define issep(x) (f__ltab[x+1]&SX)
|
|
|
|
#define isapos(x) (f__ltab[x+1]&AX)
|
|
|
|
#define isexp(x) (f__ltab[x+1]&EX)
|
|
|
|
#define issign(x) (f__ltab[x+1]&SG)
|
|
|
|
#define iswhit(x) (f__ltab[x+1]&WH)
|
|
|
|
#define SX 1
|
|
|
|
#define B 2
|
|
|
|
#define AX 4
|
|
|
|
#define EX 8
|
|
|
|
#define SG 16
|
|
|
|
#define WH 32
|
2002-06-01 20:38:32 +08:00
|
|
|
char f__ltab[128 + 1] = { /* offset one for EOF */
|
|
|
|
0,
|
|
|
|
0, 0, AX, 0, 0, 0, 0, 0, 0, WH | B, SX | WH, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
SX | B | WH, 0, AX, 0, 0, 0, 0, AX, 0, 0, 0, SG, SX, SG, 0, SX,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, EX, EX, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
AX, 0, 0, 0, EX, EX, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
1998-02-01 09:37:08 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef ungetc
|
2002-06-01 20:38:32 +08:00
|
|
|
static int
|
|
|
|
un_getc (int x, FILE * f__cf)
|
|
|
|
{
|
|
|
|
return ungetc (x, f__cf);
|
|
|
|
}
|
1998-02-01 09:37:08 +08:00
|
|
|
#else
|
|
|
|
#define un_getc ungetc
|
2002-06-01 20:38:32 +08:00
|
|
|
extern int ungetc (int, FILE *); /* for systems with a buggy stdio.h */
|
1998-02-01 09:37:08 +08:00
|
|
|
#endif
|
|
|
|
|
main.c (main): Avoid implicit int.
* libF77/main.c (main): Avoid implicit int.
* libI77/dfe.c (y_rsk, y_getc, c_dfe): Likewise.
* libI77/due.c (c_due): Likewise.
* libI77/err.c (f__canseek, f__nowreading, f__nowwriting):
Likewise.
* libI77/fmt.c (op_gen, ne_d, e_d, pars_f, type_f, en_fio):
Likewise.
* libI77/iio.c (z_getc, z_rnew, c_si, z_wnew): Likewise.
* libI77/lread.c (t_getc, c_le, l_read): Likewise.
* libI77/lwrite.c (l_write): Likewise.
* libI77/open.c (fk_open): Likewise.
* libI77/rdfmt.c (rd_ed, rd_ned): Likewise.
* libI77/rsfe.c (xrd_SL, x_getc, x_endp, x_rev): Likewise.
* libI77/rsne.c (t_getc, x_rsne): Likewise.
* libI77/sfe.c (c_sfe): Likewise.
* libI77/sue.c (c_sue): Likewise.
* libI77/uio.c (do_us): Likewise.
* libI77/wref.c (wrt_E, wrt_F): Likewise.
* libI77/wrtfmt.c (wrt_L, w_ed, w_ned): Likewise.
From-SVN: r54169
2002-06-02 21:01:12 +08:00
|
|
|
int
|
2002-06-01 20:38:32 +08:00
|
|
|
t_getc (void)
|
|
|
|
{
|
|
|
|
int ch;
|
|
|
|
if (f__curunit->uend)
|
|
|
|
return (EOF);
|
|
|
|
if ((ch = getc (f__cf)) != EOF)
|
|
|
|
return (ch);
|
|
|
|
if (feof (f__cf))
|
|
|
|
f__curunit->uend = l_eof = 1;
|
|
|
|
return (EOF);
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
|
|
|
|
integer
|
|
|
|
e_rsle (void)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
int ch;
|
|
|
|
f__init = 1;
|
|
|
|
if (f__curunit->uend)
|
|
|
|
return (0);
|
|
|
|
while ((ch = t_getc ()) != '\n')
|
|
|
|
if (ch == EOF)
|
|
|
|
{
|
|
|
|
if (feof (f__cf))
|
|
|
|
f__curunit->uend = l_eof = 1;
|
|
|
|
return EOF;
|
|
|
|
}
|
|
|
|
return (0);
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
flag f__lquit;
|
2002-06-01 20:38:32 +08:00
|
|
|
int f__lcount, f__ltype, nml_read;
|
1998-02-01 09:37:08 +08:00
|
|
|
char *f__lchar;
|
2002-06-01 20:38:32 +08:00
|
|
|
double f__lx, f__ly;
|
dfe.c (s_rdfe, s_wdfe): Wrap parentheses around assignment used as truth value.
* libI77/dfe.c (s_rdfe, s_wdfe): Wrap parentheses around
assignment used as truth value.
* libI77/due.c (s_rdue, s_wdue): Likewise.
* libI77/endfile.c (f_end): Likewise.
* libI77/iio.c (s_rsfi, s_wsfi): Likewise.
* libI77/lread.c (ERR, l_C, nmL_getc, s_rsle): Likewise.
* libI77/lwrite.c (l_g, l_put): Likewise.
* libI77/open.c (f_open): Likewise.
* libI77/rdfmt.c (rd_Z): Likewise.
* libI77/rsfe.c (s_rsfe): Likewise.
* libI77/rsne.c (hash, mk_hashtab, nl_init, getname, getdimen,
x_rsne, s_rsne): Likewise.
* libI77/sue.c (s_rsue, s_wsue): Likewise.
* libI77/wref.c (wrt_E, wrt_F): Likewise.
* libI77/wsfe.c (s_wsfe): Likewise.
* libI77/wsle.c (s_wsle): Likewise.
* libI77/wsne.c (s_wsne): Likewise.
From-SVN: r54172
2002-06-02 22:34:31 +08:00
|
|
|
#define ERR(x) if((n=(x))) {f__init &= ~2; return(n);}
|
1998-02-01 09:37:08 +08:00
|
|
|
#define GETC(x) (x=(*l_getc)())
|
|
|
|
#define Ungetc(x,y) (*l_ungetc)(x,y)
|
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
static int
|
|
|
|
l_R (int poststar, int reqint)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
char s[FMAX + EXPMAXDIGS + 4];
|
|
|
|
register int ch;
|
|
|
|
register char *sp, *spe, *sp1;
|
|
|
|
long e, exp;
|
|
|
|
int havenum, havestar, se;
|
|
|
|
|
|
|
|
if (!poststar)
|
|
|
|
{
|
|
|
|
if (f__lcount > 0)
|
|
|
|
return (0);
|
|
|
|
f__lcount = 1;
|
|
|
|
}
|
1998-02-01 09:37:08 +08:00
|
|
|
#ifdef Allow_TYQUAD
|
2002-06-01 20:38:32 +08:00
|
|
|
f__llx = 0;
|
1998-02-01 09:37:08 +08:00
|
|
|
#endif
|
2002-06-01 20:38:32 +08:00
|
|
|
f__ltype = 0;
|
|
|
|
exp = 0;
|
|
|
|
havestar = 0;
|
1998-02-01 09:37:08 +08:00
|
|
|
retry:
|
2002-06-01 20:38:32 +08:00
|
|
|
sp1 = sp = s;
|
|
|
|
spe = sp + FMAX;
|
|
|
|
havenum = 0;
|
|
|
|
|
|
|
|
switch (GETC (ch))
|
|
|
|
{
|
|
|
|
case '-':
|
|
|
|
*sp++ = ch;
|
|
|
|
sp1++;
|
|
|
|
spe++;
|
|
|
|
case '+':
|
|
|
|
GETC (ch);
|
|
|
|
}
|
|
|
|
while (ch == '0')
|
|
|
|
{
|
|
|
|
++havenum;
|
|
|
|
GETC (ch);
|
|
|
|
}
|
|
|
|
while (isdigit (ch))
|
|
|
|
{
|
|
|
|
if (sp < spe)
|
|
|
|
*sp++ = ch;
|
|
|
|
else
|
|
|
|
++exp;
|
|
|
|
GETC (ch);
|
|
|
|
}
|
|
|
|
if (ch == '*' && !poststar)
|
|
|
|
{
|
|
|
|
if (sp == sp1 || exp || *s == '-')
|
|
|
|
{
|
|
|
|
errfl (f__elist->cierr, 112, "bad repetition count");
|
|
|
|
}
|
|
|
|
poststar = havestar = 1;
|
|
|
|
*sp = 0;
|
|
|
|
f__lcount = atoi (s);
|
|
|
|
goto retry;
|
|
|
|
}
|
|
|
|
if (ch == '.')
|
|
|
|
{
|
1998-06-23 22:37:15 +08:00
|
|
|
#ifndef ALLOW_FLOAT_IN_INTEGER_LIST_INPUT
|
2002-06-01 20:38:32 +08:00
|
|
|
if (reqint)
|
|
|
|
errfl (f__elist->cierr, 115, "invalid integer");
|
1998-06-23 22:37:15 +08:00
|
|
|
#endif
|
2002-06-01 20:38:32 +08:00
|
|
|
GETC (ch);
|
|
|
|
if (sp == sp1)
|
|
|
|
while (ch == '0')
|
|
|
|
{
|
|
|
|
++havenum;
|
|
|
|
--exp;
|
|
|
|
GETC (ch);
|
|
|
|
}
|
|
|
|
while (isdigit (ch))
|
|
|
|
{
|
|
|
|
if (sp < spe)
|
|
|
|
{
|
|
|
|
*sp++ = ch;
|
|
|
|
--exp;
|
|
|
|
}
|
|
|
|
GETC (ch);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
havenum += sp - sp1;
|
|
|
|
se = 0;
|
|
|
|
if (issign (ch))
|
|
|
|
goto signonly;
|
|
|
|
if (havenum && isexp (ch))
|
|
|
|
{
|
1998-06-23 22:37:15 +08:00
|
|
|
#ifndef ALLOW_FLOAT_IN_INTEGER_LIST_INPUT
|
2002-06-01 20:38:32 +08:00
|
|
|
if (reqint)
|
|
|
|
errfl (f__elist->cierr, 115, "invalid integer");
|
1998-06-23 22:37:15 +08:00
|
|
|
#endif
|
2002-06-01 20:38:32 +08:00
|
|
|
GETC (ch);
|
|
|
|
if (issign (ch))
|
|
|
|
{
|
|
|
|
signonly:
|
|
|
|
if (ch == '-')
|
|
|
|
se = 1;
|
|
|
|
GETC (ch);
|
|
|
|
}
|
|
|
|
if (!isdigit (ch))
|
|
|
|
{
|
|
|
|
bad:
|
|
|
|
errfl (f__elist->cierr, 112, "exponent field");
|
|
|
|
}
|
|
|
|
|
|
|
|
e = ch - '0';
|
|
|
|
while (isdigit (GETC (ch)))
|
|
|
|
{
|
|
|
|
e = 10 * e + ch - '0';
|
|
|
|
if (e > EXPMAX)
|
|
|
|
goto bad;
|
|
|
|
}
|
|
|
|
if (se)
|
|
|
|
exp -= e;
|
|
|
|
else
|
|
|
|
exp += e;
|
|
|
|
}
|
|
|
|
(void) Ungetc (ch, f__cf);
|
|
|
|
if (sp > sp1)
|
|
|
|
{
|
|
|
|
++havenum;
|
|
|
|
while (*--sp == '0')
|
|
|
|
++exp;
|
|
|
|
if (exp)
|
|
|
|
sprintf (sp + 1, "e%ld", exp);
|
|
|
|
else
|
|
|
|
sp[1] = 0;
|
|
|
|
f__lx = atof (s);
|
1998-02-01 09:37:08 +08:00
|
|
|
#ifdef Allow_TYQUAD
|
2002-06-01 20:38:32 +08:00
|
|
|
if (reqint & 2 && (se = sp - sp1 + exp) > 14 && se < 20)
|
|
|
|
{
|
|
|
|
/* Assuming 64-bit longint and 32-bit long. */
|
|
|
|
if (exp < 0)
|
|
|
|
sp += exp;
|
|
|
|
if (sp1 <= sp)
|
|
|
|
{
|
|
|
|
f__llx = *sp1 - '0';
|
|
|
|
while (++sp1 <= sp)
|
|
|
|
f__llx = 10 * f__llx + (*sp1 - '0');
|
|
|
|
}
|
|
|
|
while (--exp >= 0)
|
|
|
|
f__llx *= 10;
|
|
|
|
if (*s == '-')
|
|
|
|
f__llx = -f__llx;
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
else
|
|
|
|
f__lx = 0.;
|
|
|
|
if (havenum)
|
|
|
|
f__ltype = TYLONG;
|
|
|
|
else
|
|
|
|
switch (ch)
|
|
|
|
{
|
|
|
|
case ',':
|
|
|
|
case '/':
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (havestar && (ch == ' ' || ch == '\t' || ch == '\n'))
|
|
|
|
break;
|
|
|
|
if (nml_read > 1)
|
|
|
|
{
|
|
|
|
f__lquit = 2;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
errfl (f__elist->cierr, 112, "invalid number");
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
1998-02-01 09:37:08 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
static int
|
|
|
|
rd_count (register int ch)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
if (ch < '0' || ch > '9')
|
|
|
|
return 1;
|
|
|
|
f__lcount = ch - '0';
|
|
|
|
while (GETC (ch) >= '0' && ch <= '9')
|
|
|
|
f__lcount = 10 * f__lcount + ch - '0';
|
|
|
|
Ungetc (ch, f__cf);
|
|
|
|
return f__lcount <= 0;
|
|
|
|
}
|
1998-02-01 09:37:08 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
static int
|
|
|
|
l_C (void)
|
|
|
|
{
|
|
|
|
int ch, nml_save;
|
|
|
|
double lz;
|
|
|
|
if (f__lcount > 0)
|
|
|
|
return (0);
|
|
|
|
f__ltype = 0;
|
|
|
|
GETC (ch);
|
|
|
|
if (ch != '(')
|
|
|
|
{
|
|
|
|
if (nml_read > 1 && (ch < '0' || ch > '9'))
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
Ungetc (ch, f__cf);
|
|
|
|
f__lquit = 2;
|
|
|
|
return 0;
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
if (rd_count (ch))
|
2002-06-02 20:57:28 +08:00
|
|
|
{
|
|
|
|
if (!f__cf || !feof (f__cf))
|
|
|
|
errfl (f__elist->cierr, 112, "complex format");
|
|
|
|
else
|
|
|
|
err (f__elist->cierr, (EOF), "lread");
|
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
if (GETC (ch) != '*')
|
|
|
|
{
|
|
|
|
if (!f__cf || !feof (f__cf))
|
|
|
|
errfl (f__elist->cierr, 112, "no star");
|
|
|
|
else
|
|
|
|
err (f__elist->cierr, (EOF), "lread");
|
|
|
|
}
|
|
|
|
if (GETC (ch) != '(')
|
|
|
|
{
|
|
|
|
Ungetc (ch, f__cf);
|
|
|
|
return (0);
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
f__lcount = 1;
|
|
|
|
while (iswhit (GETC (ch)));
|
|
|
|
Ungetc (ch, f__cf);
|
|
|
|
nml_save = nml_read;
|
|
|
|
nml_read = 0;
|
dfe.c (s_rdfe, s_wdfe): Wrap parentheses around assignment used as truth value.
* libI77/dfe.c (s_rdfe, s_wdfe): Wrap parentheses around
assignment used as truth value.
* libI77/due.c (s_rdue, s_wdue): Likewise.
* libI77/endfile.c (f_end): Likewise.
* libI77/iio.c (s_rsfi, s_wsfi): Likewise.
* libI77/lread.c (ERR, l_C, nmL_getc, s_rsle): Likewise.
* libI77/lwrite.c (l_g, l_put): Likewise.
* libI77/open.c (f_open): Likewise.
* libI77/rdfmt.c (rd_Z): Likewise.
* libI77/rsfe.c (s_rsfe): Likewise.
* libI77/rsne.c (hash, mk_hashtab, nl_init, getname, getdimen,
x_rsne, s_rsne): Likewise.
* libI77/sue.c (s_rsue, s_wsue): Likewise.
* libI77/wref.c (wrt_E, wrt_F): Likewise.
* libI77/wsfe.c (s_wsfe): Likewise.
* libI77/wsle.c (s_wsle): Likewise.
* libI77/wsne.c (s_wsne): Likewise.
From-SVN: r54172
2002-06-02 22:34:31 +08:00
|
|
|
if ((ch = l_R (1, 0)))
|
2002-06-01 20:38:32 +08:00
|
|
|
return ch;
|
|
|
|
if (!f__ltype)
|
|
|
|
errfl (f__elist->cierr, 112, "no real part");
|
|
|
|
lz = f__lx;
|
|
|
|
while (iswhit (GETC (ch)));
|
|
|
|
if (ch != ',')
|
|
|
|
{
|
|
|
|
(void) Ungetc (ch, f__cf);
|
|
|
|
errfl (f__elist->cierr, 112, "no comma");
|
|
|
|
}
|
|
|
|
while (iswhit (GETC (ch)));
|
|
|
|
(void) Ungetc (ch, f__cf);
|
dfe.c (s_rdfe, s_wdfe): Wrap parentheses around assignment used as truth value.
* libI77/dfe.c (s_rdfe, s_wdfe): Wrap parentheses around
assignment used as truth value.
* libI77/due.c (s_rdue, s_wdue): Likewise.
* libI77/endfile.c (f_end): Likewise.
* libI77/iio.c (s_rsfi, s_wsfi): Likewise.
* libI77/lread.c (ERR, l_C, nmL_getc, s_rsle): Likewise.
* libI77/lwrite.c (l_g, l_put): Likewise.
* libI77/open.c (f_open): Likewise.
* libI77/rdfmt.c (rd_Z): Likewise.
* libI77/rsfe.c (s_rsfe): Likewise.
* libI77/rsne.c (hash, mk_hashtab, nl_init, getname, getdimen,
x_rsne, s_rsne): Likewise.
* libI77/sue.c (s_rsue, s_wsue): Likewise.
* libI77/wref.c (wrt_E, wrt_F): Likewise.
* libI77/wsfe.c (s_wsfe): Likewise.
* libI77/wsle.c (s_wsle): Likewise.
* libI77/wsne.c (s_wsne): Likewise.
From-SVN: r54172
2002-06-02 22:34:31 +08:00
|
|
|
if ((ch = l_R (1, 0)))
|
2002-06-01 20:38:32 +08:00
|
|
|
return ch;
|
|
|
|
if (!f__ltype)
|
|
|
|
errfl (f__elist->cierr, 112, "no imaginary part");
|
|
|
|
while (iswhit (GETC (ch)));
|
|
|
|
if (ch != ')')
|
|
|
|
errfl (f__elist->cierr, 112, "no )");
|
|
|
|
f__ly = f__lx;
|
|
|
|
f__lx = lz;
|
1998-02-01 09:37:08 +08:00
|
|
|
#ifdef Allow_TYQUAD
|
2002-06-01 20:38:32 +08:00
|
|
|
f__llx = 0;
|
1998-02-01 09:37:08 +08:00
|
|
|
#endif
|
2002-06-01 20:38:32 +08:00
|
|
|
nml_read = nml_save;
|
|
|
|
return (0);
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
1998-06-23 22:37:15 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
static char nmLbuf[256], *nmL_next;
|
|
|
|
static int (*nmL_getc_save) (void);
|
|
|
|
static int (*nmL_ungetc_save) (int, FILE *);
|
2000-12-09 23:34:53 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
static int
|
|
|
|
nmL_getc (void)
|
2000-12-09 23:34:53 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
int rv;
|
dfe.c (s_rdfe, s_wdfe): Wrap parentheses around assignment used as truth value.
* libI77/dfe.c (s_rdfe, s_wdfe): Wrap parentheses around
assignment used as truth value.
* libI77/due.c (s_rdue, s_wdue): Likewise.
* libI77/endfile.c (f_end): Likewise.
* libI77/iio.c (s_rsfi, s_wsfi): Likewise.
* libI77/lread.c (ERR, l_C, nmL_getc, s_rsle): Likewise.
* libI77/lwrite.c (l_g, l_put): Likewise.
* libI77/open.c (f_open): Likewise.
* libI77/rdfmt.c (rd_Z): Likewise.
* libI77/rsfe.c (s_rsfe): Likewise.
* libI77/rsne.c (hash, mk_hashtab, nl_init, getname, getdimen,
x_rsne, s_rsne): Likewise.
* libI77/sue.c (s_rsue, s_wsue): Likewise.
* libI77/wref.c (wrt_E, wrt_F): Likewise.
* libI77/wsfe.c (s_wsfe): Likewise.
* libI77/wsle.c (s_wsle): Likewise.
* libI77/wsne.c (s_wsne): Likewise.
From-SVN: r54172
2002-06-02 22:34:31 +08:00
|
|
|
if ((rv = *nmL_next++))
|
2002-06-01 20:38:32 +08:00
|
|
|
return rv;
|
|
|
|
l_getc = nmL_getc_save;
|
|
|
|
l_ungetc = nmL_ungetc_save;
|
|
|
|
return (*l_getc) ();
|
|
|
|
}
|
2000-12-09 23:34:53 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
static int
|
|
|
|
nmL_ungetc (int x, FILE * f)
|
2000-12-09 23:34:53 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
f = f; /* banish non-use warning */
|
|
|
|
return *--nmL_next = x;
|
|
|
|
}
|
2000-12-09 23:34:53 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
static int
|
|
|
|
Lfinish (int ch, int dot, int *rvp)
|
2000-12-09 23:34:53 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
char *s, *se;
|
|
|
|
static char what[] = "namelist input";
|
|
|
|
|
|
|
|
s = nmLbuf + 2;
|
|
|
|
se = nmLbuf + sizeof (nmLbuf) - 1;
|
|
|
|
*s++ = ch;
|
|
|
|
while (!issep (GETC (ch)) && ch != EOF)
|
|
|
|
{
|
|
|
|
if (s >= se)
|
|
|
|
{
|
|
|
|
nmLbuf_ovfl:
|
|
|
|
return *rvp = err__fl (f__elist->cierr, 131, what);
|
2000-12-09 23:34:53 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
*s++ = ch;
|
|
|
|
if (ch != '=')
|
|
|
|
continue;
|
|
|
|
if (dot)
|
|
|
|
return *rvp = err__fl (f__elist->cierr, 112, what);
|
|
|
|
got_eq:
|
|
|
|
*s = 0;
|
|
|
|
nmL_getc_save = l_getc;
|
|
|
|
l_getc = nmL_getc;
|
|
|
|
nmL_ungetc_save = l_ungetc;
|
|
|
|
l_ungetc = nmL_ungetc;
|
|
|
|
nmLbuf[1] = *(nmL_next = nmLbuf) = ',';
|
|
|
|
*rvp = f__lcount = 0;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (dot)
|
|
|
|
goto done;
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
if (s >= se)
|
|
|
|
goto nmLbuf_ovfl;
|
|
|
|
*s++ = ch;
|
|
|
|
if (!isblnk (ch))
|
|
|
|
break;
|
|
|
|
if (GETC (ch) == EOF)
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
if (ch == '=')
|
|
|
|
goto got_eq;
|
|
|
|
done:
|
|
|
|
Ungetc (ch, f__cf);
|
|
|
|
return 0;
|
|
|
|
}
|
2000-12-09 23:34:53 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
static int
|
|
|
|
l_L (void)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
int ch, rv, sawdot;
|
|
|
|
if (f__lcount > 0)
|
|
|
|
return (0);
|
|
|
|
f__lcount = 1;
|
|
|
|
f__ltype = 0;
|
|
|
|
GETC (ch);
|
|
|
|
if (isdigit (ch))
|
|
|
|
{
|
|
|
|
rd_count (ch);
|
|
|
|
if (GETC (ch) != '*')
|
2002-06-02 20:57:28 +08:00
|
|
|
{
|
|
|
|
if (!f__cf || !feof (f__cf))
|
|
|
|
errfl (f__elist->cierr, 112, "no star");
|
|
|
|
else
|
|
|
|
err (f__elist->cierr, (EOF), "lread");
|
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
GETC (ch);
|
|
|
|
}
|
|
|
|
sawdot = 0;
|
|
|
|
if (ch == '.')
|
|
|
|
{
|
|
|
|
sawdot = 1;
|
|
|
|
GETC (ch);
|
|
|
|
}
|
|
|
|
switch (ch)
|
|
|
|
{
|
|
|
|
case 't':
|
|
|
|
case 'T':
|
|
|
|
if (nml_read && Lfinish (ch, sawdot, &rv))
|
|
|
|
return rv;
|
|
|
|
f__lx = 1;
|
|
|
|
break;
|
|
|
|
case 'f':
|
|
|
|
case 'F':
|
|
|
|
if (nml_read && Lfinish (ch, sawdot, &rv))
|
|
|
|
return rv;
|
|
|
|
f__lx = 0;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (isblnk (ch) || issep (ch) || ch == EOF)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
(void) Ungetc (ch, f__cf);
|
|
|
|
return (0);
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
if (nml_read > 1)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
Ungetc (ch, f__cf);
|
|
|
|
f__lquit = 2;
|
|
|
|
return 0;
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
errfl (f__elist->cierr, 112, "logical");
|
|
|
|
}
|
|
|
|
f__ltype = TYLONG;
|
|
|
|
while (!issep (GETC (ch)) && ch != EOF);
|
|
|
|
(void) Ungetc (ch, f__cf);
|
|
|
|
return (0);
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
1998-06-23 22:37:15 +08:00
|
|
|
|
1998-02-01 09:37:08 +08:00
|
|
|
#define BUFSIZE 128
|
1998-06-23 22:37:15 +08:00
|
|
|
|
2002-06-01 20:38:32 +08:00
|
|
|
static int
|
|
|
|
l_CHAR (void)
|
|
|
|
{
|
|
|
|
int ch, size, i;
|
|
|
|
static char rafail[] = "realloc failure";
|
|
|
|
char quote, *p;
|
|
|
|
if (f__lcount > 0)
|
|
|
|
return (0);
|
|
|
|
f__ltype = 0;
|
|
|
|
if (f__lchar != NULL)
|
|
|
|
free (f__lchar);
|
|
|
|
size = BUFSIZE;
|
|
|
|
p = f__lchar = (char *) malloc ((unsigned int) size);
|
|
|
|
if (f__lchar == NULL)
|
|
|
|
errfl (f__elist->cierr, 113, "no space");
|
|
|
|
|
|
|
|
GETC (ch);
|
|
|
|
if (isdigit (ch))
|
|
|
|
{
|
|
|
|
/* allow Fortran 8x-style unquoted string... */
|
|
|
|
/* either find a repetition count or the string */
|
|
|
|
f__lcount = ch - '0';
|
|
|
|
*p++ = ch;
|
|
|
|
for (i = 1;;)
|
|
|
|
{
|
|
|
|
switch (GETC (ch))
|
|
|
|
{
|
|
|
|
case '*':
|
|
|
|
if (f__lcount == 0)
|
|
|
|
{
|
|
|
|
f__lcount = 1;
|
1998-02-01 09:37:08 +08:00
|
|
|
#ifndef F8X_NML_ELIDE_QUOTES
|
2002-06-01 20:38:32 +08:00
|
|
|
if (nml_read)
|
|
|
|
goto no_quote;
|
1998-02-01 09:37:08 +08:00
|
|
|
#endif
|
2002-06-01 20:38:32 +08:00
|
|
|
goto noquote;
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
p = f__lchar;
|
|
|
|
goto have_lcount;
|
|
|
|
case ',':
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
|
|
|
case '\n':
|
|
|
|
case '/':
|
|
|
|
Ungetc (ch, f__cf);
|
|
|
|
/* no break */
|
|
|
|
case EOF:
|
|
|
|
f__lcount = 1;
|
|
|
|
f__ltype = TYCHAR;
|
|
|
|
return *p = 0;
|
|
|
|
}
|
|
|
|
if (!isdigit (ch))
|
|
|
|
{
|
|
|
|
f__lcount = 1;
|
1998-02-01 09:37:08 +08:00
|
|
|
#ifndef F8X_NML_ELIDE_QUOTES
|
2002-06-01 20:38:32 +08:00
|
|
|
if (nml_read)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
no_quote:
|
|
|
|
errfl (f__elist->cierr, 112,
|
|
|
|
"undelimited character string");
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
#endif
|
|
|
|
goto noquote;
|
|
|
|
}
|
|
|
|
*p++ = ch;
|
|
|
|
f__lcount = 10 * f__lcount + ch - '0';
|
|
|
|
if (++i == size)
|
|
|
|
{
|
|
|
|
f__lchar = (char *) realloc (f__lchar,
|
|
|
|
(unsigned int) (size += BUFSIZE));
|
|
|
|
if (f__lchar == NULL)
|
|
|
|
errfl (f__elist->cierr, 113, rafail);
|
|
|
|
p = f__lchar + i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
(void) Ungetc (ch, f__cf);
|
|
|
|
have_lcount:
|
|
|
|
if (GETC (ch) == '\'' || ch == '"')
|
|
|
|
quote = ch;
|
|
|
|
else if (isblnk (ch) || (issep (ch) && ch != '\n') || ch == EOF)
|
|
|
|
{
|
|
|
|
Ungetc (ch, f__cf);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#ifndef F8X_NML_ELIDE_QUOTES
|
|
|
|
else if (nml_read > 1)
|
|
|
|
{
|
|
|
|
Ungetc (ch, f__cf);
|
|
|
|
f__lquit = 2;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Fortran 8x-style unquoted string */
|
|
|
|
*p++ = ch;
|
|
|
|
for (i = 1;;)
|
|
|
|
{
|
|
|
|
switch (GETC (ch))
|
|
|
|
{
|
|
|
|
case ',':
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
|
|
|
case '\n':
|
|
|
|
case '/':
|
|
|
|
Ungetc (ch, f__cf);
|
|
|
|
/* no break */
|
|
|
|
case EOF:
|
|
|
|
f__ltype = TYCHAR;
|
|
|
|
return *p = 0;
|
|
|
|
}
|
|
|
|
noquote:
|
|
|
|
*p++ = ch;
|
|
|
|
if (++i == size)
|
|
|
|
{
|
|
|
|
f__lchar = (char *) realloc (f__lchar,
|
|
|
|
(unsigned int) (size += BUFSIZE));
|
|
|
|
if (f__lchar == NULL)
|
|
|
|
errfl (f__elist->cierr, 113, rafail);
|
|
|
|
p = f__lchar + i;
|
|
|
|
}
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
}
|
|
|
|
f__ltype = TYCHAR;
|
|
|
|
for (i = 0;;)
|
|
|
|
{
|
|
|
|
while (GETC (ch) != quote && ch != '\n' && ch != EOF && ++i < size)
|
|
|
|
*p++ = ch;
|
|
|
|
if (i == size)
|
|
|
|
{
|
|
|
|
newone:
|
|
|
|
f__lchar = (char *) realloc (f__lchar,
|
|
|
|
(unsigned int) (size += BUFSIZE));
|
|
|
|
if (f__lchar == NULL)
|
|
|
|
errfl (f__elist->cierr, 113, rafail);
|
|
|
|
p = f__lchar + i - 1;
|
|
|
|
*p++ = ch;
|
|
|
|
}
|
|
|
|
else if (ch == EOF)
|
|
|
|
return (EOF);
|
|
|
|
else if (ch == '\n')
|
|
|
|
{
|
|
|
|
if (*(p - 1) != '\\')
|
|
|
|
continue;
|
|
|
|
i--;
|
|
|
|
p--;
|
|
|
|
if (++i < size)
|
|
|
|
*p++ = ch;
|
|
|
|
else
|
|
|
|
goto newone;
|
|
|
|
}
|
|
|
|
else if (GETC (ch) == quote)
|
|
|
|
{
|
|
|
|
if (++i < size)
|
|
|
|
*p++ = ch;
|
|
|
|
else
|
|
|
|
goto newone;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
(void) Ungetc (ch, f__cf);
|
|
|
|
*p = 0;
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
}
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
|
main.c (main): Avoid implicit int.
* libF77/main.c (main): Avoid implicit int.
* libI77/dfe.c (y_rsk, y_getc, c_dfe): Likewise.
* libI77/due.c (c_due): Likewise.
* libI77/err.c (f__canseek, f__nowreading, f__nowwriting):
Likewise.
* libI77/fmt.c (op_gen, ne_d, e_d, pars_f, type_f, en_fio):
Likewise.
* libI77/iio.c (z_getc, z_rnew, c_si, z_wnew): Likewise.
* libI77/lread.c (t_getc, c_le, l_read): Likewise.
* libI77/lwrite.c (l_write): Likewise.
* libI77/open.c (fk_open): Likewise.
* libI77/rdfmt.c (rd_ed, rd_ned): Likewise.
* libI77/rsfe.c (xrd_SL, x_getc, x_endp, x_rev): Likewise.
* libI77/rsne.c (t_getc, x_rsne): Likewise.
* libI77/sfe.c (c_sfe): Likewise.
* libI77/sue.c (c_sue): Likewise.
* libI77/uio.c (do_us): Likewise.
* libI77/wref.c (wrt_E, wrt_F): Likewise.
* libI77/wrtfmt.c (wrt_L, w_ed, w_ned): Likewise.
From-SVN: r54169
2002-06-02 21:01:12 +08:00
|
|
|
int
|
2002-06-01 20:38:32 +08:00
|
|
|
c_le (cilist * a)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
if (f__init != 1)
|
|
|
|
f_init ();
|
|
|
|
f__init = 3;
|
|
|
|
f__fmtbuf = "list io";
|
|
|
|
f__curunit = &f__units[a->ciunit];
|
|
|
|
f__fmtlen = 7;
|
|
|
|
if (a->ciunit >= MXUNIT || a->ciunit < 0)
|
|
|
|
err (a->cierr, 101, "stler");
|
|
|
|
f__scale = f__recpos = 0;
|
|
|
|
f__elist = a;
|
|
|
|
if (f__curunit->ufd == NULL && fk_open (SEQ, FMT, a->ciunit))
|
|
|
|
err (a->cierr, 102, "lio");
|
|
|
|
f__cf = f__curunit->ufd;
|
|
|
|
if (!f__curunit->ufmt)
|
|
|
|
err (a->cierr, 103, "lio");
|
|
|
|
return (0);
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
|
main.c (main): Avoid implicit int.
* libF77/main.c (main): Avoid implicit int.
* libI77/dfe.c (y_rsk, y_getc, c_dfe): Likewise.
* libI77/due.c (c_due): Likewise.
* libI77/err.c (f__canseek, f__nowreading, f__nowwriting):
Likewise.
* libI77/fmt.c (op_gen, ne_d, e_d, pars_f, type_f, en_fio):
Likewise.
* libI77/iio.c (z_getc, z_rnew, c_si, z_wnew): Likewise.
* libI77/lread.c (t_getc, c_le, l_read): Likewise.
* libI77/lwrite.c (l_write): Likewise.
* libI77/open.c (fk_open): Likewise.
* libI77/rdfmt.c (rd_ed, rd_ned): Likewise.
* libI77/rsfe.c (xrd_SL, x_getc, x_endp, x_rev): Likewise.
* libI77/rsne.c (t_getc, x_rsne): Likewise.
* libI77/sfe.c (c_sfe): Likewise.
* libI77/sue.c (c_sue): Likewise.
* libI77/uio.c (do_us): Likewise.
* libI77/wref.c (wrt_E, wrt_F): Likewise.
* libI77/wrtfmt.c (wrt_L, w_ed, w_ned): Likewise.
From-SVN: r54169
2002-06-02 21:01:12 +08:00
|
|
|
int
|
2002-06-01 20:38:32 +08:00
|
|
|
l_read (ftnint * number, char *ptr, ftnlen len, ftnint type)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
|
|
|
#define Ptr ((flex *)ptr)
|
2002-06-01 20:38:32 +08:00
|
|
|
int i, n, ch;
|
|
|
|
doublereal *yy;
|
|
|
|
real *xx;
|
|
|
|
for (i = 0; i < *number; i++)
|
|
|
|
{
|
|
|
|
if (f__lquit)
|
|
|
|
return (0);
|
|
|
|
if (l_eof)
|
|
|
|
err (f__elist->ciend, EOF, "list in");
|
|
|
|
if (f__lcount == 0)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
f__ltype = 0;
|
|
|
|
for (;;)
|
|
|
|
{
|
|
|
|
GETC (ch);
|
|
|
|
switch (ch)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
case EOF:
|
|
|
|
err (f__elist->ciend, (EOF), "list in");
|
|
|
|
case ' ':
|
|
|
|
case '\t':
|
|
|
|
case '\n':
|
|
|
|
continue;
|
|
|
|
case '/':
|
|
|
|
f__lquit = 1;
|
|
|
|
goto loopend;
|
|
|
|
case ',':
|
|
|
|
f__lcount = 1;
|
|
|
|
goto loopend;
|
|
|
|
default:
|
|
|
|
(void) Ungetc (ch, f__cf);
|
|
|
|
goto rddata;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rddata:
|
|
|
|
switch ((int) type)
|
|
|
|
{
|
|
|
|
case TYINT1:
|
|
|
|
case TYSHORT:
|
|
|
|
case TYLONG:
|
1998-06-23 22:37:15 +08:00
|
|
|
#ifndef ALLOW_FLOAT_IN_INTEGER_LIST_INPUT
|
2002-06-01 20:38:32 +08:00
|
|
|
ERR (l_R (0, 1));
|
|
|
|
break;
|
1998-06-23 22:37:15 +08:00
|
|
|
#endif
|
2002-06-01 20:38:32 +08:00
|
|
|
case TYREAL:
|
|
|
|
case TYDREAL:
|
|
|
|
ERR (l_R (0, 0));
|
|
|
|
break;
|
1998-02-01 09:37:08 +08:00
|
|
|
#ifdef TYQUAD
|
2002-06-01 20:38:32 +08:00
|
|
|
case TYQUAD:
|
|
|
|
n = l_R (0, 2);
|
|
|
|
if (n)
|
|
|
|
return n;
|
|
|
|
break;
|
1998-02-01 09:37:08 +08:00
|
|
|
#endif
|
2002-06-01 20:38:32 +08:00
|
|
|
case TYCOMPLEX:
|
|
|
|
case TYDCOMPLEX:
|
|
|
|
ERR (l_C ());
|
|
|
|
break;
|
|
|
|
case TYLOGICAL1:
|
|
|
|
case TYLOGICAL2:
|
|
|
|
case TYLOGICAL:
|
|
|
|
ERR (l_L ());
|
|
|
|
break;
|
|
|
|
case TYCHAR:
|
|
|
|
ERR (l_CHAR ());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
while (GETC (ch) == ' ' || ch == '\t');
|
|
|
|
if (ch != ',' || f__lcount > 1)
|
|
|
|
Ungetc (ch, f__cf);
|
|
|
|
loopend:
|
|
|
|
if (f__lquit)
|
|
|
|
return (0);
|
|
|
|
if (f__cf && ferror (f__cf))
|
|
|
|
{
|
|
|
|
clearerr (f__cf);
|
|
|
|
errfl (f__elist->cierr, errno, "list in");
|
|
|
|
}
|
|
|
|
if (f__ltype == 0)
|
|
|
|
goto bump;
|
|
|
|
switch ((int) type)
|
|
|
|
{
|
|
|
|
case TYINT1:
|
|
|
|
case TYLOGICAL1:
|
|
|
|
Ptr->flchar = (char) f__lx;
|
|
|
|
break;
|
|
|
|
case TYLOGICAL2:
|
|
|
|
case TYSHORT:
|
|
|
|
Ptr->flshort = (short) f__lx;
|
|
|
|
break;
|
|
|
|
case TYLOGICAL:
|
|
|
|
case TYLONG:
|
|
|
|
Ptr->flint = (ftnint) f__lx;
|
|
|
|
break;
|
1998-02-01 09:37:08 +08:00
|
|
|
#ifdef Allow_TYQUAD
|
2002-06-01 20:38:32 +08:00
|
|
|
case TYQUAD:
|
|
|
|
if (!(Ptr->fllongint = f__llx))
|
|
|
|
Ptr->fllongint = f__lx;
|
|
|
|
break;
|
1998-02-01 09:37:08 +08:00
|
|
|
#endif
|
2002-06-01 20:38:32 +08:00
|
|
|
case TYREAL:
|
|
|
|
Ptr->flreal = f__lx;
|
|
|
|
break;
|
|
|
|
case TYDREAL:
|
|
|
|
Ptr->fldouble = f__lx;
|
|
|
|
break;
|
|
|
|
case TYCOMPLEX:
|
|
|
|
xx = (real *) ptr;
|
|
|
|
*xx++ = f__lx;
|
|
|
|
*xx = f__ly;
|
|
|
|
break;
|
|
|
|
case TYDCOMPLEX:
|
|
|
|
yy = (doublereal *) ptr;
|
|
|
|
*yy++ = f__lx;
|
|
|
|
*yy = f__ly;
|
|
|
|
break;
|
|
|
|
case TYCHAR:
|
|
|
|
b_char (f__lchar, ptr, len);
|
|
|
|
break;
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
bump:
|
|
|
|
if (f__lcount > 0)
|
|
|
|
f__lcount--;
|
|
|
|
ptr += len;
|
|
|
|
if (nml_read)
|
|
|
|
nml_read++;
|
|
|
|
}
|
|
|
|
return (0);
|
1998-02-01 09:37:08 +08:00
|
|
|
#undef Ptr
|
|
|
|
}
|
2002-06-01 20:38:32 +08:00
|
|
|
|
|
|
|
integer
|
|
|
|
s_rsle (cilist * a)
|
1998-02-01 09:37:08 +08:00
|
|
|
{
|
2002-06-01 20:38:32 +08:00
|
|
|
int n;
|
|
|
|
|
|
|
|
f__reading = 1;
|
|
|
|
f__external = 1;
|
|
|
|
f__formatted = 1;
|
dfe.c (s_rdfe, s_wdfe): Wrap parentheses around assignment used as truth value.
* libI77/dfe.c (s_rdfe, s_wdfe): Wrap parentheses around
assignment used as truth value.
* libI77/due.c (s_rdue, s_wdue): Likewise.
* libI77/endfile.c (f_end): Likewise.
* libI77/iio.c (s_rsfi, s_wsfi): Likewise.
* libI77/lread.c (ERR, l_C, nmL_getc, s_rsle): Likewise.
* libI77/lwrite.c (l_g, l_put): Likewise.
* libI77/open.c (f_open): Likewise.
* libI77/rdfmt.c (rd_Z): Likewise.
* libI77/rsfe.c (s_rsfe): Likewise.
* libI77/rsne.c (hash, mk_hashtab, nl_init, getname, getdimen,
x_rsne, s_rsne): Likewise.
* libI77/sue.c (s_rsue, s_wsue): Likewise.
* libI77/wref.c (wrt_E, wrt_F): Likewise.
* libI77/wsfe.c (s_wsfe): Likewise.
* libI77/wsle.c (s_wsle): Likewise.
* libI77/wsne.c (s_wsne): Likewise.
From-SVN: r54172
2002-06-02 22:34:31 +08:00
|
|
|
if ((n = c_le (a)))
|
2002-06-01 20:38:32 +08:00
|
|
|
return (n);
|
|
|
|
f__lioproc = l_read;
|
|
|
|
f__lquit = 0;
|
|
|
|
f__lcount = 0;
|
|
|
|
l_eof = 0;
|
|
|
|
if (f__curunit->uwrt && f__nowreading (f__curunit))
|
|
|
|
err (a->cierr, errno, "read start");
|
|
|
|
if (f__curunit->uend)
|
|
|
|
err (f__elist->ciend, (EOF), "read start");
|
|
|
|
l_getc = t_getc;
|
|
|
|
l_ungetc = un_getc;
|
|
|
|
f__doend = xrd_SL;
|
|
|
|
return (0);
|
1998-02-01 09:37:08 +08:00
|
|
|
}
|