Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
rnly.c File Reference
#include <stdio.h>
#include <errno.h>
#include <liberrno.h>
#include <ctype.h>
#include <foreign.h>
#include <fortran.h>
#include <memory.h>
#include <values.h>
#include <stdlib.h>
#include <cray/fmtconv.h>
#include "fio.h"
#include "fmt.h"
#include "rnl.h"
Include dependency graph for rnly.c:

Go to the source code of this file.

Classes

struct  Echoinfo

Defines

#define BLANK   ((int) ' ')
#define NULLC   ((int) '\0')
#define OCTAL   1 /* reading octal input */
#define HEX   2 /* reading hex input */
#define SKIPMSG   " - Skipped record named: "
#define UNITSTR   " On Unit: "
#define TONICV(value)
#define GETSTR()

Functions

static void _rnlecho (unum_t _Un, struct Inpinfo *_Ip)
static int _rnl_fillrec (unit *_Cu, struct Echoinfo *_Ec, struct Inpinfo *_Ip)
static void fmt_unit (char *_Str, void *_U)
static int g_charstr (long _P, int _Cn, char _C, unit *_Cu, struct Echoinfo *_Ec, struct Inpinfo *_Ip, int _Lc, int _Sz)
static int g_complx (int _Ty, unit *_Cu, struct Echoinfo *_Ec, struct Inpinfo *_Ip, long *_Lv)
static int g_number (int _Ty, unit *_Cu, long *_Lv, struct Inpinfo *_Ip)
static int g_octhex (int _Ty, unit *_Cu, struct Echoinfo *_Ec, struct Inpinfo *_Ip, long *_Lv, int _Base)
static int get_holl (char _Ho, int _Cn, int _Ty, unit *_Cu, struct Echoinfo *_Ec, struct Inpinfo *_Ip, long *_Lv)
static int get_quoholl (char _Cd, int _Ty, unit *_Cu, struct Echoinfo *_Ec, struct Inpinfo *_Ip, long *_Lv)
static int isholl (long *_Hp, struct Inpinfo *_Ip)
static int l_convert (long *_Val, int _Ty, long _Stat)
static Nlentryn_findn (char *_Key, Nlentry *_List)
static int n_getn (char *_S, char *_Lc, unit *_Cu, struct Echoinfo *_Ec, struct Inpinfo *_Ip)
static int n_getv (Nlentry *_Nlent, char *_Lc, Namelist *_Nlbase, unit *_Cu, struct Echoinfo *_Ec, struct Inpinfo *_Ip)
static int n_indx (int *_Of, Nlentry *_Nlent, Namelist *_Nlbase, unit *_Cu, struct Echoinfo *_Ec, struct Inpinfo *_Ip)
static int nex_data (int _Ty, long _Pt, int _Cn, int _In, char _La, unit *_Cu, struct Echoinfo *_Ec, struct Inpinfo *_Ip, long *_Lv, int *_Lc, int _Sz)
static int nl_read (long _P, int _Cn, int _In, int _Ty, char *_Lc, unit *_Cu, struct Echoinfo *_Ec, struct Inpinfo *_Ip, int _Sz)
static void pr_msg (char *_Str)
static void to_upper (char *_Str)
 RNL (_f_int *unump, Namelist *nl, int errf, int endf)

Variables

static int zero = 0

Define Documentation

#define BLANK   ((int) ' ')

Definition at line 54 of file rnly.c.

Referenced by g_charstr(), get_holl(), and get_quoholl().

#define GETSTR ( )
Value:
{ \
        if (inptr->incnt == 1) {        \
                LGET(ch); /* skip the blank put in at EOR */\
        }                               \
        LGET(ch);                       \
        if (ch == enddelim) {           \
                eos     = -1; /* end of string */\
                LGET(ch);/* unless the string delimiter is doubled */\
                if (ch == enddelim)     \
                        eos     = 0;    \
                else {                  \
                        inptr->inptr--; \
                        inptr->incnt++; \
                }                       \
        }                               \
}

Definition at line 138 of file rnly.c.

Referenced by g_charstr().

#define HEX   2 /* reading hex input */

Definition at line 58 of file rnly.c.

Referenced by _nexdata(), and nex_data().

#define NULLC   ((int) '\0')

Definition at line 55 of file rnly.c.

Referenced by _get_holl(), _get_quoholl(), get_holl(), and get_quoholl().

#define OCTAL   1 /* reading octal input */

