1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-20 09:45:13 +00:00

Merge pull request #520 from Interlisp/nhb-shadowed-timer-option

Replaces shadowed "-t <interval>" with "-timer <interval>"
This commit is contained in:
Nick Briggs 2024-12-17 11:22:20 -08:00 committed by GitHub
commit e6c972a62a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 4 deletions

View File

@ -407,20 +407,20 @@ int main(int argc, char *argv[])
}
}
/* -t and -m are undocumented and somewhat dangerous... */
/* -timer and -m are undocumented and somewhat dangerous... */
else if (!strcmp(argv[i], "-t")) { /**** timer interval ****/
else if (!strcmp(argv[i], "-timer")) { /**** timer interval ****/
if (argc > ++i) {
errno = 0;
tmpint = strtol(argv[i], (char **)NULL, 10);
if (errno == 0 && tmpint > 0) {
TIMER_INTERVAL = tmpint;
} else {
(void)fprintf(stderr, "Bad value for -t (integer > 0)\n");
(void)fprintf(stderr, "Bad value for -timer (integer > 0)\n");
exit(1);
}
} else {
(void)fprintf(stderr, "Missing argument after -t\n");
(void)fprintf(stderr, "Missing argument after -timer\n");
exit(1);
}
}

View File

@ -36,6 +36,7 @@ extern int LispDisplayRequestedX, LispDisplayRequestedY;
extern unsigned LispDisplayRequestedWidth, LispDisplayRequestedHeight;
extern int xsync;
extern int TIMER_INTERVAL;
static XrmOptionDescRec opTable[] = {
{"-help", "*help", XrmoptionIsArg, (XPointer)NULL},
@ -297,6 +298,14 @@ void read_Xoption(int *argc, char *argv[])
noscroll = 1;
}
if (XrmGetResource(rDB, "ldex.timer", "Ldex.timer", str_type, &value) == True) {
(void)strncpy(tmp, value.addr, value.size);
errno = 0;
i = (int)strtol(tmp, (char **)NULL, 10);
if (errno == 0 && i > 0)
TIMER_INTERVAL = i;
}
/* if (XrmGetResource(rDB,
"ldex.maxpages",
"Ldex.maxpages",