Commit 200d5f80 authored by John P. Willis's avatar John P. Willis
Browse files

Begin work on dialects

parent c973887d
Pipeline #758 passed with stage
in 1 minute and 30 seconds
......@@ -5939,12 +5939,15 @@ errexfun:
/* $ZNAME */
case 'N':
/*
i = 0;
while ((a[i] = rou_name[i]) != EOL) {
if (rou_name[i] == '.') break;
i++;
}
a[i] = EOL;
*/
stcpy (a, rou_name);
goto exec;
......
......@@ -495,6 +495,7 @@ char pgms[MAXNO_OF_RBUF][40]; /* names of alt.pgms */
long ages[MAXNO_OF_RBUF]; /* last call to this pgm */
char *ends[MAXNO_OF_RBUF]; /* saved rouend-pointer */
char path[MAXNO_OF_RBUF][256]; /* directory where routine was loaded */
rtn_flags rbuf_flags[MAXNO_OF_RBUF]; /* per-routine flags */
char glopath[PATHLEN]; /* path to access globals */
char rou0path[PATHLEN]; /* routine access with DO,GOTO,JOB */
......
......@@ -426,6 +426,8 @@ void init_readline (void)
void init_execution_context (void)
{
register int i;
ierr = OK;
codptr = code;
......@@ -434,6 +436,10 @@ void init_execution_context (void)
if (partition == NULL) exit (2); /* could not allocate stuff... */
for (i = 0; i < MAXNO_OF_RBUF; i++) {
rbuf_flags[i].standard = standard;
}
symlen = PSIZE;
s = &partition[PSIZE] - 256; /* pointer to symlen_offset */
argptr = partition; /* pointer to beg of tmp-storage */
......
......@@ -299,7 +299,7 @@ extern char pgms[MAXNO_OF_RBUF + 1][40]; /* names of alt.pgms */
extern long ages[]; /* last call to this pgm */
extern char *ends[]; /* saved rouend-pointer */
extern char path[MAXNO_OF_RBUF][256]; /* directory where routine was loaded */
extern rtn_flags rbuf_flags[MAXNO_OF_RBUF]; /* per-routine flags */
extern char glopath[PATHLEN]; /* path to access globals */
extern char rou0path[PATHLEN]; /* routine access with DO,GOTO,JOB */
extern char rou1path[PATHLEN]; /* routine access with ZL,ZS */
......
......@@ -529,5 +529,9 @@ void v25 ();
void m_tolower ();
void part_ref (struct vtstyp *scr, short from, short to);
/* per-routine flags */
typedef struct rtn_flags {
short standard;
} rtn_flags;
/* End of $Source: /cvsroot-fuse/gump/FreeM/src/mpsdef0.h,v $ */
......@@ -187,6 +187,8 @@ extern int read_history ();
#define THROW 25
void on_frame_entry(void);
void rbuf_dump(void);
short rbuf_slot_from_name(char *);
/*
* xecline():
......@@ -392,12 +394,16 @@ next0:
dir_words[dir_wc][dir_pos] = NUL;
if(strcmp(dir_words[0], "MODE") == 0) {
if(strcmp(dir_words[1], "STRICT") == 0) {
strict_mode = 1;
if(strcmp(dir_words[0], "DIALECT") == 0) {
short rb_slot;
rb_slot = rbuf_slot_from_name (rou_name);
if(strcmp(dir_words[1], "STANDARD") == 0) {
rbuf_flags[rb_slot].standard = TRUE;
}
else if(strcmp(dir_words[1], "LEGACY") == 0) {
strict_mode = 0;
else if(strcmp(dir_words[1], "EXTENDED") == 0) {
rbuf_flags[rb_slot].standard = FALSE;
}
else {
ierr = CMMND;
......@@ -7721,6 +7727,9 @@ restore:
stcpy (code, "DO ^%ZHELP\201");
}
else if (strcmp (fmrl_buf, "rbuf") == 0) {
rbuf_dump();
}
else if (strcmp (fmrl_buf, "jobtab") == 0) {
job_dump ();
}
......@@ -7930,3 +7939,73 @@ void on_frame_entry(void)
strcpy (merr_stack[nstx].PLACE, (pb + 4));
}
void rbuf_dump(void)
{
register int i;
char rnam[256];
char rpth[256];
char ldtime[80];
char flgs[80];
time_t ag;
struct tm tld;
printf ("ROUTINE BUFFER CONFIGURATION\r\n");
printf (" NO_OF_RBUF: %d\r\n", NO_OF_RBUF);
printf (" MAXNO_OF_RBUF: %d\r\n\r\n", MAXNO_OF_RBUF);
printf ("BUFFERS IN USE:\r\n");
for (i = 0; i < NO_OF_RBUF; i++) {
sprintf (flgs, "");
if (ages[i] == 0) {
sprintf (rnam, "---------");
sprintf (rpth, "[buffer empty]");
sprintf (ldtime, "n/a");
sprintf (flgs, "n/a");
}
else {
stcpy (rnam, pgms[i]);
stcnv_m2c (rnam);
stcpy (rpth, path[i]);
stcnv_m2c (rpth);
ag = ages[i];
tld = *localtime (&ag);
strftime (ldtime, 80, "%a %Y-%m-%d %H:%M:%S %Z", &tld);
if (rbuf_flags[i].standard == TRUE) {
strcat (flgs, "STANDARD");
}
else {
strcat (flgs, "EXTENDED");
}
}
if (ages[i] != 0) {
printf ("#%d [ROUTINE '%s']\r\n", i, rnam);
printf (" FS LOAD PATH: %s\r\n", rpth);
printf (" LAST ACCESS: %s\r\n", ldtime);
printf (" DIALECT: %s\r\n\r\n", flgs);
}
}
}
short rbuf_slot_from_name(char *rnam)
{
register short i;
for (i = 0; i < NO_OF_RBUF; i++) {
if (stcmp (rnam, pgms[i]) == 0) {
return i;
}
}
return -1;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment