From a6215294142785ee892959da35d1ff8294fe2802 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 28 Sep 2011 01:33:31 -0400 Subject: Break out prototypes for client library export methgods into a new heasder. All regression tests pass. All three exports work in gpxlogger. --- gps.h | 24 +----------------------- gpsutils.c | 1 + libgps.h | 31 +++++++++++++++++++++++++++++++ libgps_core.c | 1 + libgps_shm.c | 1 + libgps_sock.c | 1 + 6 files changed, 36 insertions(+), 23 deletions(-) create mode 100644 libgps.h diff --git a/gps.h b/gps.h index 2cf3b105..349ea905 100644 --- a/gps.h +++ b/gps.h @@ -1730,27 +1730,6 @@ extern int gps_stream(struct gps_data_t *, unsigned int, /*@null@*/void *); extern const char /*@observer@*/ *gps_data(const struct gps_data_t *); extern const char /*@observer@*/ *gps_errstr(const int); -extern int gps_sock_open(/*@null@*/const char *, /*@null@*/const char *, - /*@out@*/struct gps_data_t *); -extern int gps_sock_close(struct gps_data_t *); -extern int gps_sock_send(struct gps_data_t *, const char *); -extern int gps_sock_read(/*@out@*/struct gps_data_t *); -extern bool gps_sock_waiting(const struct gps_data_t *, int); -extern int gps_sock_stream(struct gps_data_t *, unsigned int, /*@null@*/void *); -extern const char /*@observer@*/ *gps_sock_data(const struct gps_data_t *); -extern int gps_sock_mainloop(struct gps_data_t *, int timeout, - void (*)(struct gps_data_t *)); -extern int gps_shm_mainloop(struct gps_data_t *, int timeout, - void (*)(struct gps_data_t *)); - -extern int gps_shm_open(/*@out@*/struct gps_data_t *); -extern void gps_shm_close(struct gps_data_t *); -extern int gps_shm_read(struct gps_data_t *); - -extern int gps_dbus_open(struct gps_data_t *); -extern int gps_dbus_mainloop(struct gps_data_t *, int timeout, - void (*)(struct gps_data_t *)); - /* dependencies on struct gpsdata_t end hrere */ extern void libgps_trace(int errlevel, const char *, ...); @@ -1763,7 +1742,6 @@ extern void gps_merge_fix(/*@ out @*/struct gps_fix_t *, extern void gps_enable_debug(int, FILE *); extern /*@observer@*/const char *gps_maskdump(gps_mask_t); - extern double safe_atof(const char *); extern time_t mkgmtime(register struct tm *); extern timestamp_t timestamp(void); @@ -1835,5 +1813,5 @@ size_t strlcpy(/*@out@*/char *dst, /*@in@*/const char *src, size_t size); } /* End of the 'extern "C"' block */ #endif -/* gps.h ends here */ #endif /* _GPSD_GPS_H_ */ +/* gps.h ends here */ diff --git a/gpsutils.c b/gpsutils.c index c358a78b..f301a2ae 100644 --- a/gpsutils.c +++ b/gpsutils.c @@ -13,6 +13,7 @@ #include #include "gpsd.h" /* could be gps.h if we didn't need splint decorations */ +#include "libgps.h" #ifdef USE_QT #include diff --git a/libgps.h b/libgps.h new file mode 100644 index 00000000..f571efa8 --- /dev/null +++ b/libgps.h @@ -0,0 +1,31 @@ +/* libgps.h -- prototypes for internals of the libgps library */ +/* + * This file is Copyright (c) 2010 by the GPSD project + * BSD terms apply: see the file COPYING in the distribution root for details. + */ +#ifndef _GPSD_LIBGPS_H_ +#define _GPSD_LIBGPS_H_ + +extern int gps_sock_open(/*@null@*/const char *, /*@null@*/const char *, + /*@out@*/struct gps_data_t *); +extern int gps_sock_close(struct gps_data_t *); +extern int gps_sock_send(struct gps_data_t *, const char *); +extern int gps_sock_read(/*@out@*/struct gps_data_t *); +extern bool gps_sock_waiting(const struct gps_data_t *, int); +extern int gps_sock_stream(struct gps_data_t *, unsigned int, /*@null@*/void *); +extern const char /*@observer@*/ *gps_sock_data(const struct gps_data_t *); +extern int gps_sock_mainloop(struct gps_data_t *, int timeout, + void (*)(struct gps_data_t *)); +extern int gps_shm_mainloop(struct gps_data_t *, int timeout, + void (*)(struct gps_data_t *)); + +extern int gps_shm_open(/*@out@*/struct gps_data_t *); +extern void gps_shm_close(struct gps_data_t *); +extern int gps_shm_read(struct gps_data_t *); + +extern int gps_dbus_open(struct gps_data_t *); +extern int gps_dbus_mainloop(struct gps_data_t *, int timeout, + void (*)(struct gps_data_t *)); + + +#endif /* _GPSD_LIBGPS_H_ */ diff --git a/libgps_core.c b/libgps_core.c index 6ea9f976..2196b0ab 100644 --- a/libgps_core.c +++ b/libgps_core.c @@ -15,6 +15,7 @@ #include #include "gpsd.h" +#include "libgps.h" #include "gps_json.h" #ifdef LIBGPS_DEBUG diff --git a/libgps_shm.c b/libgps_shm.c index 82c35968..a2a1735c 100644 --- a/libgps_shm.c +++ b/libgps_shm.c @@ -22,6 +22,7 @@ PERMISSIONS #include #include "gpsd.h" +#include "libgps.h" #ifdef SHM_EXPORT_ENABLE diff --git a/libgps_sock.c b/libgps_sock.c index ae4d45c3..42280fcb 100644 --- a/libgps_sock.c +++ b/libgps_sock.c @@ -31,6 +31,7 @@ #include "gps.h" #include "gpsd.h" +#include "libgps.h" #ifdef SOCKET_EXPORT_ENABLE #include "gps_json.h" -- cgit v1.2.1