mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-13 23:27:12 +00:00
Replaces shadowed "-t <interval>" with "-timer <interval>"
At some point option "-t" was introduced as an abbreviation for "-title" but "-t" was already in use, though undocumented, for overriding the timer interval. This commit changes the command line timer option to "-timer" and adds "timer" to the options that are processed from the X11 resources.
This commit is contained in:
parent
b13a35e16e
commit
66721ccc1c
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user