1998-02-01 02:37:08 +01:00
|
|
|
#include "f2c.h"
|
|
|
|
#include "fio.h"
|
|
|
|
#include "lio.h"
|
|
|
|
#include "fmt.h" /* for f__doend */
|
|
|
|
|
|
|
|
extern flag f__lquit;
|
|
|
|
extern int f__lcount;
|
|
|
|
extern char *f__icptr;
|
|
|
|
extern char *f__icend;
|
|
|
|
extern icilist *f__svic;
|
|
|
|
extern int f__icnum, f__recpos;
|
|
|
|
|
g2c.hin, [...]: Kill VOID, Void and Int.
* g2c.hin, libF77/d_cnjg.c, libF77/main.c, libF77/r_cnjg.c,
libF77/s_cat.c, libF77/s_paus.c, libF77/s_rnge.c, libF77/setarg.c,
libF77/setsig.c, libF77/signal1.h0, libI77/dfe.c, libI77/due.c,
libI77/err.c, libI77/fio.h, libI77/fmt.c, libI77/iio.c,
libI77/ilnw.c, libI77/lread.c, libI77/lwrite.c, libI77/rsfe.c,
libI77/rsli.c, libI77/rsne.c, libI77/sfe.c, libI77/sue.c,
libI77/util.c, libI77/wrtfmt.c, libI77/wsfe.c, libI77/wsle.c,
libI77/xwsne.c, libU77/date_.c: Kill VOID, Void and Int.
From-SVN: r54134
2002-06-01 03:58:10 +02:00
|
|
|
static int i_getc(void)
|
1998-02-01 02:37:08 +01:00
|
|
|
{
|
|
|
|
if(f__recpos >= f__svic->icirlen) {
|
|
|
|
if (f__recpos++ == f__svic->icirlen)
|
|
|
|
return '\n';
|
|
|
|
z_rnew();
|
|
|
|
}
|
|
|
|
f__recpos++;
|
|
|
|
if(f__icptr >= f__icend)
|
|
|
|
return EOF;
|
|
|
|
return(*f__icptr++);
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
int i_ungetc(int ch, FILE *f)
|
|
|
|
{
|
|
|
|
if (--f__recpos == f__svic->icirlen)
|
|
|
|
return '\n';
|
|
|
|
if (f__recpos < -1)
|
|
|
|
err(f__svic->icierr,110,"recend");
|
|
|
|
/* *--icptr == ch, and icptr may point to read-only memory */
|
|
|
|
return *--f__icptr /* = ch */;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
c_lir(icilist *a)
|
|
|
|
{
|
|
|
|
extern int l_eof;
|
|
|
|
if(f__init != 1) f_init();
|
|
|
|
f__init = 3;
|
|
|
|
f__reading = 1;
|
|
|
|
f__external = 0;
|
|
|
|
f__formatted = 1;
|
|
|
|
f__svic = a;
|
|
|
|
L_len = a->icirlen;
|
|
|
|
f__recpos = -1;
|
|
|
|
f__icnum = f__recpos = 0;
|
|
|
|
f__cursor = 0;
|
|
|
|
l_getc = i_getc;
|
|
|
|
l_ungetc = i_ungetc;
|
|
|
|
l_eof = 0;
|
|
|
|
f__icptr = a->iciunit;
|
|
|
|
f__icend = f__icptr + a->icirlen*a->icirnum;
|
|
|
|
f__cf = 0;
|
|
|
|
f__curunit = 0;
|
|
|
|
f__elist = (cilist *)a;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
integer s_rsli(icilist *a)
|
|
|
|
{
|
|
|
|
f__lioproc = l_read;
|
|
|
|
f__lquit = 0;
|
|
|
|
f__lcount = 0;
|
|
|
|
c_lir(a);
|
|
|
|
f__doend = 0;
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
g2c.hin, [...]: Kill VOID, Void and Int.
* g2c.hin, libF77/d_cnjg.c, libF77/main.c, libF77/r_cnjg.c,
libF77/s_cat.c, libF77/s_paus.c, libF77/s_rnge.c, libF77/setarg.c,
libF77/setsig.c, libF77/signal1.h0, libI77/dfe.c, libI77/due.c,
libI77/err.c, libI77/fio.h, libI77/fmt.c, libI77/iio.c,
libI77/ilnw.c, libI77/lread.c, libI77/lwrite.c, libI77/rsfe.c,
libI77/rsli.c, libI77/rsne.c, libI77/sfe.c, libI77/sue.c,
libI77/util.c, libI77/wrtfmt.c, libI77/wsfe.c, libI77/wsle.c,
libI77/xwsne.c, libU77/date_.c: Kill VOID, Void and Int.
From-SVN: r54134
2002-06-01 03:58:10 +02:00
|
|
|
integer e_rsli(void)
|
1998-02-01 02:37:08 +01:00
|
|
|
{ f__init = 1; return 0; }
|
|
|
|
|
|
|
|
extern int x_rsne(cilist*);
|
|
|
|
|
|
|
|
integer s_rsni(icilist *a)
|
|
|
|
{
|
|
|
|
extern int nml_read;
|
|
|
|
integer rv;
|
|
|
|
cilist ca;
|
|
|
|
ca.ciend = a->iciend;
|
|
|
|
ca.cierr = a->icierr;
|
|
|
|
ca.cifmt = a->icifmt;
|
|
|
|
c_lir(a);
|
|
|
|
rv = x_rsne(&ca);
|
|
|
|
nml_read = 0;
|
|
|
|
return rv;
|
|
|
|
}
|