Definition at line 57 of file rnly.c.

Referenced by g_octhex(), and nex_data().

#define SKIPMSG   " - Skipped record named: "

Definition at line 59 of file rnly.c.

Referenced by _rnl90to77(), and RNL().

#define TONICV (   value)
Value:
{                                       \
        inptr->inptr--;                                 \
        inptr->incnt++; /* backup 1 character */        \
        oldp    = inptr->inptr;                         \
        (void) NICONV(oldp, &zero, &zero, &zero, &mode, \
                value, &inptr->inptr, &stat);           \
        inptr->incnt    -= inptr->inptr - oldp;         \
}

Definition at line 124 of file rnly.c.

Referenced by g_complx(), and g_number().

#define UNITSTR   " On Unit: "

Definition at line 60 of file rnly.c.

Referenced by _rnl90to77(), and RNL().


Function Documentation

static int _rnl_fillrec ( unit _Cu,
struct Echoinfo _Ec,
struct Inpinfo _Ip 
) [static]

Definition at line 2116 of file rnly.c.

References _frch(), _MASKS, _rnlecho(), CNT, EOD, EOF, EOR, errno, Echoinfo::eunit, FENLRECL, Inpinfo::incnt, Inpinfo::inptr, Inpinfo::instart, MATCH, MRNLFLAG, RNL_ERROR, Echoinfo::rnlecho, stat, unit_s::uend, and unit_s::urecsize.

Referenced by RNL().

Here is the call graph for this function:

static void _rnlecho ( unum_t  _Un,
struct Inpinfo _Ip 
) [static]

Definition at line 818 of file rnly.c.

References _ferr(), _fwch(), _get_cup(), _imp_open77(), _release_cup(), fiostate::f_cu, FEFMTTIV, FESEQTIV, FMT, FULL, GET_FIOS_PTR, Inpinfo::inbuff, Inpinfo::incnt, NULL, SEQ, unit_s::ufmt, and unit_s::useq.

Referenced by _rnl_fillrec().

Here is the call graph for this function:

static void fmt_unit ( char *  _Str,
void *  _U 
) [static]

Definition at line 865 of file rnly.c.

References _is_file_name().

Referenced by RNL().

Here is the call graph for this function:

static int g_charstr ( long  _P,
int  _Cn,
char  _C,
unit _Cu,
struct Echoinfo _Ec,
struct Inpinfo _Ip,
int  _Lc,
int  _Sz 
) [static]

Definition at line 1592 of file rnly.c.

References _MASKS, BLANK, c, eos, FENLIOER, FENLNOVL, GETSTR, Inpinfo::incnt, Inpinfo::inptr, ISSPTB, LGET, MATCH, MIN, MRNLCOMM, MRNLDELIM, MRNLREP, MRNLSEP, RNLERROR, and stat.

Referenced by nex_data().

static int g_complx ( int  _Ty,
unit _Cu,
struct Echoinfo _Ec,
struct Inpinfo _Ip,
long *  _Lv 
) [static]

Definition at line 1380 of file rnly.c.

References _BLNKSEP, c, DT_CMPLX, DT_REAL, FENLIVCX, FENLTYPI, ISSPTB, l_convert(), LGET, MBN, RNLERROR, stat, and TONICV.

Referenced by nex_data().

Here is the call graph for this function:

static int g_number ( int  _Ty,
unit _Cu,
long *  _Lv,
struct Inpinfo _Ip 
) [static]

Definition at line 1451 of file rnly.c.

References _BLNKSEP, DT_DBLE, FENLTYPI, l_convert(), MBN, MD, RNLERROR, stat, and TONICV.

Referenced by nex_data().

Here is the call graph for this function:

static int g_octhex ( int  _Ty,
unit _Cu,
struct Echoinfo _Ec,
struct Inpinfo _Ip,
long *  _Lv,
int  _Base 
) [static]

Definition at line 2036 of file rnly.c.

References _MASKS, c, CMNTLGET, DT_CMPLX, DT_DBLE, FENICVIC, FENLTYPI, Inpinfo::incnt, Inpinfo::inptr, ISSPTB, LGET, MATCH, MRNLSEP, NULL, OCTAL, RNLERROR, and stat.

Referenced by nex_data().

static int get_holl ( char  _Ho,
int  _Cn,
int  _Ty,
unit _Cu,
struct Echoinfo _Ec,
struct Inpinfo _Ip,
long *  _Lv 
) [static]

