Open64 (mfef90, whirl2f, and IR tools)
TAG: version-openad; SVN changeset: 916
|
#include <stdio.h>
#include <errno.h>
#include <liberrno.h>
#include <fortran.h>
#include <stdlib.h>
#include <cray/fmtconv.h>
#include <cray/nassert.h>
#include <sys/unistd.h>
#include "fio.h"
#include "namelist.h"
#include "rnl90def.h"
#include "fmt.h"
Go to the source code of this file.
Classes | |
struct | Echoinfo |
Defines | |
#define | SUBGTC(x) |
#define | CMTSUBGT(x) |
#define | CMTSUBGTNOEOR(x) |
#define | MAINGT(x) |
#define | CMTMAINGT(x) |
#define | GETSECTION(x) |
#define | GETSTR77() |
#define | MATCH(c, a, b) (a[(c >= 0x3f) ? b+1 : b] & (1 << (IND(c)))) |
#define | IND(c) ((c >= 0x3f) ? 0x7f - (unsigned)c : (unsigned)(0x40 - c - 1)) |
Functions | |
int | _s_scan_extensions (void *ptr, ftype_t type, unsigned elsize, long *field_begin, unsigned rec_chars, int *fwptr, long cmode) |
int | _nicverr (const int _Nicverror) |
static void | _nlrdecho (unum_t eunit, long *input_ptr, long nchrs, FIOSPTR css) |
static int | _nlrd_fillrec (FIOSPTR css, unit *cup, struct Echoinfo *echoptr) |
static void | _setunit (char *string, void *u) |
static int | _getname (FIOSPTR css, unit *cup, char *buf, char *lastc, struct Echoinfo *echoptr) |
static void | _pr_echomsg (char *string) |
static void | _cnvrt_toupper (char *bufr) |
static int | _ishol (long *hlptr, unit *cup) |
static nmlist_goli_t * | _findname (char *key, nmlist_goli_t *nlvar, unsigned countitm) |
static int | _getnlval (FIOSPTR css, nmlist_goli_t *nlvar, char *lastc, unit *cup, struct Echoinfo *echoptr) |
static int | _indx_nl (FIOSPTR css, unit *cup, struct Echoinfo *echoptr, long *begcnt, int *ndim, long strbegend[3], int *encnt, int *icnt, int arryflag) |
static int | _nlread (FIOSPTR css, ftype_t type, void *ptr, int cnt, int inc, char *lastc, unit *cup, struct Echoinfo *echoptr, int elsize) |
static int | _nexdata (FIOSPTR css, ftype_t type, void *ptr, int cnt, int inc, char lastc, unit *cup, struct Echoinfo *echoptr, long *lval, int *lcount, int elsize, int *nullvlu) |
static int | _g_charstr (FIOSPTR css, unit *cup, void *p, int cnt, char c, struct Echoinfo *echoptr, int lcount, int elsize, int *nullvlu) |
static int | _g_complx (FIOSPTR css, unit *cup, ftype_t type, struct Echoinfo *echoptr, long *lval, int elsize) |
static int | _g_number (ftype_t type, unit *cup, long *lval, int elsize) |
static int | _gocthex (FIOSPTR css, unit *cup, ftype_t type, struct Echoinfo *echoptr, long *lval, int base, int elsize, int *nullvlu) |
static int | _get_holl (FIOSPTR css, unit *cup, char holltype, int count, ftype_t type, struct Echoinfo *echoptr, long *lval, int elsize) |
static int | _get_quoholl (FIOSPTR css, unit *cup, char cdelim, ftype_t type, struct Echoinfo *echoptr, long *lval, int elsize) |
int | _rnl90to77 (FIOSPTR css, unit *cup, nmlist_group *namlist, void *stck, int errf, int endf) |
Variables | |
ic_func * | ncf_tab77 [] |
#define CMTMAINGT | ( | x | ) |
{ \ while (cup->ulinecnt == 0) { \ if (errn = _nlrd_fillrec(css, cup, echoptr)) { \ if (errn < 0) { \ ENDD(endf, css, FERDPEOF); \ } \ else { \ ERROR0(errf, css, errn); \ } \ } \ } \ x = (char) *cup->ulineptr++; \ /* An f90 input comment is now part of RNLCOMM */ \ if (MATCH(x, _MASKS, MRNLCOMM)) { \ x = ' '; \ cup->ulinecnt = 1; \ } \ cup->ulinecnt--; \ }
Definition at line 128 of file rnl90to77.c.
Referenced by _rnl90to77().
#define CMTSUBGT | ( | x | ) |
{ \ while (cup->ulinecnt == 0) { \ if (errn = _nlrd_fillrec(css, cup, echoptr)) { \ return(errn); \ } \ } \ x = (char) *cup->ulineptr++; \ /* An f90 input comment is now part of RNLCOMM */ \ if (MATCH(x, _MASKS, MRNLCOMM)) { \ x = ' '; \ cup->ulinecnt = 1; \ } \ cup->ulinecnt--; \ }
Definition at line 77 of file rnl90to77.c.
Referenced by _getname(), _getnlval(), _gocthex(), _nexdata(), and _nlread().
#define CMTSUBGTNOEOR | ( | x | ) |
{ \ if (cup->ulinecnt == 0) { \ x = ' '; \ } else { \ x = (char) *cup->ulineptr++; \ cup->ulinecnt--; \ } \ /* An f90 input comment is now part of RNLCOMM */ \ if (MATCH(x, _MASKS, MRNLCOMM)) { \ x = ' '; \ cup->ulinecnt = 1; \ } \ }
Definition at line 92 of file rnl90to77.c.
Referenced by _getname().
#define GETSECTION | ( | x | ) |
{ \ field_begin = cup->ulineptr; \ field_end = cup->ulineptr; \ for (j = 0; j < cup->ulinecnt; j++) { \ x = (char) *field_end; \ if (x == ')' || x == ',' || x == ':') \ break; \ field_end++; \ } \ field_width = j; \ }
Definition at line 148 of file rnl90to77.c.
Referenced by _indx_nl().
#define GETSTR77 | ( | ) |
{ \ if (cup->ulinecnt <= 1) { \ SUBGTC(ch); \ } \ SUBGTC(ch); \ if (ch == enddelim) { \ eos = -1; /* end of string */ \ SUBGTC(ch); /* unless string delimiter is doubled */ \ if (ch == enddelim) \ eos = 0; \ else { \ cup->ulineptr--; \ cup->ulinecnt++; \ } \ } \ }
Definition at line 165 of file rnl90to77.c.
Referenced by _g_charstr().
Definition at line 213 of file rnl90to77.c.
#define MAINGT | ( | x | ) |
{ \ while (cup->ulinecnt == 0) { \ if (errn = _nlrd_fillrec(css, cup, echoptr)) { \ if (errn < 0) { \ ENDD(endf, css, FERDPEOF); \ } \ else { \ ERROR0(errf, css, errn); \ } \ } \ } \ x = (char) *cup->ulineptr++; \ cup->ulinecnt--; \ }
Definition at line 113 of file rnl90to77.c.
Referenced by _rnl90to77().
Definition at line 210 of file rnl90to77.c.
Referenced by _g_charstr(), _g_complx(), _g_number(), _getname(), _getnlval(), _gocthex(), _indx_nl(), _ishol(), _nexdata(), _nlrd_fillrec(), _nlread(), _rnl90to77(), _rnl_fillrec(), g_charstr(), g_octhex(), isholl(), n_getn(), n_getv(), n_indx(), nex_data(), nl_read(), and RNL().
#define SUBGTC | ( | x | ) |
{ \ while (cup->ulinecnt == 0) { \ if (errn = _nlrd_fillrec(css, cup, echoptr)) { \ return(errn); \ } \ } \ x = (char) *cup->ulineptr++; \ cup->ulinecnt--; \ }
Definition at line 67 of file rnl90to77.c.
Referenced by _g_charstr(), _g_complx(), _get_holl(), _get_quoholl(), _gocthex(), _indx_nl(), and _nexdata().
static void _cnvrt_toupper | ( | char * | bufr | ) | [static] |
static nmlist_goli_t * _findname | ( | char * | key, |
nmlist_goli_t * | nlvar, | ||
unsigned | countitm | ||
) | [static] |
Definition at line 629 of file rnl90to77.c.
References _fcdlen(), _fcdtocp(), nmlist_goli::goli_name, NULL, and varlen().
Referenced by _rnl90to77().
static int _g_charstr | ( | FIOSPTR | css, |
unit * | cup, | ||
void * | p, | ||
int | cnt, | ||
char | c, | ||
struct Echoinfo * | echoptr, | ||
int | lcount, | ||
int | elsize, | ||
int * | nullvlu | ||
) | [static] |
static int _g_complx | ( | FIOSPTR | css, |
unit * | cup, | ||
ftype_t | type, | ||
struct Echoinfo * | echoptr, | ||
long * | lval, | ||
int | elsize | ||
) | [static] |
Definition at line 1689 of file rnl90to77.c.
References _BLNKSEP, _MASKS, _nicverr(), _s_scan_extensions(), c, FEKNTSUP, FENICVIC, FENLIVCX, ISBLANK, MATCH, MODEBN, MODEDP, MODEHP, MRNLDELIM, MRNLSEP, ncf_tab77, stat, SUBGTC, unit_s::ulinecnt, unit_s::ulineptr, and zero.
Referenced by _nexdata().
Definition at line 1834 of file rnl90to77.c.
References _BLNKSEP, _MASKS, _nicverr(), _s_scan_extensions(), _TYP_CONV, EX_REAL128, EX_REAL32, EX_REAL64, f, FEKNTSUP, FENICVIC, FENLIVIT, FENLUNKI, MATCH, MODEBN, MODEDP, MODEHP, MRNLDELIM, MRNLSEP, ncf_tab77, stat, unit_s::ulinecnt, unit_s::ulineptr, and zero.
Referenced by _nexdata().
static int _get_holl | ( | FIOSPTR | css, |
unit * | cup, | ||
char | holltype, | ||
int | count, | ||
ftype_t | type, | ||
struct Echoinfo * | echoptr, | ||
long * | lval, | ||
int | elsize | ||
) | [static] |
Definition at line 2265 of file rnl90to77.c.
References BLANK, c, FENLIOER, FENLUNKI, NULLC, stat, SUBGTC, and unit_s::ulinecnt.
Referenced by _nexdata().
static int _get_quoholl | ( | FIOSPTR | css, |
unit * | cup, | ||
char | cdelim, | ||
ftype_t | type, | ||
struct Echoinfo * | echoptr, | ||
long * | lval, | ||
int | elsize | ||
) | [static] |
Definition at line 2350 of file rnl90to77.c.
References BLANK, c, FENLIOER, FENLUNKI, NULLC, stat, SUBGTC, unit_s::ulinecnt, and unit_s::ulineptr.
Referenced by _nexdata().
static int _getname | ( | FIOSPTR | css, |
unit * | cup, | ||
char * | buf, | ||
char * | lastc, | ||
struct Echoinfo * | echoptr | ||
) | [static] |
Definition at line 588 of file rnl90to77.c.
References _MASKS, c, CMTSUBGT, CMTSUBGTNOEOR, FENLLGNM, ISBLANK, MATCH, MAXNAML, MRNLDELIM, MRNLREP, and s.
Referenced by _rnl90to77().
static int _getnlval | ( | FIOSPTR | css, |
nmlist_goli_t * | nlvar, | ||
char * | lastc, | ||
unit * | cup, | ||
struct Echoinfo * | echoptr | ||
) | [static] |
Definition at line 671 of file rnl90to77.c.
References _fcdlen(), _fcdtocp(), _indx_nl(), _MASKS, _nlread(), c, nmlist_scalar::charptr, CMTSUBGT, nmlist_goli::dv, FEINTUNK, FENLBNDY, FENLNOVL, FENLSTCT, FENLSTRG, FENLSTRN, FENLSUBN, FENLSUBS, FENLUNKI, FENLUNKN, nmlist_goli::goli_addr, f90_type::int_len, ISBLANK, MATCH, MAXDIM, MRNLDELIM, MRNLREP, NULL, nmlist_scalar::ptr, nmlist_goli::ptr, nmlist_scalar::scal_addr, stat, nmlist_scalar::tinfo, f90_type::type, and nmlist_goli::valtype.
Referenced by _rnl90to77().
static int _indx_nl | ( | FIOSPTR | css, |
unit * | cup, | ||
struct Echoinfo * | echoptr, | ||
long * | begcnt, | ||
int * | ndim, | ||
long | strbegend[3], | ||
int * | encnt, | ||
int * | icnt, | ||
int | arryflag | ||
) | [static] |
Definition at line 1026 of file rnl90to77.c.
References _iu2s, _MASKS, c, dummy, FENLARSC, FENLSTRG, FENLSTRN, FENLSUBD, FENLSUBN, FENLSUBS, GETSECTION, ISBLANK, MATCH, MAXDIMS, MRNLREP, stat, SUBGTC, tempbuf, unit_s::ulinecnt, and unit_s::ulineptr.
Referenced by _getnlval().
Definition at line 1295 of file rnl90to77.c.
References _MASKS, ISBLANK, MATCH, MRNLREP, MRNLSEP, unit_s::ulinebuf, and unit_s::ulineptr.
Referenced by _rnl90to77().
static int _nexdata | ( | FIOSPTR | css, |
ftype_t | type, | ||
void * | ptr, | ||
int | cnt, | ||
int | inc, | ||
char | lastc, | ||
unit * | cup, | ||
struct Echoinfo * | echoptr, | ||
long * | lval, | ||
int * | lcount, | ||
int | elsize, | ||
int * | nullvlu | ||
) | [static] |
Definition at line 1334 of file rnl90to77.c.
References _btol(), _g_charstr(), _g_complx(), _g_number(), _get_holl(), _get_quoholl(), _gocthex(), _MASKS, c, CMTSUBGT, FEKNTSUP, FENLIVCX, FENLIVLG, HEX, ISBLANK, MATCH, MRNLCOMM, MRNLDELIM, MRNLREP, MRNLSEP, OCTAL, stat, SUBGTC, unit_s::ulinecnt, and unit_s::ulineptr.
Referenced by _nlread().
Definition at line 828 of file rdfmt.c.
References EX_EXPOFLO, EX_EXPUFLO, EX_FIXOFLO, EX_ILLCHAR, EX_INVLOGI, EX_NULLFLD, FEINTUNK, FENICVBK, FENICVEO, FENICVEU, FENICVIC, FENICVOF, and FERDIVLG.
static int _nlrd_fillrec | ( | FIOSPTR | css, |
unit * | cup, | ||
struct Echoinfo * | echoptr | ||
) | [static] |
Definition at line 544 of file rnl90to77.c.
References _MASKS, _nlrdecho(), BLANK, fiostate::iostate::fmtstate::endrec, Echoinfo::eunit, fiostate::iostate::fmt, MATCH, MRNLFLAG, Echoinfo::rnlecho, fiostate::u, unit_s::ulinebuf, unit_s::ulinecnt, and unit_s::ulineptr.
Referenced by _rnl90to77().
Definition at line 1209 of file rnl90to77.c.
References _ferr(), _fwch(), _get_cup(), _imp_open77(), _release_cup(), BLANK, fiostate::f_cu, FEFMTTIV, FESEQTIV, FMT, FULL, NULL, PARTIAL, SEQ, stat, unit_s::ufmt, and unit_s::useq.
Referenced by _nlrd_fillrec(), and _rnl90to77().
static int _nlread | ( | FIOSPTR | css, |
ftype_t | type, | ||
void * | ptr, | ||
int | cnt, | ||
int | inc, | ||
char * | lastc, | ||
unit * | cup, | ||
struct Echoinfo * | echoptr, | ||
int | elsize | ||
) | [static] |
Definition at line 928 of file rnl90to77.c.
References _MASKS, _nexdata(), c, CMTSUBGT, FENLTOOM, ISBLANK, MATCH, MIN, MRNLSEP, and stat.
Referenced by _getnlval().
static void _pr_echomsg | ( | char * | string | ) | [static] |
Definition at line 1267 of file rnl90to77.c.
References errfile, fileno(), and write.
Referenced by _rnl90to77().
int _rnl90to77 | ( | FIOSPTR | css, |
unit * | cup, | ||
nmlist_group * | namlist, | ||
void * | stck, | ||
int | errf, | ||
int | endf | ||
) |
Definition at line 288 of file rnl90to77.c.
References _cnvrt_toupper(), _fcdlen(), _fcdtocp(), _findname(), _getname(), _getnlval(), _ishol(), _MASKS, _nlrd_fillrec(), _nlrdecho(), _OUT_UNIT, _pr_echomsg(), _setunit(), _SKP_MESS, AS_IRIX_F77, AS_IRIX_F90, BLANK, buf, c, CMTMAINGT, ENDD, ERROR0, ERROR1, Echoinfo::eunit, FENLARSC, FENLIVGP, FENLIVIT, FENLLGNM, FENLNREC, FENLSTRG, FENLSTRN, FENLSUBD, FENLSUBN, FENLSUBS, FENLUNKI, FENLUNKN, FERDPEOF, nmlist_group::goli, nmlist_group::group_name, nmlist_group::icount, ISBLANK, MAINGT, MATCH, MAXNAML, MRNLDELIM, MRNLFLAG, MRNLSEP, MXUNITSZ, NULL, ret, Echoinfo::rnlecho, SKIPMSG, stat, strcpy, unit_s::ufcompat, unit_s::ufnl_skip, unit_s::uid, unit_s::ulinebuf, unit_s::ulinecnt, unit_s::ulineptr, UNITSTR, and varlen().
Referenced by _FRN().
int _s_scan_extensions | ( | void * | ptr, |
ftype_t | type, | ||
unsigned | elsize, | ||
long * | field_begin, | ||
unsigned | rec_chars, | ||
int * | fwptr, | ||
long | cmode | ||
) |
static void _setunit | ( | char * | string, |
void * | u | ||
) | [static] |
Definition at line 1250 of file rnl90to77.c.
References _is_file_name().
Referenced by _rnl90to77().
Definition at line 196 of file rnl90to77.c.
Referenced by _g_complx(), and _g_number().