diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-09-28 01:33:31 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-09-28 01:33:31 -0400 |
commit | a6215294142785ee892959da35d1ff8294fe2802 (patch) | |
tree | 897bc670404dc0dc6f801d3e1fee69301f125887 | |
parent | 6b0650169ade1c34425fec5a9605a0b651b3b0b4 (diff) | |
download | gpsd-a6215294142785ee892959da35d1ff8294fe2802.tar.gz |
Break out prototypes for client library export methgods into a new heasder.
All regression tests pass. All three exports work in gpxlogger.
-rw-r--r-- | gps.h | 24 | ||||
-rw-r--r-- | gpsutils.c | 1 | ||||
-rw-r--r-- | libgps.h | 31 | ||||
-rw-r--r-- | libgps_core.c | 1 | ||||
-rw-r--r-- | libgps_shm.c | 1 | ||||
-rw-r--r-- | libgps_sock.c | 1 |
6 files changed, 36 insertions, 23 deletions
@@ -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 */ @@ -13,6 +13,7 @@ #include <ctype.h> #include "gpsd.h" /* could be gps.h if we didn't need splint decorations */ +#include "libgps.h" #ifdef USE_QT #include <QDateTime> 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 <stdarg.h> #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 <sys/shm.h> #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" |