Commit 8614b310 authored by John P. Willis's avatar John P. Willis
Browse files

Change ZMXSTR errors to standard M75 errors

parent c4ac333c
Pipeline #715 passed with stage
in 1 minute and 22 seconds
......@@ -60,29 +60,42 @@ COPYRIGHT ;
W "This is free software: you are free to change and redistribute it.",!
W "There is NO WARRANTY, to the extent permitted by law.",!,!
Q
limits ;
LIMITS ;
N MWAPI S MWAPI="<<DISABLED>>"
S:^$SYSTEM("MWAPI") MWAPI=^$DISPLAY($PDISPLAY,"PLATFORM")
W !,$ZVERSION," - System Limits",!!
W " MAX NAME LENGTH: ",^$SYSTEM("NAME_LENGTH"),!
W " MAX NODE LENGTH: ",^$SYSTEM("STRING_MAX"),!
W " MWAPI SUPPORT: ",MWAPI,!
I MWAPI'="<<DISABLED>>" THEN D
. W " DISPLAY: ",$PDISPLAY,!
. W " RESOLUTION: ",^$DISPLAY($PDISPLAY,"SIZE"),!
. W " COLOR SPECTRUM: ",^$DISPLAY($PDISPLAY,"SPECTRUM"),!
. W " COLOR TYPE: ",^$DISPLAY($PDISPLAY,"COLORTYPE"),!
. W " SCREEN UNITS: ",^$DISPLAY($PDISPLAY,"UNITS"),!
Q
info ;
G INFO
Q
INFO ;
W $ZVERSION," (Namespace ",^$JOB($JOB,"NAMESPACE"),")",!,!
W " Intrinsic Z-Commands: '",$V(17),"'",!
W " Intrinsic Z-Functions: '",$V(18),"'",!
W " Intrinsic Special Variables: '",$V(19),"'",!
W " Break Service Code: '",$V(20),"'",!
W " Last Referenced Global: '",$REFERENCE,"'",!
W " Size of Last Global: '",$V(21),"'",!
W " Number of V22 Aliases: '",$V(22),"'",!
W " Maximum Terminal Size: '",$V(25),"x",$V(24),"'",!
W " FreeM Arguments: '",$V(30),"'",!
W " Maximum Routine Size: '",$V(32),"'",!
W " Number of Routine Buffers: '",$V(33),"'",!
W " Maximum Concurrently-Open Globals: '",$V(35),"'",!
W " Maximum Concurrently-Open I/O Channels: '",$V(36),"'",!
W " Maximum Size of Local Symbol Table: '",$V(37),"'",!
W " Maximum Size of User-Defined Special Variable Table: '",$V(39),"'",!
W " Maximum Size of DO/XECUTE/FOR/BREAK Stack: '",$V(41),"'",!
W " Maximum Expression Stack Depth: '",$V(42),"'",!
W " Maximum Number of Patterns: '",$V(43),"'",!,!
N NS S NS=^$JOB($JOB,"NAMESPACE")
W $ZVERSION," (Namespace ",^$JOB($JOB,"NAMESPACE"),")",!,!
W "USER-DEFINED LANGUAGE ELEMENTS:",!
W " Intrinsic Z-Commands: ",!
W " Intrinsic Z-Functions: ",!
W " Intrinsic Special Variables: ",!!
W "EVENT MANAGEMENT:",!
W " BREAK Service Code: '",!!
W "GLOBAL DATABASE:",!
W " Global Handler: ","[",NS,"] ",?65,^$JOB($JOB,"ENGINES","GLOBAL",NS),!
S NS="SYSTEM"
W " -> ","[",NS,"] ",?65,^$JOB($JOB,"ENGINES","GLOBAL",NS),!
W " Last Referenced Global: ",$REFERENCE,!
W " Characters in Unique Name: ",^$JOB($JOB,"GVN_UNIQUE_CHARS"),!
W " Case Sensitivity: ",^$JOB($JOB,"GVN_CASE_SENSITIVE"),!
W " Max Length (Global Name + Subscripts): ",^$JOB($JOB,"GVN_NAME_SUB_LENGTH"),!
W " Max Length (Each Subscript): ",^$JOB($JOB,"GVN_SUB_LENGTH"),!
Q
jobs ;
G JOBS
......
......@@ -254,7 +254,7 @@ char errmes[MAXERR][ERRLEN] = {
" \201",
" \201",
" \201",
" \201",
"string length exceeds implementation limits\201", /* 214 - M75 */
" \201",
" \201",
" \201",
......
......@@ -1590,7 +1590,7 @@ uparrow:
if (f >= STRLEN) {
a[f] = EOL;
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -1956,7 +1956,7 @@ f20:
if (l > STRLEN) {
/* $J() width string too long */
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -1971,7 +1971,7 @@ f20:
if (f > (STRLEN - 2)) {
/* $J() .precision too long */
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -2019,7 +2019,7 @@ f20:
if (j - i > f) { /* rounding required */
if ((l1 = f + i + 1) > STRLEN) {
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -2079,7 +2079,7 @@ f20:
else { /* rounding not required */
if (f + i + 1 > STRLEN) {
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -2579,7 +2579,7 @@ f20:
}
if (f > STRLEN) {
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -2683,7 +2683,7 @@ f20:
else {
if (f + i > STRLEN) {
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -2721,7 +2721,7 @@ f20:
while ((tmp[j++] = a[i]) != EOL) {
if (j >= STRLEN) {
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -6855,7 +6855,7 @@ plus02:
if (stcat (a, b)) goto next05;
ierr = MXSTR;
ierr = M75;
return;
......@@ -8328,7 +8328,7 @@ void zkey (char *a, long type)
}
if (n0 > STRLEN) {
ierr = MXSTR;
ierr = M75;
return;
} /* string too long */
......@@ -8378,7 +8378,7 @@ void zkey (char *a, long type)
while ((ct0[n0++] = prod_rule[pos++]) != del1) {
if (n1 > STRLEN) {
ierr = MXSTR;
ierr = M75;
return;
} /* string too long */
......@@ -8405,7 +8405,7 @@ void zkey (char *a, long type)
}
if (n0 + n1 > STRLEN) {
ierr = MXSTR;
ierr = M75;
return;
} /* string too long */
......
......@@ -323,7 +323,7 @@ void global_bltin (short action, char *key, char *data)
if ((i = glvnflag.one[2])) {
if (stlen (key) > i) {
ierr = MXSTR;
ierr = M75;
return;
} /* key length limit */
......@@ -345,7 +345,7 @@ void global_bltin (short action, char *key, char *data)
if (k == DELIM || k == EOL) {
if (k > i) {
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -401,7 +401,7 @@ void global_bltin (short action, char *key, char *data)
if ((++i) >= STRLEN) {
zref[255] = EOL;
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -1674,7 +1674,7 @@ s20:
if (j >= 252) {
zref[j] = EOL;
ierr = MXSTR;
ierr = M75;
goto quit;
}
......@@ -1748,7 +1748,7 @@ s20:
if (j >= 252) {
data[j] = EOL1;
ierr = MXSTR;
ierr = M75;
goto quit;
}
......
......@@ -187,6 +187,7 @@ err_lut errtab[] = {
{197, "M58"},
{198, "M59"},
{199, "M60"},
{214, "M75"},
{240, "M101"},
{241, "M102"},
{242, "M103"},
......
......@@ -180,6 +180,7 @@
#define M58 197
#define M59 198
#define M60 199
#define M75 214
#define M101 240
#define M102 241
#define M103 242
......
......@@ -752,7 +752,7 @@ add (a, b) /* string arithmetic a+=b; */
if (i < 0) {
j = lena;
if ((i = (lena -= i)) > (STRLEN - 2) /*was 253*/) {
ierr = MXSTR;
ierr = M75;
return;
}
ch = (sign >= 0 ? ZERO : NINE);
......@@ -764,7 +764,7 @@ add (a, b) /* string arithmetic a+=b; */
} else if (i > 0) {
j = lenb;
if ((lenb = (i += lenb)) > (STRLEN - 2)/*was 253*/) {
ierr = MXSTR;
ierr = M75;
return;
}
ch = (sign <= 0 ? ZERO : NINE);
......@@ -788,7 +788,7 @@ add (a, b) /* string arithmetic a+=b; */
lena++;
if (carry) {
if ((i = (++lena)) > (STRLEN - 2)/*was 253*/) {
ierr = MXSTR;
ierr = M75;
return;
}
while (i > 0) {
......@@ -919,7 +919,7 @@ mul (a, b) /* string arithmetic a=a*b */
if (carry) {
acur = ccur;
if (acur > (STRLEN - 1)/*was 254*/) {
ierr = MXSTR;
ierr = M75;
return;
}
while (acur >= 0) {
......@@ -993,7 +993,7 @@ mul (a, b) /* string arithmetic a=a*b */
carry += ccur;
if (carry > (STRLEN - 3) /*was 252*/) {
a[0] = EOL;
ierr = MXSTR;
ierr = M75;
return;
}
ccur = clen = alen + blen;
......@@ -1328,7 +1328,7 @@ mdiv (uu, v, typ) /* divide string arithmetic */
d += zprecise;
if ((d + ulen) > STRLEN) {
u[0] = EOL;
ierr = MXSTR;
ierr = M75;
return;
}
while (d > 0) {
......@@ -1599,7 +1599,7 @@ power (a, b) /* raise a to the b-th power */
}
if (b[0] == MINUS) {
power (a, &b[1]);
if (ierr == MXSTR) {
if (ierr == M75) {
a[0] = ZERO;
a[1] = EOL;
ierr = OK;
......@@ -2034,7 +2034,7 @@ numlit (str)
i++;
if (i >= (STRLEN - 1)/*was 254*/) {
str[STRLEN] = EOL;
ierr = MXSTR;
ierr = M75;
return (0);
}
str[pointx = i] = POINT;
......@@ -2053,7 +2053,7 @@ numlit (str)
}
if (pointx >= (STRLEN - 1)/*was 254*/) {
str[STRLEN] = EOL;
ierr = MXSTR;
ierr = M75;
return (0);
}
str[pointx] = POINT;
......@@ -2063,7 +2063,7 @@ numlit (str)
i = pointx = 0;
while (str[i++] != EOL) ;
if (i >= (STRLEN - 1)/*was 254*/) {
ierr = MXSTR;
ierr = M75;
return (0);
}
while (i-- > 0)
......@@ -2285,7 +2285,7 @@ m_op (a, b, op)
if (op & 0200)
break; /* NOT_OPERAND */
if (stcat (a, b) == 0) {
ierr = MXSTR;
ierr = M75;
}
return;
case '=':
......
......@@ -143,7 +143,7 @@ void ssvn (short action, char *key, char *data)
if ((ptmp[1] != 'Z') && (ptmp[1] != 'Y')) {
if (find (" C CHARACTER D DEVICE DI DISPLAY E EVENT G GLOBAL J JOB L LOCK P PDISPLAY R ROUTINE S SYSTEM W WINDOW ", ptmp) == FALSE) {
ierr = INVREF;
ierr = M60;
return;
}
......@@ -256,7 +256,7 @@ void ssvn_normalize_key (char *key)
}
ierr = INVREF;
ierr = M60;
return;
}
......@@ -109,6 +109,17 @@ void ssvn_system(short action, char *key, char *data)
ierr = OK;
break;
}
if (strcmp (r->subscripts[0], "MWAPI") == 0) {
#if defined(MWAPI_GTK)
snprintf (data, 511, "1\201");
#else
snprintf (data, 511, "0\201");
#endif
ierr = OK;
break;
}
else if (strcmp (r->subscripts[0], "EVENT") == 0) {
......
......@@ -95,7 +95,7 @@ short int stcat (char dest[], char *source)
while ((dest[i] = *source++) != EOL) {
if (i++ >= STRLEN) {
printf("i = %d\r\n", i);
//printf("i = %d\r\n", i);
dest[--i] = EOL;
return FALSE;
}
......
......@@ -249,7 +249,7 @@ no_with:
if ((i = glvnflag.one[2])) {
if (stlen (key) > i) {
ierr = MXSTR;
ierr = M75;
return;
} /* key length limit */
......@@ -272,7 +272,7 @@ no_with:
if (k1 == DELIM || k1 == EOL) {
if (k > i) {
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -457,7 +457,7 @@ no_with:
/* Old set_sym routine */
/* check whether the key has subscripts or not */
if ((keyl = stlen (key) + 2) > STRLEN) {
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -2544,7 +2544,7 @@ register long int i, j, k, k1;
if ((keyl = stlen (key) + 2) > STRLEN) {
ierr = MXSTR;
ierr = M75;
return;
} /* key length +2 */
......
......@@ -408,7 +408,7 @@ void view_com ()
expr (STRING);
if (j > 0 && j < 15 && stlen (argptr) > MONTH_LEN) {
ierr = MXSTR;
ierr = M75;
}
else if (j > 0 && j < 13) {
stcpy (month[i][j - 1], argptr);
......@@ -558,7 +558,7 @@ void view_com ()
case 96: /* VIEW 96: global prefix */
if (stlen (argptr) > MONTH_LEN) {
ierr = MXSTR;
ierr = M75;
}
else {
stcpy (glo_prefix, argptr);
......@@ -570,7 +570,7 @@ void view_com ()
case 97: /* VIEW 97: global postfix */
if (stlen (argptr) > MONTH_LEN) {
ierr = MXSTR;
ierr = M75;
}
else {
stcpy (glo_ext, argptr);
......@@ -582,7 +582,7 @@ void view_com ()
case 98: /* VIEW 98: routine extension */
if (stlen (argptr) > MONTH_LEN) {
ierr = MXSTR;
ierr = M75;
}
else {
stcpy (rou_ext, argptr);
......@@ -1365,7 +1365,7 @@ void view_fun (int f, char *a) /* process VIEW function */
if (f != i) continue;
if ((f=strlen(m_envp[i - 1])) > STRLEN) {
ierr=MXSTR;
ierr=M75;
return;
}
......@@ -1812,7 +1812,7 @@ void zreplace (char *a, char *b, char *c)
if (b[m] == EOL) {
if (n + l > STRLEN) {
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -1827,7 +1827,7 @@ void zreplace (char *a, char *b, char *c)
m = 1;
if (n + 1 > STRLEN) {
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -1903,7 +1903,7 @@ void zname (char *a, char *b)
if (i >= (STRLEN-2)/*was 253*/) {
a[i] = EOL;
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -1929,7 +1929,7 @@ void zname (char *a, char *b)
a[STRLEN] = EOL;
if (b[j] != EOL) {
ierr = MXSTR;
ierr = M75;
return;
}
......@@ -1940,7 +1940,7 @@ void zname (char *a, char *b)
if (f) {
if (i > (STRLEN-2) /* was 253 */) {
ierr = MXSTR;
ierr = M75;
return;
}
......
......@@ -1612,7 +1612,7 @@ multi:
while (++n < arg3) {
if (stcat (tmp3, tmp2) == 0) {
ierr = MXSTR;
ierr = M75;
goto err;
}
}
......@@ -1653,7 +1653,7 @@ set10:
tmp2[arg3] = EOL;
if (stcat (tmp2, argptr) == 0) {
ierr = MXSTR;
ierr = M75;
goto err;
}
......@@ -1712,7 +1712,7 @@ set10:
if (tmp2[i] == '"') tmp2[++i] = '"';
if (i >= (STRLEN - 2)) {
ierr = MXSTR;
ierr = M75;
break;
}
}
......@@ -1808,7 +1808,7 @@ set10:
}
if (j >= (STRLEN - 1)) {
ierr = MXSTR;
ierr = M75;
break;
}
} /* while ((ch = tmp3[i++]) != EOL) ... */
......@@ -1830,7 +1830,7 @@ set10:
argptr[j++] = ',';
if (j >= STRLEN) {
ierr = MXSTR;
ierr = M75;
break;
}
......@@ -1848,7 +1848,7 @@ set10:
argptr[j] = EOL;
if (j >= STRLEN) {
ierr = MXSTR;
ierr = M75;
break;
}
......@@ -1868,7 +1868,7 @@ set10:
if (arg3 <= 0) arg3 = 1;
if (arg3 > STRLEN) {
ierr = MXSTR;
ierr = M75;
goto err;
}
......@@ -1913,12 +1913,12 @@ set10:
/* compose new value of glvn */
if (stcat (tmp3, argptr) == 0) {
ierr = MXSTR;
ierr = M75;
goto err;
}
if (stcat (tmp3, tmp2) == 0) {
ierr = MXSTR;
ierr = M75;
goto err;
}
......@@ -2184,7 +2184,7 @@ set10:
if ((!stcmp (&vn[2], "t\201")) || (!stcmp (&vn[2], "tr\201")) || (!stcmp (&vn[2], "trap\201"))) { /* set $ztrap */
if (stlen (argptr) > ZTLEN) {
ierr = MXSTR;
ierr = M75;
goto err;
}
......@@ -2248,7 +2248,7 @@ set10:
}
if (stlen (argptr) > FUNLEN) {
ierr = MXSTR;
ierr = M75;
goto err;
}
......@@ -3441,7 +3441,6 @@ do_goto:
if (nstx == 0 && roucur >= rouend) {
roucu0 = rouptr;
goto off1;
}
......@@ -4199,12 +4198,12 @@ off3:
}
if (stcat (tmp, varnam) == 0) {
ierr = MXSTR;
ierr = M75;
goto err;
}
if (stcat (tmp, " \201") == 0) {
ierr = MXSTR;
ierr = M75;
goto err;
}
......@@ -4318,12 +4317,12 @@ off3:
}
if (stcat (tmp, varnam) == 0) {
ierr = MXSTR;
ierr = M75;
goto err;
}
if (stcat (tmp, " \201") == 0) {
ierr = MXSTR;
ierr = M75;
goto err;
}
......@@ -5905,12 +5904,12 @@ zwrite:
}
if (stcat (tmp3, varnam) == 0) {
ierr = MXSTR;