summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-06-27 18:44:20 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-06-27 18:44:20 -0400
commit82d01054704b97a0d48c9d9d705a0b71f86656d6 (patch)
tree3ac6163a03f2c43d40024c4b44da65d1a1e21076
parenta406e6f599e2a9be7cca5d9f2fca859f9cd7cd9c (diff)
downloadgpsd-82d01054704b97a0d48c9d9d705a0b71f86656d6.tar.gz
Slim down gpsd a bit by moving a function only gpsctl.c now uses.
-rw-r--r--gpsctl.c15
-rw-r--r--gpsd.h-tail1
-rw-r--r--libgpsd_core.c15
3 files changed, 15 insertions, 16 deletions
diff --git a/gpsctl.c b/gpsctl.c
index 7eb94d9a..df338f1a 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -209,6 +209,21 @@ static void onsig(int sig)
}
}
+static char /*@observer@*/ *gpsd_id( /*@in@ */ struct gps_device_t *session)
+/* full ID of the device for reports, including subtype */
+{
+ static char buf[128];
+ if ((session == NULL) || (session->device_type == NULL) ||
+ (session->device_type->type_name == NULL))
+ return "unknown,";
+ (void)strlcpy(buf, session->device_type->type_name, sizeof(buf));
+ if (session->subtype[0] != '\0') {
+ (void)strlcat(buf, " ", sizeof(buf));
+ (void)strlcat(buf, session->subtype, sizeof(buf));
+ }
+ return (buf);
+}
+
int main(int argc, char **argv)
{
int option, status, devcount;
diff --git a/gpsd.h-tail b/gpsd.h-tail
index 621aa08f..f39032b2 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -675,7 +675,6 @@ extern /*@ observer @*/ char *gpsd_hexdump(/*@null@*/char *, size_t);
extern int gpsd_hexpack(/*@in@*/const char *, /*@out@*/char *, size_t);
extern int hex2bin(const char *);
extern ssize_t hex_escapes(/*@out@*/char *, const char *);
-extern char /*@observer@*/ *gpsd_id(/*@in@*/struct gps_device_t *);
extern void gpsd_position_fix_dump(struct gps_device_t *,
/*@out@*/char[], size_t);
extern void gpsd_clear_data(struct gps_device_t *);
diff --git a/libgpsd_core.c b/libgpsd_core.c
index ba3ceebb..f1ccebc9 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -344,21 +344,6 @@ int gpsd_activate(struct gps_device_t *session)
/*@ +branchstate @*/
-char /*@observer@*/ *gpsd_id( /*@in@ */ struct gps_device_t *session)
-/* full ID of the device for reports, including subtype */
-{
- static char buf[128];
- if ((session == NULL) || (session->device_type == NULL) ||
- (session->device_type->type_name == NULL))
- return "unknown,";
- (void)strlcpy(buf, session->device_type->type_name, sizeof(buf));
- if (session->subtype[0] != '\0') {
- (void)strlcat(buf, " ", sizeof(buf));
- (void)strlcat(buf, session->subtype, sizeof(buf));
- }
- return (buf);
-}
-
void clear_dop( /*@out@*/ struct dop_t *dop)
{
dop->xdop = dop->ydop = dop->vdop = dop->tdop = dop->hdop = dop->pdop =