Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
rnl90to77.c File Reference
#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"
Include dependency graph for rnl90to77.c:

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_funcncf_tab77 []

Define Documentation

#define CMTMAINGT (   x)
Value:
{ \
        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)
Value:
{ \
        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)
Value:
{ \
        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)
Value:
{ \
                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 ( )
Value:
{                                                       \
        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().

#define IND (   c)    ((c >= 0x3f) ? 0x7f - (unsigned)c : (unsigned)(0x40 - c - 1))

Definition at line 213 of file rnl90to77.c.

#define MAINGT (   x)
Value:
{ \
        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().

#define MATCH (   c,
  a,
 
)    (a[(c >= 0x3f) ? b+1 : b] & (1 << (IND(c))))
#define SUBGTC (   x)
Value:
{ \
        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().


Function Documentation

static void _cnvrt_toupper ( char *  bufr) [static]

Definition at line 1277 of file rnl90to77.c.

References c.

Referenced by _rnl90to77().

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

static int _g_number ( ftype_t  type,
unit cup,
long *  lval,
int  elsize 
) [static]

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().

Here is the call graph for this function:

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 _gocthex ( FIOSPTR  css,
unit cup,
ftype_t  type,
struct Echoinfo echoptr,
long *  lval,
int  base,
int  elsize,
int *  nullvlu 
) [static]
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]
static int _ishol ( long *  hlptr,
unit cup 
) [static]

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]
int _nicverr ( const int  _Nicverror)
static int _nlrd_fillrec ( FIOSPTR  css,
unit cup,
struct Echoinfo echoptr 
) [static]
static void _nlrdecho ( unum_t  eunit,
long *  input_ptr,
long  nchrs,
FIOSPTR  css 
) [static]

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

static void _pr_echomsg ( char *  string) [static]

Definition at line 1267 of file rnl90to77.c.

References errfile, fileno(), and write.

Referenced by _rnl90to77().

Here is the call graph for this function:

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().

Here is the call graph for this function:


Variable Documentation

Initial value:
 {
        NULL,           
        NULL,           
        _iu2s,          
        _defgu2sd,      
        _defgu2sd,      
        NULL,           
        NULL,           
}

Definition at line 196 of file rnl90to77.c.

Referenced by _g_complx(), and _g_number().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines