From abb7c5d31235af27b4b3ac620b97a8c5260f26a3 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 1 Apr 2011 04:29:17 -0400 Subject: Regularize some names. --- SConstruct | 4 +- configure.ac | 6 +-- driver_evermore.c | 12 ++--- driver_garmin.c | 32 ++++++------- driver_geostar.c | 16 +++---- driver_italk.c | 8 ++-- driver_navcom.c | 20 ++++---- driver_oncore.c | 12 ++--- driver_proto.c | 16 +++---- driver_sirf.c | 36 +++++++------- driver_superstar2.c | 16 +++---- driver_tsip.c | 16 +++---- driver_ubx.c | 16 +++---- driver_zodiac.c | 16 +++---- drivers.c | 136 ++++++++++++++++++++++++++-------------------------- gpsctl.c | 48 +++++++++---------- gpsd.c | 14 +++--- gpsd.h-tail | 8 ++-- gpsd_json.c | 4 +- gpsmon.c | 36 +++++++------- libgpsd_core.c | 8 ++-- monitor_nmea.c | 12 ++--- monitor_sirf.c | 16 +++---- 23 files changed, 254 insertions(+), 254 deletions(-) diff --git a/SConstruct b/SConstruct index 8719aff1..a55db41a 100644 --- a/SConstruct +++ b/SConstruct @@ -149,10 +149,10 @@ else: dbuslibs = ["dbus"] if not config.CheckLib('libbluez'): - confdefs.append("/* #undef HAVE_BLUEZ */\n\n") + confdefs.append("/* #undef HAVE_LIBBLUEZ */\n\n") bluezlibs = [] else: - confdefs.append("#define HAVE_BLUEZ 1\n\n") + confdefs.append("#define HAVE_LIBBLUEZ 1\n\n") bluezlibs = ["bluez"] sys.stdout.writelines(confdefs) diff --git a/configure.ac b/configure.ac index 14a6d50c..2efd8f3d 100644 --- a/configure.ac +++ b/configure.ac @@ -310,7 +310,7 @@ AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--enable-bluetooth], [Enable support fo AC_MSG_CHECKING([for BlueZ support]) if test x"$ac_bluetooth" = x"yes"; then AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_BLUEZ,1,[Define if we have Bluez]) + AC_DEFINE(HAVE_LIBBLUEZ,1,[Define if we have Bluez]) # Older versions of autotools barf and die on this. #PKG_CHECK_MODULES(BLUEZ, bluez ) BLUEZ_CFLAGS=`pkg-config --cflags bluez` @@ -847,7 +847,7 @@ AC_ARG_ENABLE(reconfigure, AC_MSG_CHECKING([for device reconfiguration is allowed]) if test x"$ac_reconfigure" != "xno"; then AC_MSG_RESULT([$ac_reconfigure]) - AC_DEFINE([ALLOW_RECONFIGURE], 1, [Allow gpsd to reconfigure device]) + AC_DEFINE([RECONFIGURE_ENABLE], 1, [Allow gpsd to reconfigure device]) else AC_MSG_RESULT([no]) fi @@ -859,7 +859,7 @@ AC_ARG_ENABLE(controlsend, AC_MSG_CHECKING([for control sending is allowed]) if test x"$ac_controlsend" != "xno"; then AC_MSG_RESULT([$ac_controlsend]) - AC_DEFINE([ALLOW_CONTROLSEND], 1, [Allow gpsd to controlsend device]) + AC_DEFINE([CONTROLSEND_ENABLE], 1, [Allow gpsd to controlsend device]) else AC_MSG_RESULT([no]) fi diff --git a/driver_evermore.c b/driver_evermore.c index 17fe6317..ad5f703f 100644 --- a/driver_evermore.c +++ b/driver_evermore.c @@ -544,7 +544,7 @@ static void evermore_event_hook(struct gps_device_t *session, event_t event) } } -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static bool evermore_speed(struct gps_device_t *session, speed_t speed, char parity, int stopbits) { @@ -607,7 +607,7 @@ static bool evermore_rate_switcher(struct gps_device_t *session, double rate) } /*@ -charint @*/ } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ /* this is everything we export */ @@ -624,15 +624,15 @@ const struct gps_type_t evermore_binary = .parse_packet = evermore_parse_input, /* parse message packets */ .rtcm_writer = gpsd_write, /* send RTCM data straight */ .event_hook = evermore_event_hook, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = evermore_speed, /* we can change baud rates */ .mode_switcher = evermore_mode, /* there is a mode switcher */ .rate_switcher = evermore_rate_switcher, /* change sample rate */ .min_cycle = 1, /* ignore, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = evermore_control_send, /* how to send a control string */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ diff --git a/driver_garmin.c b/driver_garmin.c index 2b43ae41..13f5b637 100644 --- a/driver_garmin.c +++ b/driver_garmin.c @@ -1130,7 +1130,7 @@ gps_mask_t garmin_ser_parse(struct gps_device_t *session) /*@ -charint @*/ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static void settle(void) { struct timespec delay, rem; @@ -1171,9 +1171,9 @@ static void garmin_switcher(struct gps_device_t *session, int mode) settle(); // wait 333mS, essential! } } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE static ssize_t garmin_control_send(struct gps_device_t *session, char *buf, size_t buflen) /* not used by the daemon, it's for gpsctl and friends */ @@ -1184,7 +1184,7 @@ static ssize_t garmin_control_send(struct gps_device_t *session, return gpsd_write(session, session->msgbuf, session->msgbuflen); /*@ +mayaliasunique @*/ } -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE static double garmin_ntp_offset(struct gps_device_t *session) @@ -1348,15 +1348,15 @@ const struct gps_type_t garmin_usb_binary_old = .parse_packet = garmin_usb_parse, /* parse message packets */ .rtcm_writer = NULL, /* don't send DGPS corrections */ .event_hook = garmin_event_hook,/* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = garmin_control_send, /* send raw bytes */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = garmin_ntp_offset, #endif /* NTPSHM_ ENABLE */ @@ -1377,15 +1377,15 @@ const struct gps_type_t garmin_usb_binary = .parse_packet = garmin_ser_parse, /* parse message packets */ .rtcm_writer = NULL, /* don't send DGPS corrections */ .event_hook = garmin_event_hook,/* lifetime ebent handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = NULL, /* Garmin USB Binary has no NMEA */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = garmin_control_send, /* send raw bytes */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = garmin_ntp_offset, #endif /* NTPSHM_ ENABLE */ @@ -1405,15 +1405,15 @@ const struct gps_type_t garmin_ser_binary = .parse_packet = garmin_ser_parse, /* parse message packets */ .rtcm_writer = NULL, /* don't send DGPS corrections */ .event_hook = NULL, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = garmin_switcher, /* how to change modes */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = garmin_control_send, /* send raw bytes */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = garmin_ntp_offset, #endif /* NTPSHM_ ENABLE */ diff --git a/driver_geostar.c b/driver_geostar.c index 738e75aa..3d044541 100644 --- a/driver_geostar.c +++ b/driver_geostar.c @@ -451,7 +451,7 @@ static gps_mask_t geostar_parse_input(struct gps_device_t *session) return 0; } -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE static ssize_t geostar_control_send(struct gps_device_t *session, char *buf, size_t buflen) /* not used by the daemon, it's for gpsctl and friends */ @@ -460,7 +460,7 @@ static ssize_t geostar_control_send(struct gps_device_t *session, (unsigned int)buf[0], (unsigned char *)buf + 1, (buflen - 1)/4); } -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ static void geostar_event_hook(struct gps_device_t *session, event_t event) { @@ -509,7 +509,7 @@ static void geostar_event_hook(struct gps_device_t *session, event_t event) /*@+shiftimplementation -ignoresigns@*/ } -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static bool geostar_speed_switch(struct gps_device_t *session, speed_t speed, char parity, int stopbits) { @@ -559,7 +559,7 @@ static void geostar_mode(struct gps_device_t *session, int mode) } /*@+shiftimplementation@*/ } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ #ifdef NTPSHM_ENABLE static double geostar_ntp_offset(struct gps_device_t *session UNUSED) @@ -582,15 +582,15 @@ const struct gps_type_t geostar_binary = .parse_packet = geostar_parse_input, /* parse message packets */ .rtcm_writer = NULL, /* doesn't accept DGPS corrections */ .event_hook = geostar_event_hook, /* fire on various lifetime events */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = geostar_speed_switch,/* change baud rate */ .mode_switcher = geostar_mode, /* there is a mode switcher */ .rate_switcher = NULL, /* no rate switcher */ .min_cycle = 1, /* not relevant, no rate switcher */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = geostar_control_send,/* how to send commands */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = geostar_ntp_offset, #endif /* NTPSHM_ENABLE */ diff --git a/driver_italk.c b/driver_italk.c index 6dbe15d6..6b6ca0d0 100644 --- a/driver_italk.c +++ b/driver_italk.c @@ -413,15 +413,15 @@ const struct gps_type_t italk_binary = .parse_packet = italk_parse_input,/* parse message packets */ .rtcm_writer = gpsd_write, /* send RTCM data straight */ .event_hook = NULL, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = NULL, /* no control string sender */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ diff --git a/driver_navcom.c b/driver_navcom.c index 8a7df9c1..2a6c939b 100644 --- a/driver_navcom.c +++ b/driver_navcom.c @@ -155,7 +155,7 @@ static void navcom_cmd_0x1c(struct gps_device_t *session, uint8_t mode, mode, length); } -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE /* Serial Port Configuration */ static void navcom_cmd_0x11(struct gps_device_t *session, uint8_t port_selection) @@ -180,7 +180,7 @@ static void navcom_cmd_0x11(struct gps_device_t *session, gpsd_report(LOG_IO, "Navcom: serial port selection: 0x%02x\n", port_selection); } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ static void navcom_event_hook(struct gps_device_t *session, event_t event) { @@ -1190,7 +1190,7 @@ static gps_mask_t navcom_parse_input(struct gps_device_t *session) return 0; } -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE static ssize_t navcom_control_send(struct gps_device_t *session, char *buf, size_t len) { @@ -1211,9 +1211,9 @@ static ssize_t navcom_control_send(struct gps_device_t *session, LOG_RAW)); return gpsd_write(session, session->msgbuf, session->msgbuflen); } -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static bool navcom_speed(struct gps_device_t *session, speed_t speed, char parity, int stopbits) { @@ -1281,7 +1281,7 @@ static bool navcom_speed(struct gps_device_t *session, return true; } } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ /* this is everything we export */ /* *INDENT-OFF* */ @@ -1297,15 +1297,15 @@ const struct gps_type_t navcom_binary = .parse_packet = navcom_parse_input, /* parse message packets */ .rtcm_writer = gpsd_write, /* send RTCM data straight */ .event_hook = navcom_event_hook, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = navcom_speed, /* we do change baud rates */ .mode_switcher = NULL, /* there is not a mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* ignore, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = navcom_control_send, /* how to send a control string */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ diff --git a/driver_oncore.c b/driver_oncore.c index 74728d60..a23b610e 100644 --- a/driver_oncore.c +++ b/driver_oncore.c @@ -472,7 +472,7 @@ static double oncore_ntp_offset(struct gps_device_t *session UNUSED) } #endif /* NTPSHM_ENABLE */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static bool oncore_set_speed(struct gps_device_t *session UNUSED, speed_t speed UNUSED, char parity UNUSED, int stopbits UNUSED) @@ -505,7 +505,7 @@ static void oncore_set_mode(struct gps_device_t *session, int mode) session->gpsdata.dev.driver_mode = MODE_BINARY; } } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ static gps_mask_t oncore_parse_input(struct gps_device_t *session) { @@ -540,16 +540,16 @@ const struct gps_type_t oncore_binary = { .parse_packet = oncore_parse_input, /* packet parser */ .rtcm_writer = gpsd_write, /* device accepts RTCM */ .event_hook = oncore_event_hook, /* lifetime event hook */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = oncore_set_speed, /* no speed setter */ .mode_switcher = oncore_set_mode, /* no mode setter */ .rate_switcher = NULL, /* no speed setter */ .min_cycle = 1, /* 1Hz */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE /* Control string sender - should provide checksum and headers/trailer */ .control_send = oncore_control_send, /* to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = oncore_ntp_offset, /* NTP offset array */ #endif /* NTPSHM_ENABLE */ diff --git a/driver_proto.c b/driver_proto.c index 6918cd58..85075560 100644 --- a/driver_proto.c +++ b/driver_proto.c @@ -330,7 +330,7 @@ static bool _proto__probe_detect(struct gps_device_t *session) return false; } -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE /** * Write data to the device, doing any required padding or checksumming */ @@ -357,9 +357,9 @@ static ssize_t _proto__control_send(struct gps_device_t *session, return gpsd_write(session, session->msgbuf, session->msgbuflen); } /*@ -charint +usedef +compdef @*/ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static void _proto__event_hook(struct gps_device_t *session, event_t event) { if (session->context->readonly) @@ -468,7 +468,7 @@ static void _proto__set_mode(struct gps_device_t *session, int mode) session->gpsdata.driver_mode = MODE_BINARY; } } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ #ifdef NTPSHM_ENABLE static double _proto_ntp_offset(struct gps_device_t *session) @@ -528,7 +528,7 @@ const struct gps_type_t _proto__binary = { .rtcm_writer = pass_rtcm, /* fire on various lifetime events */ .event_hook = _proto__event_hook, -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE /* Speed (baudrate) switch */ .speed_switcher = _proto__set_speed, /* Switch to NMEA mode */ @@ -537,11 +537,11 @@ const struct gps_type_t _proto__binary = { .rate_switcher = NULL, /* Minimum cycle time of the device */ .min_cycle = 1, -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE /* Control string sender - should provide checksum and headers/trailer */ .control_send = _proto__control_send, -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = _proto_ntp_offset, #endif /* NTPSHM_ENABLE */ diff --git a/driver_sirf.c b/driver_sirf.c index 0ca5a25c..ff447b1e 100644 --- a/driver_sirf.c +++ b/driver_sirf.c @@ -46,7 +46,7 @@ #define HI(n) ((n) >> 8) #define LO(n) ((n) & 0xff) -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE /*@ +charint @*/ /* message to enable: * MID 7 Clock Status @@ -117,7 +117,7 @@ static unsigned char enablemid52[] = { }; /*@ -charint @*/ -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ static gps_mask_t sirf_msg_debug(unsigned char *, size_t); @@ -164,7 +164,7 @@ static bool sirf_write(struct gps_device_t *session, unsigned char *msg) return (ok); } -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE static ssize_t sirf_control_send(struct gps_device_t *session, char *msg, size_t len) { @@ -184,9 +184,9 @@ static ssize_t sirf_control_send(struct gps_device_t *session, char *msg, /* *INDENT-ON* */ /*@ -charint -matchanyintegral +initallelements +mayaliasunique @*/ } -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static bool sirfbin_speed(struct gps_device_t *session, speed_t speed, char parity, int stopbits) /* change speed in binary mode */ { @@ -290,7 +290,7 @@ static void sirfbin_mode(struct gps_device_t *session, int mode) } session->back_to_nmea = false; } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ static ssize_t sirf_get(struct gps_device_t *session) { @@ -405,12 +405,12 @@ static gps_mask_t sirf_msg_swversion(struct gps_device_t *session, } else { session->driver.sirf.driverstate |= SIRF_GE_232; } -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE if (!session->context->readonly) { gpsd_report(LOG_PROG, "SiRF: Enabling PPS message...\n"); (void)sirf_write(session, enablemid52); } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ if (strstr((char *)(buf + 1), "ES")) gpsd_report(LOG_INF, "SiRF: Firmware has XTrac capability\n"); @@ -419,13 +419,13 @@ static gps_mask_t sirf_msg_swversion(struct gps_device_t *session, #ifdef NTPSHM_ENABLE session->driver.sirf.time_seen = 0; #endif /* NTPSHM_ENABLE */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE if (!session->context->readonly && session->gpsdata.dev.baudrate >= 38400) { /* some USB devices are also too slow, no way to tell which ones */ gpsd_report(LOG_PROG, "SiRF: Enabling subframe transmission...\n"); (void)sirf_write(session, enablesubframe); } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ gpsd_report(LOG_DATA, "SiRF: FV MID 0x06: subtype='%s' mask={DEVICEID}\n", session->subtype); return DEVICEID_SET; @@ -449,14 +449,14 @@ static gps_mask_t sirf_msg_navdata(struct gps_device_t *session, gpsd_report(LOG_IO, "SiRF: NavData chan %u svid %u\n",chan,svid); -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE if (!session->context->readonly && session->gpsdata.dev.baudrate < 38400) { /* some USB are also too slow, no way to tell which ones */ gpsd_report(LOG_WARN, "WARNING: SiRF: link too slow, disabling subframes.\n"); (void)sirf_write(session, disablesubframe); } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ return gpsd_interpret_subframe_raw(session, svid, words); } @@ -840,12 +840,12 @@ static gps_mask_t sirf_msg_sysparam(struct gps_device_t *session, session->driver.sirf.degraded_timeout = (unsigned char)getub(buf, 10); session->driver.sirf.dr_timeout = (unsigned char)getub(buf, 11); session->driver.sirf.track_smooth_mode = (unsigned char)getub(buf, 12); -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE if (!session->context->readonly) { gpsd_report(LOG_PROG, "SiRF: Setting Navigation Parameters\n"); (void)sirf_write(session, modecontrol); } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ return 0; } @@ -1348,15 +1348,15 @@ const struct gps_type_t sirf_binary = .parse_packet = sirfbin_parse_input,/* parse message packets */ .rtcm_writer = gpsd_write, /* send RTCM data straight */ .event_hook = sirfbin_event_hook,/* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = sirfbin_speed, /* we can change baud rate */ .mode_switcher = sirfbin_mode, /* there's a mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = sirf_control_send,/* how to send a control string */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = sirf_ntp_offset, #endif /* NTP_SHM_ENABLE */ diff --git a/driver_superstar2.c b/driver_superstar2.c index 34b54ff6..c3704f07 100644 --- a/driver_superstar2.c +++ b/driver_superstar2.c @@ -486,7 +486,7 @@ static gps_mask_t superstar2_parse_input(struct gps_device_t *session) return 0; } -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE static ssize_t superstar2_control_send(struct gps_device_t *session, char *msg, size_t msglen) @@ -501,9 +501,9 @@ superstar2_control_send(struct gps_device_t *session, char *msg, /*@ -charint +mayaliasunique @*/ return superstar2_write(session, session->msgbuf, session->msgbuflen); } -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static bool superstar2_set_speed(struct gps_device_t *session, speed_t speed, char parity, int stopbits) { @@ -522,7 +522,7 @@ static bool superstar2_set_speed(struct gps_device_t *session, return (superstar2_write(session, (char *)speed_msg, 7) == 7); } } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ static void superstar2_set_mode(struct gps_device_t *session, int mode) { @@ -562,7 +562,7 @@ const struct gps_type_t superstar2_binary = { .rtcm_writer = gpsd_write, /* Fire on various lifetime events */ .event_hook = superstar2_event_hook, -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE /* Speed (baudrate) switch */ .speed_switcher = superstar2_set_speed, /* Switch to NMEA mode */ @@ -571,11 +571,11 @@ const struct gps_type_t superstar2_binary = { .rate_switcher = NULL, /* Minimum cycle time (not used) */ .min_cycle = 1, -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE /* Control string sender - should provide checksum and trailer */ .control_send = superstar2_control_send, -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ diff --git a/driver_tsip.c b/driver_tsip.c index 484fdd9d..b83b4b5d 100644 --- a/driver_tsip.c +++ b/driver_tsip.c @@ -947,7 +947,7 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session) return 0; } -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE static ssize_t tsip_control_send(struct gps_device_t *session, char *buf, size_t buflen) /* not used by the daemon, it's for gpsctl and friends */ @@ -956,7 +956,7 @@ static ssize_t tsip_control_send(struct gps_device_t *session, (unsigned int)buf[0], (unsigned char *)buf + 1, buflen - 1); } -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ static void tsip_event_hook(struct gps_device_t *session, event_t event) { @@ -1039,7 +1039,7 @@ static void tsip_event_hook(struct gps_device_t *session, event_t event) } } -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static bool tsip_speed_switch(struct gps_device_t *session, speed_t speed, char parity, int stopbits) { @@ -1121,7 +1121,7 @@ static void tsip_mode(struct gps_device_t *session, int mode) gpsd_report(LOG_ERROR, "unknown mode %i requested\n", mode); } } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ #ifdef NTPSHM_ENABLE static double tsip_ntp_offset(struct gps_device_t *session UNUSED) @@ -1145,15 +1145,15 @@ const struct gps_type_t tsip_binary = .parse_packet = tsip_parse_input, /* parse message packets */ .rtcm_writer = NULL, /* doesn't accept DGPS corrections */ .event_hook = tsip_event_hook, /* fire on various lifetime events */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = tsip_speed_switch,/* change baud rate */ .mode_switcher = tsip_mode, /* there is a mode switcher */ .rate_switcher = NULL, /* no rate switcher */ .min_cycle = 1, /* not relevant, no rate switcher */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = tsip_control_send,/* how to send commands */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = tsip_ntp_offset, #endif /* NTPSHM_ENABLE */ diff --git a/driver_ubx.c b/driver_ubx.c index 51445a96..389accd7 100644 --- a/driver_ubx.c +++ b/driver_ubx.c @@ -570,7 +570,7 @@ bool ubx_write(struct gps_device_t * session, return (ok); } -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE static ssize_t ubx_control_send(struct gps_device_t *session, char *msg, size_t data_len) /* not used by gpsd, it's for gpsctl and friends */ @@ -580,7 +580,7 @@ static ssize_t ubx_control_send(struct gps_device_t *session, char *msg, (unsigned short)(data_len - 2)) ? ((ssize_t) (data_len + 7)) : -1; } -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ static void ubx_catch_model(struct gps_device_t *session, unsigned char *buf, size_t len) @@ -663,7 +663,7 @@ static void ubx_event_hook(struct gps_device_t *session, event_t event) } } -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static void ubx_nmea_mode(struct gps_device_t *session, int mode) { int i; @@ -756,7 +756,7 @@ static bool ubx_rate(struct gps_device_t *session, double cycletime) return ubx_write(session, 0x06, 0x08, msg, 6); /* CFG-RATE */ } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ /* This is everything we export */ /* *INDENT-OFF* */ @@ -771,15 +771,15 @@ const struct gps_type_t ubx_binary = { .parse_packet = parse_input, /* Parse message packets */ .rtcm_writer = gpsd_write, /* RTCM handler (using default routine) */ .event_hook = ubx_event_hook, /* Fiew in variious lifetime events */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = ubx_speed, /* Speed (baudrate) switch */ .mode_switcher = ubx_nmea_mode, /* Switch to NMEA mode */ .rate_switcher = ubx_rate, /* Message delivery rate switcher */ .min_cycle = 0.25, /* Maximum 4Hz sample rate */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = ubx_control_send, /* no control sender yet */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ diff --git a/driver_zodiac.c b/driver_zodiac.c index 92b5ced8..cbc4cee2 100644 --- a/driver_zodiac.c +++ b/driver_zodiac.c @@ -419,7 +419,7 @@ static gps_mask_t zodiac_analyze(struct gps_device_t *session) } } -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE static ssize_t zodiac_control_send(struct gps_device_t *session, char *msg, size_t len) { @@ -429,9 +429,9 @@ static ssize_t zodiac_control_send(struct gps_device_t *session, return zodiac_spew(session, shortwords[0], shortwords + 1, (int)(len / 2 - 1)); } -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static bool zodiac_speed_switch(struct gps_device_t *session, speed_t speed, char parity, int stopbits) { @@ -469,7 +469,7 @@ static bool zodiac_speed_switch(struct gps_device_t *session, (void)zodiac_spew(session, 1330, data, 15); return true; /* it would be nice to error-check this */ } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ #ifdef NTPSHM_ENABLE static double zodiac_ntp_offset(struct gps_device_t *session UNUSED) @@ -496,15 +496,15 @@ const struct gps_type_t zodiac_binary = .parse_packet = zodiac_analyze, /* parse message packets */ .rtcm_writer = zodiac_send_rtcm, /* send DGPS correction */ .event_hook = NULL, /* no configuration */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = zodiac_speed_switch,/* we can change baud rate */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = zodiac_control_send, /* for gpsctl and friends */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = zodiac_ntp_offset, /* compute NTO fudge factor */ #endif /* NTPSHM_ENABLE */ diff --git a/drivers.c b/drivers.c index 12383722..1620e1e5 100644 --- a/drivers.c +++ b/drivers.c @@ -105,15 +105,15 @@ const struct gps_type_t unknown = { .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = NULL, /* write RTCM data straight */ .event_hook = NULL, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = NULL, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ @@ -246,7 +246,7 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event) } } -#if defined(ALLOW_RECONFIGURE) && defined(BINARY_ENABLE) +#if defined(RECONFIGURE_ENABLE) && defined(BINARY_ENABLE) static void nmea_mode_switch(struct gps_device_t *session, int mode) { /* @@ -268,7 +268,7 @@ static void nmea_mode_switch(struct gps_device_t *session, int mode) /*@+shiftnegative@*/ } } -#endif /* defined(ALLOW_RECONFIGURE) && defined(BINARY_ENABLE) */ +#endif /* defined(RECONFIGURE_ENABLE) && defined(BINARY_ENABLE) */ /* *INDENT-OFF* */ const struct gps_type_t nmea = { @@ -282,7 +282,7 @@ const struct gps_type_t nmea = { .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = gpsd_write, /* write RTCM data straight */ .event_hook = nmea_event_hook, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ #ifdef BINARY_ENABLE .mode_switcher = nmea_mode_switch, /* maybe switchable if it was a SiRF */ @@ -291,10 +291,10 @@ const struct gps_type_t nmea = { #endif /* BINARY_ENABLE */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = nmea_write, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ @@ -308,7 +308,7 @@ const struct gps_type_t nmea = { * **************************************************************************/ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static void garmin_mode_switch(struct gps_device_t *session, int mode) /* only does anything in one direction, going to Garmin binary driver */ { @@ -319,7 +319,7 @@ static void garmin_mode_switch(struct gps_device_t *session, int mode) session->gpsdata.dev.driver_mode = MODE_BINARY; } } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ static void garmin_nmea_event_hook(struct gps_device_t *session, event_t event) @@ -388,15 +388,15 @@ const struct gps_type_t garmin = { .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = NULL, /* some do, some don't, skip for now */ .event_hook = garmin_nmea_event_hook, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = garmin_mode_switch, /* mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /*ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /*RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = nmea_write, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ @@ -450,15 +450,15 @@ const struct gps_type_t ashtech = { .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = gpsd_write, /* write RTCM data straight */ .event_hook = ashtech_event_hook, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = nmea_write, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ @@ -501,15 +501,15 @@ const struct gps_type_t fv18 = { .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = gpsd_write, /* write RTCM data straight */ .event_hook = fv18_event_hook, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = nmea_write, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ @@ -554,15 +554,15 @@ const struct gps_type_t gpsclock = { .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = gpsd_write, /* write RTCM data straight */ .event_hook = gpsclock_event_hook, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* sample rate is fixed */ .min_cycle = 1, /* sample rate is fixed */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = nmea_write, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ @@ -609,15 +609,15 @@ static const struct gps_type_t tripmate = { .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = gpsd_write, /* send RTCM data straight */ .event_hook = tripmate_event_hook, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher= NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = nmea_write, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ @@ -660,15 +660,15 @@ static const struct gps_type_t earthmate = { .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = NULL, /* don't send RTCM data */ .event_hook = earthmate_event_hook, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher= NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = nmea_write, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no method for NTP fudge factor */ #endif /* NTPSHM_ ENABLE */ @@ -744,7 +744,7 @@ static bool tnt_send(struct gps_device_t *session, const char *fmt, ...) } } -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static bool tnt_speed(struct gps_device_t *session, speed_t speed, char parity UNUSED, int stopbits UNUSED) { @@ -762,7 +762,7 @@ static bool tnt_speed(struct gps_device_t *session, return tnt_send(session, "@B6=%d", i + 1) && tnt_send(session, "@F28.6=1"); } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ static void tnt_event_hook(struct gps_device_t *session, event_t event) /* TNT lifetime event hook */ @@ -787,15 +787,15 @@ const struct gps_type_t trueNorth = { .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = NULL, /* Don't send */ .event_hook = tnt_event_hook, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = tnt_speed, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no wrapup */ .min_cycle = 0.5, /* fixed at 20 samples per second */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = tnt_control_send, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, #endif /* NTPSHM_ ENABLE */ @@ -863,15 +863,15 @@ static const struct gps_type_t oceanServer = { .parse_packet = generic_parse_input, /* how to interpret a packet */ .rtcm_writer = NULL, /* Don't send */ .event_hook = oceanserver_event_hook, -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no wrapup */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = nmea_write, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, #endif /* NTPSHM_ ENABLE */ @@ -912,15 +912,15 @@ static const struct gps_type_t rtcm104v2 = { .parse_packet = rtcm104v2_analyze, /* */ .rtcm_writer = NULL, /* don't send RTCM data, */ .event_hook = NULL, /* no event_hook */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher= NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = nmea_write, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, #endif /* NTPSHM_ ENABLE */ @@ -961,15 +961,15 @@ static const struct gps_type_t rtcm104v3 = { .parse_packet = rtcm104v3_analyze, /* */ .rtcm_writer = NULL, /* don't send RTCM data, */ .event_hook = NULL, /* no event hook */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher= NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = nmea_write, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, #endif /* NTPSHM_ ENABLE */ @@ -996,15 +996,15 @@ static const struct gps_type_t garmintxt = { .parse_packet = generic_parse_input, /* how to parse one */ .rtcm_writer = NULL, /* don't send RTCM data, */ .event_hook = NULL, /* no event hook */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher= NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no sample-rate switcher */ .min_cycle = 1, /* not relevant, no rate switch */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = nmea_write, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, #endif /* NTPSHM_ ENABLE */ @@ -1094,7 +1094,7 @@ static void mtk3301_event_hook(struct gps_device_t *session, event_t event) } } -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static bool mtk3301_rate_switcher(struct gps_device_t *session, double rate) { char buf[78]; @@ -1109,7 +1109,7 @@ static bool mtk3301_rate_switcher(struct gps_device_t *session, double rate) (void)nmea_send(session, buf); /* Fix interval */ return true; } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ /* *INDENT-OFF* */ const struct gps_type_t mtk3301 = { @@ -1123,15 +1123,15 @@ const struct gps_type_t mtk3301 = { .parse_packet = processMTK3301, /* how to interpret a packet */ .rtcm_writer = gpsd_write, /* write RTCM data straight */ .event_hook = mtk3301_event_hook, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = mtk3301_rate_switcher, /* sample rate switcher */ .min_cycle = 0.2, /* max 5Hz */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = nmea_write, /* how to send control strings */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, #endif /* NTPSHM_ ENABLE */ @@ -1177,15 +1177,15 @@ static const struct gps_type_t aivdm = { .parse_packet = aivdm_analyze, /* how to analyze a packet */ .rtcm_writer = NULL, /* don't send RTCM data, */ .event_hook = NULL, /* lifetime event handler */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE .speed_switcher = NULL, /* no speed switcher */ .mode_switcher = NULL, /* no mode switcher */ .rate_switcher = NULL, /* no rate switcher */ .min_cycle = 1, /* max 1Hz */ -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE .control_send = NULL, /* no control sender */ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE .ntp_offset = NULL, /* no NTP communication */ #endif /* NTPSHM_ ENABLE */ diff --git a/gpsctl.c b/gpsctl.c index 56e5dd86..17de5f8b 100644 --- a/gpsctl.c +++ b/gpsctl.c @@ -219,10 +219,10 @@ int main(int argc, char **argv) struct gps_data_t gpsdata; const struct gps_type_t *forcetype = NULL; const struct gps_type_t **dp; -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE char cooked[BUFSIZ]; ssize_t cooklen = 0; -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ #define USAGE "usage: gpsctl [-l] [-b | -n | -r] [-D n] [-s speed] [-c rate] [-T timeout] [-V] [-t devtype] [-x control] [-e] \n" while ((option = getopt(argc, argv, "bec:fhlnrs:t:x:D:T:V")) != -1) { @@ -231,14 +231,14 @@ int main(int argc, char **argv) to_binary = true; break; case 'c': -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE rate = optarg; #else gpsd_report(LOG_ERROR, "cycle-change capability has been conditioned out.\n"); -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ break; case 'x': /* ship specified control string */ -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE control = optarg; lowlevel = true; if ((cooklen = hex_escapes(cooked, control)) <= 0) { @@ -248,7 +248,7 @@ int main(int argc, char **argv) } #else gpsd_report(LOG_ERROR, "control_send capability has been conditioned out.\n"); -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ break; case 'e': /* echo specified control string with wrapper */ lowlevel = true; @@ -259,7 +259,7 @@ int main(int argc, char **argv) break; case 'l': /* list known device types */ for (dp = gpsd_drivers; *dp; dp++) { -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE if ((*dp)->mode_switcher != NULL) (void)fputs("-[bn]\t", stdout); else @@ -272,37 +272,37 @@ int main(int argc, char **argv) (void)fputs("-c\t", stdout); else (void)fputc('\t', stdout); -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE if ((*dp)->control_send != NULL) (void)fputs("-x\t", stdout); else (void)fputc('\t', stdout); -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ (void)puts((*dp)->type_name); } exit(0); case 'n': /* switch to NMEA mode */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE to_nmea = true; #else gpsd_report(LOG_ERROR, "speed-change capability has been conditioned out.\n"); -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ break; case 'r': /* force-switch to default mode */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE reset = true; lowlevel = false; /* so we'll abort if the daemon is running */ #else gpsd_report(LOG_ERROR, "reset capability has been conditioned out.\n"); -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ break; case 's': /* change output baud rate */ -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE speed = optarg; #else gpsd_report(LOG_ERROR, "speed-change capability has been conditioned out.\n"); -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ break; case 't': /* force the device type */ devtype = optarg; @@ -459,7 +459,7 @@ int main(int argc, char **argv) } status = 0; -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE if (reset) { gpsd_report(LOG_PROG, "cannot reset with gpsd running.\n"); @@ -533,10 +533,10 @@ int main(int argc, char **argv) "?DEVICE={\"path\":\"%s\",\"cycle\":%s}\n", device, rate); } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ (void)gps_close(&gpsdata); exit(status); -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE } else if (reset) { /* hard reset will go through lower-level operations */ const int speeds[] = {2400, 4800, 9600, 19200, 38400, 57600, 115200}; @@ -570,7 +570,7 @@ int main(int argc, char **argv) gpsd_wrap(&session); exit(0); /*@ +mustfreeonly +immediatetrans @*/ -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ } else { /* access to the daemon failed, use the low-level facilities */ static struct gps_context_t context; /* start it zeroed */ @@ -656,7 +656,7 @@ int main(int argc, char **argv) /* now perform the actual control function */ status = 0; -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE /*@ -nullderef @*/ if (to_nmea || to_binary) { bool write_enable = context.readonly; @@ -745,8 +745,8 @@ int main(int argc, char **argv) } context.readonly = write_enable; } -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE /*@ -compdef @*/ if (control) { bool write_enable = context.readonly; @@ -768,7 +768,7 @@ int main(int argc, char **argv) context.readonly = write_enable; } /*@ +compdef @*/ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ exit(status); /*@ +nullderef @*/ diff --git a/gpsd.c b/gpsd.c index 4e8275b4..0b88f9e0 100644 --- a/gpsd.c +++ b/gpsd.c @@ -868,7 +868,7 @@ static bool awaken(struct gps_device_t *device) } } -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE static bool privileged_user(struct gps_device_t *device) /* is this channel privileged to change a device's behavior? */ { @@ -935,7 +935,7 @@ static void set_serial(struct gps_device_t *device, } /* *INDENT-ON* */ } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ static void json_devicelist_dump(char *reply, size_t replylen) { @@ -1048,7 +1048,7 @@ static void handle_request(struct subscriber_t *sub, if (*buf == ';') { ++buf; } else { -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE /* first, select a device to operate on */ int status = json_device_read(buf + 1, &devconf, &end); if (end == NULL) @@ -1148,10 +1148,10 @@ static void handle_request(struct subscriber_t *sub, } } /*@+branchstate@*/ -#else /* ALLOW_RECONFIGURE */ +#else /* RECONFIGURE_ENABLE */ (void)snprintf(reply + strlen(reply), replylen - strlen(reply), "{\"class\":\"ERROR\",\"message\":\"Device configuration support not compiled.\"}\r\n"); -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ } /* dump a response for each selected channel */ for (devp = devices; devp < devices + MAXDEVICES; devp++) @@ -1754,7 +1754,7 @@ int main(int argc, char *argv[]) break; case 'l': /* list known device types and exit */ for (dp = gpsd_drivers; *dp; dp++) { -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE if ((*dp)->mode_switcher != NULL) (void)fputs("n\t", stdout); else @@ -1767,7 +1767,7 @@ int main(int argc, char *argv[]) (void)fputs("c\t", stdout); else (void)fputc('\t', stdout); -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ (void)puts((*dp)->type_name); } exit(0); diff --git a/gpsd.h-tail b/gpsd.h-tail index c33cc2be..a91ccb8c 100644 --- a/gpsd.h-tail +++ b/gpsd.h-tail @@ -269,16 +269,16 @@ struct gps_type_t { /*@null@*/gps_mask_t (*parse_packet)(struct gps_device_t *session); /*@null@*/ssize_t (*rtcm_writer)(struct gps_device_t *session, const char *rtcmbuf, size_t rtcmbytes); /*@null@*/void (*event_hook)(struct gps_device_t *session, event_t event); -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE /*@null@*/bool (*speed_switcher)(struct gps_device_t *session, speed_t speed, char parity, int stopbits); /*@null@*/void (*mode_switcher)(struct gps_device_t *session, int mode); /*@null@*/bool (*rate_switcher)(struct gps_device_t *session, double rate); double min_cycle; -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE /*@null@*/ssize_t (*control_send)(struct gps_device_t *session, char *buf, size_t buflen); -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ #ifdef NTPSHM_ENABLE /*@null@*/double (*ntp_offset)(struct gps_device_t *session); #endif /* NTPSHM_ENABLE */ diff --git a/gpsd_json.c b/gpsd_json.c index e3ede58e..65879b21 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -377,14 +377,14 @@ void json_device_dump(const struct gps_device_t *device, device->gpsdata.dev.parity, device->gpsdata.dev.stopbits, device->gpsdata.dev.cycle); -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE if (device->device_type != NULL && device->device_type->rate_switcher != NULL) (void)snprintf(reply + strlen(reply), replylen - strlen(reply), ",\"mincycle\":%2.2f", device->device_type->min_cycle); -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ } } if (reply[strlen(reply) - 1] == ',') diff --git a/gpsmon.c b/gpsmon.c index 12174b3b..6921b6a3 100644 --- a/gpsmon.c +++ b/gpsmon.c @@ -274,7 +274,7 @@ static void packet_dump(const char *buf, size_t buflen) } } -#if defined(ALLOW_CONTROLSEND) || defined(ALLOW_RECONFIGURE) +#if defined(CONTROLSEND_ENABLE) || defined(RECONFIGURE_ENABLE) static void monitor_dump_send(/*@in@*/ const char *buf, size_t len) { if (packetwin != NULL) { @@ -298,9 +298,9 @@ static void announce_log(/*@in@*/ const char *str) (void)fprintf(logfile, ">>>%s\n", str); } } -#endif /* defined(ALLOW_CONTROLSEND) || defined(ALLOW_RECONFIGURE) */ +#endif /* defined(CONTROLSEND_ENABLE) || defined(RECONFIGURE_ENABLE) */ -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE bool monitor_control_send( /*@in@*/ unsigned char *buf, size_t len) { if ((controlfd == -1) || (session.gpsdata.dev.path[0] == '\0')) @@ -368,7 +368,7 @@ static bool monitor_raw_send( /*@in@*/ unsigned char *buf, size_t len) return (st > 0 && (size_t) st == len); } } -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ /***************************************************************************** * @@ -459,9 +459,9 @@ static void onsig(int sig UNUSED) int main(int argc, char **argv) { -#if defined(ALLOW_CONTROLSEND) || defined(ALLOW_RECONFIGURE) +#if defined(CONTROLSEND_ENABLE) || defined(RECONFIGURE_ENABLE) unsigned int v; -#endif /* defined(ALLOW_CONTROLSEND) || defined(ALLOW_RECONFIGURE) */ +#endif /* defined(CONTROLSEND_ENABLE) || defined(RECONFIGURE_ENABLE) */ int option, status, last_type = BAD_PACKET; ssize_t len; struct fixsource_t source; @@ -491,7 +491,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 +#ifdef RECONFIGURE_ENABLE if ((*active)->driver->mode_switcher != NULL) (void)fputc('n', stdout); else @@ -507,13 +507,13 @@ int main(int argc, char **argv) else (void)fputc(' ', stdout); (void)fputc(' ', stdout); -#endif /* ALLOW_RECONFIGURE */ -#ifdef ALLOW_CONTROLSEND +#endif /* RECONFIGURE_ENABLE */ +#ifdef CONTROLSEND_ENABLE if ((*active)->driver->control_send != NULL) (void)fputc('x', stdout); else (void)fputc(' ', stdout); -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ (void)fputc(' ', stdout); if ((*active)->command != NULL) (void)fputc('+', stdout); @@ -757,7 +757,7 @@ int main(int argc, char **argv) assert(status == COMMAND_UNKNOWN); } switch (line[0]) { -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE case 'c': /* change cycle time */ if (active == NULL) monitor_complain("No device defined yet"); @@ -797,7 +797,7 @@ int main(int argc, char **argv) /*@ +sefparams @*/ } break; -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ case 'i': /* start probing for subtype */ if (active == NULL) @@ -828,7 +828,7 @@ int main(int argc, char **argv) ">>> Logging to %s on", logfile); break; -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE case 'n': /* change mode */ /* if argument not specified, toggle */ if (strcspn(line, "01") == strlen(line)) { @@ -876,12 +876,12 @@ int main(int argc, char **argv) /*@ +sefparams @*/ } break; -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ case 'q': /* quit */ goto quit; -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE case 's': /* change speed */ if (active == NULL) monitor_complain("No device defined yet"); @@ -965,7 +965,7 @@ int main(int argc, char **argv) /*@ +sefparams @*/ } break; -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ case 't': /* force device type */ if (strlen(arg) > 0) { @@ -995,7 +995,7 @@ int main(int argc, char **argv) } break; -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE case 'x': /* send control packet */ if (active == NULL) monitor_complain("No device defined yet"); @@ -1025,7 +1025,7 @@ int main(int argc, char **argv) monitor_complain("Raw send failed."); /*@ +compdef @*/ break; -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ default: monitor_complain("Unknown command"); diff --git a/libgpsd_core.c b/libgpsd_core.c index 043250d0..9f132461 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -63,9 +63,9 @@ int gpsd_switch_driver(struct gps_device_t *session, char *type_name) (*dp)->type_name); gpsd_assert_sync(session); /*@i@*/ session->device_type = *dp; -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE session->gpsdata.dev.mincycle = session->device_type->min_cycle; -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ /* reconfiguration might be required */ if (identified && session->device_type->event_hook != NULL) session->device_type->event_hook(session, @@ -159,7 +159,7 @@ void gpsd_init(struct gps_device_t *session, struct gps_context_t *context, void gpsd_deactivate(struct gps_device_t *session) /* temporarily release the GPS device */ { -#ifdef ALLOW_RECONFIGURE +#ifdef RECONFIGURE_ENABLE if (!session->context->readonly && session->device_type != NULL && session->device_type->event_hook != NULL) { @@ -170,7 +170,7 @@ void gpsd_deactivate(struct gps_device_t *session) && session->device_type->mode_switcher != NULL) session->device_type->mode_switcher(session, 0); } -#endif /* ALLOW_RECONFIGURE */ +#endif /* RECONFIGURE_ENABLE */ gpsd_report(LOG_INF, "closing GPS=%s (%d)\n", session->gpsdata.dev.path, session->gpsdata.gps_fd); (void)gpsd_close(session); diff --git a/monitor_nmea.c b/monitor_nmea.c index 802ba2e7..cf4cb722 100644 --- a/monitor_nmea.c +++ b/monitor_nmea.c @@ -329,7 +329,7 @@ const struct monitor_object_t nmea_mmt = { * *****************************************************************************/ -#if defined(ALLOW_CONTROLSEND) && defined(ASHTECH_ENABLE) +#if defined(CONTROLSEND_ENABLE) && defined(ASHTECH_ENABLE) static void monitor_nmea_send(const char *fmt, ...) { char buf[BUFSIZ]; @@ -340,7 +340,7 @@ static void monitor_nmea_send(const char *fmt, ...) va_end(ap); (void)monitor_control_send((unsigned char *)buf, strlen(buf)); } -#endif /* defined(ALLOW_CONTROLSEND) && defined(ASHTECH_ENABLE) */ +#endif /* defined(CONTROLSEND_ENABLE) && defined(ASHTECH_ENABLE) */ /* * Yes, it's OK for most of these to be clones of the generic NMEA monitor @@ -370,7 +370,7 @@ extern const struct gps_type_t ashtech; #define ASHTECH_SPEED_9600 5 #define ASHTECH_SPEED_57600 8 -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE static int ashtech_command(char line[]) { switch (line[0]) { @@ -418,16 +418,16 @@ static int ashtech_command(char line[]) return COMMAND_UNKNOWN; } -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ const struct monitor_object_t ashtech_mmt = { .initialize = nmea_initialize, .update = nmea_update, -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE .command = ashtech_command, #else .command = NULL, -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ .wrap = nmea_wrap, .min_y = 21,.min_x = 80, .driver = &ashtech, diff --git a/monitor_sirf.c b/monitor_sirf.c index f474bb1a..b647f2ed 100644 --- a/monitor_sirf.c +++ b/monitor_sirf.c @@ -197,12 +197,12 @@ static bool sirf_initialize(void) /*@ +nullpass @*/ /*@ -onlytrans @*/ -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE /* probe for version */ /*@ -compdef @*/ (void)monitor_control_send((unsigned char *)"\x84\x00", 2); /*@ +compdef @*/ -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ /* initialize the GPS context's time fields */ gpsd_time_init(session.context, time(NULL)); @@ -631,12 +631,12 @@ static void sirf_update(void) break; } -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE /* elicit navigation parameters */ if (dispmode && (time(NULL) % 10 == 0)) { (void)monitor_control_send((unsigned char *)"\x98\x00", 2); } -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ /*@ -nullpass -nullderef @*/ if (dispmode) { @@ -648,7 +648,7 @@ static void sirf_update(void) /*@ +globstate */ -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE static int sirf_command(char line[]) { unsigned char buf[BUFSIZ]; @@ -714,7 +714,7 @@ static int sirf_command(char line[]) return COMMAND_UNKNOWN; /* no match */ } -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ static void sirf_wrap(void) { @@ -731,11 +731,11 @@ static void sirf_wrap(void) const struct monitor_object_t sirf_mmt = { .initialize = sirf_initialize, .update = sirf_update, -#ifdef ALLOW_CONTROLSEND +#ifdef CONTROLSEND_ENABLE .command = sirf_command, #else .command = NULL, -#endif /* ALLOW_CONTROLSEND */ +#endif /* CONTROLSEND_ENABLE */ .wrap = sirf_wrap, .min_y = 22,.min_x = 80, .driver = &sirf_binary, -- cgit v1.2.1