Definition at line 1805 of file rnly.c.

References BLANK, c, DT_CHAR, DT_CMPLX, DT_DBLE, FENLIOER, FENLTYPI, Inpinfo::incnt, LGET, NULLC, RNLERROR, and stat.

Referenced by nex_data().

static int get_quoholl ( char  _Cd,
int  _Ty,
unit _Cu,
struct Echoinfo _Ec,
struct Inpinfo _Ip,
long *  _Lv 
) [static]

Definition at line 1896 of file rnly.c.

References BLANK, c, DT_CHAR, DT_CMPLX, DT_DBLE, FENLIOER, FENLTYPI, Inpinfo::incnt, Inpinfo::inptr, LGET, NULLC, RNLERROR, and stat.

Referenced by nex_data().

static int isholl ( long *  _Hp,
struct Inpinfo _Ip 
) [static]

Definition at line 2188 of file rnly.c.

References _MASKS, Inpinfo::inbuff, Inpinfo::inptr, ISSPTB, MATCH, MRNLREP, and MRNLSEP.

Referenced by RNL().

static int l_convert ( long *  _Val,
int  _Ty,
long  _Stat 
) [static]

Definition at line 1494 of file rnly.c.

References _TYP_CONV, DT_DBLE, DT_INT, DT_LOG, DT_REAL, DT_SINT, f, if(), NV32I, NV64I, NVDOUB, NVREAL, RNL_ERROR, and val.

Referenced by g_complx(), and g_number().

Here is the call graph for this function:

static Nlentry * n_findn ( char *  _Key,
Nlentry _List 
) [static]

Definition at line 544 of file rnly.c.

References NULL, and Nlentry::varname.

Referenced by RNL().

static int n_getn ( char *  _S,
char *  _Lc,
unit _Cu,
struct Echoinfo _Ec,
struct Inpinfo _Ip 
) [static]

Definition at line 492 of file rnly.c.

References _MASKS, c, CMNTLGET, FENLLONG, ISSPTB, MATCH, MAXNAML, MRNLDELIM, MRNLREP, RNLERROR, and s.

Referenced by RNL().

static int n_getv ( Nlentry _Nlent,
char *  _Lc,
Namelist _Nlbase,
unit _Cu,
struct Echoinfo _Ec,
struct Inpinfo _Ip 
) [static]
static int n_indx ( int *  _Of,
Nlentry _Nlent,
Namelist _Nlbase,
unit _Cu,
struct Echoinfo _Ec,
struct Inpinfo _Ip 
) [static]
static int nex_data ( int  _Ty,
long  _Pt,
int  _Cn,
int  _In,
char  _La,
unit _Cu,
struct Echoinfo _Ec,
struct Inpinfo _Ip,
long *  _Lv,
int *  _Lc,
int  _Sz 
) [static]

Definition at line 1038 of file rnly.c.

References _MASKS, c, CMNTLGET, DT_CHAR, DT_CMPLX, DT_LOG, FALSE, FENLIVCX, FENLIVLG, g_charstr(), g_complx(), g_number(), g_octhex(), get_holl(), get_quoholl(), HEX, Inpinfo::incnt, Inpinfo::inptr, ISSPTB, LGET, MATCH, MRNLCOMM, MRNLDELIM, MRNLREP, MRNLSEP, OCTAL, RNLERROR, stat, and TRUE.

Referenced by nl_read().

Here is the call graph for this function:

static int nl_read ( long  _P,
int  _Cn,
int  _In,
int  _Ty,
char *  _Lc,
unit _Cu,
struct Echoinfo _Ec,
struct Inpinfo _Ip,
int  _Sz 
) [static]

Definition at line 908 of file rnly.c.

References _MASKS, CMNTLGET, DT_CHAR, DT_CMPLX, DT_DBLE, DT_MAX, EOF, FEINTDTY, FENLTOOM, ISSPTB, MATCH, MIN, MRNLSEP, nex_data(), RNL_ERROR, RNLERROR, stat, and unit_s::uend.

Referenced by n_getv().

Here is the call graph for this function:

static void pr_msg ( char *  _Str) [static]

Definition at line 2174 of file rnly.c.

References errfile, fileno(), and write.

Referenced by RNL().

Here is the call graph for this function:

static void to_upper ( char *  _Str) [static]

Definition at line 887 of file rnly.c.

References c.

Referenced by RNL().


Variable Documentation

int zero = 0 [static]

Definition at line 156 of file rnly.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines