summaryrefslogtreecommitdiff
path: root/gpsmon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-03-06 13:07:43 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-03-06 13:07:43 +0000
commitb00632ab81f8532200a69f79fbb9b369ae3302ad (patch)
treeaaf5556888672e3e30bb9b81b2811c68edad5cd4 /gpsmon.c
parentfa63e809a527cbfb13ab8e0fe9a08543e508c261 (diff)
downloadgpsd-b00632ab81f8532200a69f79fbb9b369ae3302ad.tar.gz
Simplify the way ALLOW_RECONFIGURE works.
It now conditions out the speed-switcher, mode-switcher, and rate-switcher methods of the driver structure entirely. This makes it possible to condition out whole functions (rather than small bits that do device writes) almost everywhere. Build tested with ALLOW_RECONFIGURE off. This improvement should make the embedded people happy.
Diffstat (limited to 'gpsmon.c')
-rw-r--r--gpsmon.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gpsmon.c b/gpsmon.c
index 35353bff..889b7303 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -403,6 +403,7 @@ int main (int argc, char **argv)
for (active = monitor_objects; *active; active++) {
(void)fputs("i l q ^S ^Q", stdout);
(void)fputc(' ', stdout);
+#ifdef ALLOW_RECONFIGURE
if ((*active)->driver->mode_switcher != NULL)
(void)fputc('n', stdout);
else
@@ -418,6 +419,7 @@ int main (int argc, char **argv)
else
(void)fputc(' ', stdout);
(void)fputc(' ', stdout);
+#endif /* ALLOW_RECONFIGURE */
if ((*active)->driver->control_send != NULL)
(void)fputc('x', stdout);
else
@@ -610,6 +612,7 @@ int main (int argc, char **argv)
}
switch (line[0])
{
+#ifdef ALLOW_RECONFIGURE
case 'c': /* change cycle time */
if (active == NULL)
monitor_complain("No device defined yet");
@@ -637,6 +640,7 @@ int main (int argc, char **argv)
/*@ +sefparams @*/
}
break;
+#endif /* ALLOW_RECONFIGURE */
case 'i': /* start probing for subtype */
if (active == NULL)
@@ -663,6 +667,7 @@ int main (int argc, char **argv)
(void)wprintw(packetwin, ">>> Logging to %s on", logfile);
break;
+#ifdef ALLOW_RECONFIGURE
case 'n': /* change mode */
/* if argument not specified, toggle */
if (strcspn(line, "01") == strlen(line))
@@ -697,10 +702,12 @@ int main (int argc, char **argv)
/*@ +sefparams @*/
}
break;
+#endif /* ALLOW_RECONFIGURE */
case 'q': /* quit */
goto quit;
+#ifdef ALLOW_RECONFIGURE
case 's': /* change speed */
if (active == NULL)
monitor_complain("No device defined yet");
@@ -769,6 +776,7 @@ int main (int argc, char **argv)
/*@ +sefparams @*/
}
break;
+#endif /* ALLOW_RECONFIGURE */
case 't': /* force device type */
if (strlen(arg) > 0) {