ING_DB
This commit is contained in:
parent
631f23d526
commit
c8487f2592
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
** --- RC_CMAP.C ------- CHARACTER TYPE MAP ---------------------------------
|
||||
**
|
||||
** Version: @(#)rc_cmap.c 4.0 02/05/89
|
||||
**
|
||||
*/
|
||||
|
||||
# include "rc.h"
|
||||
|
||||
|
||||
char Cmap[] =
|
||||
{
|
||||
CNTRL, CNTRL, CNTRL, CNTRL, /* \0 ^A ^B ^C */
|
||||
CNTRL, CNTRL, CNTRL, CNTRL, /* ^D ^E ^F ^G */
|
||||
CNTRL, PUNCT, PUNCT, CNTRL, /* \b \t \n ^K */
|
||||
CNTRL, PUNCT, CNTRL, CNTRL, /* ^L \r ^N ^O */
|
||||
CNTRL, CNTRL, CNTRL, CNTRL, /* ^P ^Q ^R ^S */
|
||||
CNTRL, CNTRL, CNTRL, CNTRL, /* ^T ^U ^V ^W */
|
||||
CNTRL, CNTRL, CNTRL, CNTRL, /* ^X ^Y ^Z ^[ */
|
||||
CNTRL, CNTRL, CNTRL, CNTRL, /* ^\ ^] ^^ ^_ */
|
||||
PUNCT, OPATR, OPATR, OPATR, /* ! " # */
|
||||
OPATR, OPATR, OPATR, OPATR, /* $ % & ' */
|
||||
OPATR, OPATR, OPATR, OPATR, /* ( ) * + */
|
||||
OPATR, OPATR, OPATR, OPATR, /* , - . / */
|
||||
NUMBR, NUMBR, NUMBR, NUMBR, /* 0 1 2 3 */
|
||||
NUMBR, NUMBR, NUMBR, NUMBR, /* 4 5 6 7 */
|
||||
NUMBR, NUMBR, OPATR, OPATR, /* 8 9 : ; */
|
||||
OPATR, OPATR, OPATR, OPATR, /* < = > ? */
|
||||
OPATR, ALPHA, ALPHA, ALPHA, /* @ A B C */
|
||||
ALPHA, ALPHA, ALPHA, ALPHA, /* D E F G */
|
||||
ALPHA, ALPHA, ALPHA, ALPHA, /* H I J K */
|
||||
ALPHA, ALPHA, ALPHA, ALPHA, /* L M N O */
|
||||
ALPHA, ALPHA, ALPHA, ALPHA, /* P Q R S */
|
||||
ALPHA, ALPHA, ALPHA, ALPHA, /* T U V W */
|
||||
ALPHA, ALPHA, ALPHA, OPATR, /* X Y Z [ */
|
||||
OPATR, OPATR, OPATR, ALPHA, /* \ ] ^ _ */
|
||||
OPATR, ALPHA, ALPHA, ALPHA, /* ` a b c */
|
||||
ALPHA, ALPHA, ALPHA, ALPHA, /* d e f g */
|
||||
ALPHA, ALPHA, ALPHA, ALPHA, /* h i j k */
|
||||
ALPHA, ALPHA, ALPHA, ALPHA, /* l m n o */
|
||||
ALPHA, ALPHA, ALPHA, ALPHA, /* p q r s */
|
||||
ALPHA, ALPHA, ALPHA, ALPHA, /* t u v w */
|
||||
ALPHA, ALPHA, ALPHA, OPATR, /* x y z { */
|
||||
OPATR, OPATR, OPATR, CNTRL, /* | } ~ del */
|
||||
0
|
||||
};
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
** --- RG_CASE.C ------- CASE PROCESSOR -------------------------------------
|
||||
**
|
||||
** Version: @(#)rg_case.c 4.0 02/05/89
|
||||
**
|
||||
*/
|
||||
|
||||
# include "rg_int.h"
|
||||
|
||||
|
||||
/* | | */
|
||||
/* |r-code| */
|
||||
/* |======| */
|
||||
/* |prVAR | entry: R_rc points to &jumptable */
|
||||
/* | var# | (& = R-CODE offset) */
|
||||
/* |------| */
|
||||
/* |rcCASE| R_val = case# */
|
||||
/* |------| */
|
||||
/* |case# | exit: pointer to R-CODE after case */
|
||||
/* |------| */
|
||||
/* |&jmptb| values after statment number */
|
||||
/* |======| +-+ +-+ +-+ +-+ +-+ +-+ */
|
||||
/* |case 1| |1| |2| |3| |4| |5| |6| */
|
||||
/* |RETURN| +-+ +-+ +-+ +-+ +-+ +-+ */
|
||||
/* |------| */
|
||||
/* | .. | */
|
||||
/* |------| */
|
||||
/* |case i|<-------------------------R_rc */
|
||||
/* |RETURN| */
|
||||
/* |------| */
|
||||
/* | .. | */
|
||||
/* |------| */
|
||||
/* |case n| */
|
||||
/* |RETURN| */
|
||||
/* |------| [rc]---+ */
|
||||
/* | out | | */
|
||||
/* |RETURN| | */
|
||||
/* |======| | */
|
||||
/*-|&case1|<-R_rc<-R_rc<-R_rc<--+-----jt */
|
||||
/*j|------| =jt =jt =jt | */
|
||||
/*u| .. | =rc =rc | */
|
||||
/*m|------| =df | */
|
||||
/*p|&casei|<--------------rc<---rc RC_WORD */
|
||||
/*t|------| | (rc+=sizeof (short)) */
|
||||
/*a| .. |<--------------------+-----rc */
|
||||
/*b|------| | */
|
||||
/*l|&casen| if rc out of range->| */
|
||||
/*e|------| | */
|
||||
/*-| &out |<--------df<---df<---df<---df */
|
||||
/* |======| =[rc] */
|
||||
/* | next |<--------------------+---------return */
|
||||
/* | | */
|
||||
|
||||
|
||||
char *rg_case()
|
||||
{
|
||||
register char *rc; /* R-CODE pointer */
|
||||
register char *jt; /* pointer to case jump table */
|
||||
register char *df; /* pointer to default (out) case */
|
||||
register union anytype *any;
|
||||
|
||||
/*1*/ df = R_rc;
|
||||
rc = df;
|
||||
jt = rc;
|
||||
|
||||
/*2*/ df += sizeof (short) * R_val;
|
||||
|
||||
any = &Print->sy_val;
|
||||
/*3*/ rc += sizeof (short) * (int) any->f8type;
|
||||
|
||||
if (rc < jt || rc > df)
|
||||
/*4*/ rc = df;
|
||||
|
||||
RC_WORD;
|
||||
/*5*/ R_rc = R_word + jt; /* first read offset, and then update !!! */
|
||||
|
||||
/*6*/ return (df + sizeof (short));
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
** --- RG_COL.C -------- COLUMN PROCESSOR -----------------------------------
|
||||
**
|
||||
** Version: @(#)rg_col.c 4.0 02/05/89
|
||||
**
|
||||
*/
|
||||
|
||||
# include "rg.h"
|
||||
|
||||
|
||||
set_col(col)
|
||||
register int col;
|
||||
{
|
||||
register int len;
|
||||
extern char *AApad();
|
||||
|
||||
if (--col < 0)
|
||||
return;
|
||||
|
||||
if ((len = Col_begin + col - SYS_col) < 0)
|
||||
{
|
||||
if (RUNline)
|
||||
goto ign_col;
|
||||
new_line();
|
||||
if (RUN)
|
||||
{
|
||||
ign_col:
|
||||
RUN++;
|
||||
return;
|
||||
}
|
||||
len = Col_begin - Line + col;
|
||||
}
|
||||
if (len)
|
||||
SYS_col = AApad(SYS_col, len);
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
** --- RG_FILE.H ------- FILE DESCRIPTIONS ----------------------------------
|
||||
**
|
||||
** Version: @(#)rg_file.h 4.0 02/05/89
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
# include "rg.h"
|
||||
|
||||
# undef FILEMODE
|
||||
# define FILEMODE 0644
|
||||
|
||||
struct rg_file
|
||||
{
|
||||
char rf_file; /* logical file description */
|
||||
/* see above */
|
||||
BOOL rf_open; /* file really open ? */
|
||||
int rf_fd; /* the file descriptor,if open */
|
||||
char *rf_name; /* the BS file name */
|
||||
int rf_type; /* type for open, read/write */
|
||||
};
|
||||
typedef struct rg_file FILETYPE;
|
||||
|
||||
extern FILETYPE Rg_file[];
|
||||
|
||||
|
||||
/* logical file descriptions */
|
||||
# define F_TUPLE 1 /* the tupel file */
|
||||
# define F_R_CODE 2 /* the R-CODE file */
|
||||
# define F_DESC 3 /* the tupel description */
|
||||
# define F_REPORT 4 /* the report file */
|
||||
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
** --- RG_INIT.C ------- INIT PROCEDURES ------------------------------------
|
||||
**
|
||||
** Version: @(#)rg_init.c 4.0 02/05/89
|
||||
**
|
||||
*/
|
||||
|
||||
# include "rg.h"
|
||||
|
||||
|
||||
struct init_t
|
||||
{
|
||||
int ip_low;
|
||||
int ip_high;
|
||||
int ip_default;
|
||||
char *ip_error;
|
||||
};
|
||||
|
||||
static struct init_t Initialize[] =
|
||||
{
|
||||
/* -----------------------------------------------
|
||||
** low high default error
|
||||
** ----------------------------------------------- */
|
||||
1, 512, D_COLS, "COLUMNS",
|
||||
1, 512, D_LINES, "LINES",
|
||||
1, 512, D_ALL_LINES, "ALL LINES",
|
||||
MIN_I2, MAX_I2, D_FOR_ALL, "FOR ALL END",
|
||||
D_FIRST_PAGE, MAX_I2, D_FIRST_PAGE, "FIRST PAGE",
|
||||
D_FIRST_PAGE, MAX_I2, D_LAST_PAGE, "LAST PAGE",
|
||||
D_FROM_TUPLE, MAX_I2, D_FROM_TUPLE, "FROM TUPLE",
|
||||
D_FROM_TUPLE, MAX_I2, D_TO_TUPLE, "TO TUPLE",
|
||||
/* ----------------------------------------------- */
|
||||
0, 0, 0, (char *) 0,
|
||||
};
|
||||
|
||||
|
||||
rg_init()
|
||||
{
|
||||
register struct init_t *i;
|
||||
register int *ip; /* param to check */
|
||||
register char *msg; /* error message */
|
||||
|
||||
/* go through R-CODE header, beginning with R_cols */
|
||||
ip = &R_cols;
|
||||
|
||||
/* initialize parameters */
|
||||
for (i = Initialize; i->ip_error; i++)
|
||||
{
|
||||
msg = (char *) 0;
|
||||
if (*ip < i->ip_low)
|
||||
msg = "SMALL";
|
||||
else if (*ip > i->ip_high)
|
||||
msg = "HIGH";
|
||||
if (msg)
|
||||
{
|
||||
rg_error("parameter %s = `%d' is too %s\n\tSET to `%d'",
|
||||
i->ip_error, *ip, msg, i->ip_default);
|
||||
*ip = i->ip_default;
|
||||
}
|
||||
ip++;
|
||||
}
|
||||
|
||||
if (R_first_page > R_last_page)
|
||||
/* nothing to print */
|
||||
rg_exit(EXIT_END);
|
||||
|
||||
/* adjust R_all_lines */
|
||||
if (*(ip = &R_all_lines) < R_lines)
|
||||
*ip *= R_lines / *ip + 1;
|
||||
|
||||
/* rest of initialization, see rg.c */
|
||||
R_rc = &R_code[1];
|
||||
Line_end = R_lines;
|
||||
Col_end = &Line[R_cols];
|
||||
}
|
||||
|
||||
|
||||
ck_arg(a, i, c)
|
||||
register char *a; /* the ASCII string */
|
||||
/*register*/ int *i; /* holds the integer result */
|
||||
int *c; /* error count */
|
||||
{
|
||||
register int err;
|
||||
short ix;
|
||||
extern int AA_atoi();
|
||||
|
||||
err = AA_atoi(a, &ix);
|
||||
*i = ix;
|
||||
if (err)
|
||||
{
|
||||
if (err < 0)
|
||||
rg_error("%d: VALUE `%s' not numeric", *c, a);
|
||||
else
|
||||
rg_error("%d: VALUE `%s' out of range", *c, a);
|
||||
(*c)++;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
** --- RG_INT.H -------- INTERPRETER DECLARATIONS ---------------------------
|
||||
**
|
||||
** Version: @(#)rg_int.h 4.0 02/05/89
|
||||
**
|
||||
*/
|
||||
|
||||
# include "rg.h"
|
||||
|
||||
# define MAX_STACK 50
|
||||
|
||||
struct symbol
|
||||
{
|
||||
char sy_frmt; /* format */
|
||||
char sy_frml; /* length */
|
||||
union anytype sy_val; /* value */
|
||||
};
|
||||
typedef struct symbol SYMBOL;
|
||||
|
||||
extern struct symbol Stack[];
|
||||
extern struct symbol *Print;
|
||||
extern char *rc_word();
|
||||
|
||||
/* inline procedure to read R-CODE */
|
||||
# define RC_BYTE ((short) ctou(*rc++))
|
||||
# define RC_WORD rc = rc_word(rc)
|
||||
|
||||
# define RANGE(l, x, h) ((x) >= ((int) (l)) && (x) <= ((int) (h)))
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
** --- RG_REPT.C ------- REPEAT PROCESSOR -----------------------------------
|
||||
**
|
||||
** Version: @(#)rg_rept.c 4.0 02/05/89
|
||||
**
|
||||
*/
|
||||
|
||||
# include "rg.h"
|
||||
|
||||
/* the repeat table */
|
||||
static REPEATYPE R_repeat[MAX_REPEAT]; /* rr_code = (char *) 0 */
|
||||
/* rr_count = 0 */
|
||||
|
||||
|
||||
rg_repeat(rc)
|
||||
register char *rc;
|
||||
{
|
||||
register REPEATYPE *r;
|
||||
register int i;
|
||||
|
||||
for (r = R_repeat; r->rr_count; r++)
|
||||
{
|
||||
if (r == &R_repeat[MAX_REPEAT])
|
||||
{
|
||||
rg_error("REPEAT TABLE OVERFLOW");
|
||||
rg_exit(EXIT_R_CODE);
|
||||
}
|
||||
if (r->rr_code == rc)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!r->rr_code)
|
||||
{
|
||||
r->rr_code = rc;
|
||||
if ((i = R_val) < A_REPEAT)
|
||||
i = A_REPEAT;
|
||||
r->rr_count = i;
|
||||
}
|
||||
|
||||
if (--(r->rr_count))
|
||||
return (TRUE);
|
||||
r->rr_code = 0;
|
||||
return (FALSE);
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
** --- RG_TIME.C ------- GET AND PRINT TIME ---------------------------------
|
||||
**
|
||||
** Version: @(#)rg_time.c 4.0 02/05/89
|
||||
**
|
||||
*/
|
||||
|
||||
# include "rg.h"
|
||||
|
||||
|
||||
extern long time();
|
||||
static long rg_time;
|
||||
extern char *ctime();
|
||||
static char *rg_ctime;
|
||||
extern int *localtime();
|
||||
static int *rg_localtime;
|
||||
|
||||
|
||||
rg_prtime(tflag)
|
||||
register int tflag;
|
||||
/* tflag == FALSE: DATE */
|
||||
/* TRUE: TIME */
|
||||
{
|
||||
register char *t;
|
||||
register char *p;
|
||||
extern char *AAbmove();
|
||||
|
||||
if (!rg_time)
|
||||
{
|
||||
time(&rg_time);
|
||||
# ifdef ESER_VMX
|
||||
rg_ctime = ctime(rg_time);
|
||||
rg_localtime = localtime(rg_time);
|
||||
# else
|
||||
rg_ctime = ctime(&rg_time);
|
||||
rg_localtime = localtime(&rg_time);
|
||||
# endif
|
||||
}
|
||||
t = rg_ctime;
|
||||
p = SYS_col;
|
||||
|
||||
if (tflag)
|
||||
SYS_col = AAbmove(&t[11], p, 8);
|
||||
else
|
||||
{
|
||||
p = AAbmove(&t[8], p, 2);
|
||||
*p++ = '-';
|
||||
p = AAbmove(&t[4], p, 3);
|
||||
*p++ = '-';
|
||||
SYS_col = AAbmove(&t[22], p, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
rg_getime(which)
|
||||
/*----------------------------------------------*/
|
||||
register int which;
|
||||
/*----------------------------------------------*/
|
||||
/* SECOND == 0 */
|
||||
/* MINUTE == 1 */
|
||||
/* HOUR == 2 */
|
||||
/* M_DAY == 3 month day */
|
||||
/* MONTH == 4 */
|
||||
/* YEAR == 5 */
|
||||
/* W_DAY == 6 week day */
|
||||
/* Y_DAY == 7 year day */
|
||||
/* IS_DST == 8 day light saving flag */
|
||||
/*----------------------------------------------*/
|
||||
{
|
||||
if (!rg_time)
|
||||
{
|
||||
time(&rg_time);
|
||||
# ifdef ESER_VMX
|
||||
rg_ctime = ctime(rg_time);
|
||||
rg_localtime = localtime(rg_time);
|
||||
# else
|
||||
rg_ctime = ctime(&rg_time);
|
||||
rg_localtime = localtime(&rg_time);
|
||||
# endif
|
||||
}
|
||||
return (rg_localtime[which]);
|
||||
}
|
||||
Loading…
Reference in New Issue