libgps.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* libgps.h -- prototypes for internals of the libgps library */
  2. /*
  3. * This file is Copyright 2010 by the GPSD project
  4. * SPDX-License-Identifier: BSD-2-clause
  5. */
  6. #ifndef _GPSD_LIBGPS_H_
  7. #define _GPSD_LIBGPS_H_
  8. /* values to poke in the gps_fd member if we get it via something special */
  9. #define SHM_PSEUDO_FD -1
  10. #define DBUS_PSEUDO_FD -2
  11. #include "gps.h"
  12. #include "gpsd_config.h"
  13. #include "compiler.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. extern int gps_sock_open(const char *, const char *,
  18. struct gps_data_t *);
  19. extern int gps_sock_close(struct gps_data_t *);
  20. extern int gps_sock_send(struct gps_data_t *, const char *);
  21. extern int gps_sock_read(struct gps_data_t *, char *message, int message_len);
  22. extern bool gps_sock_waiting(const struct gps_data_t *, int);
  23. extern int gps_sock_stream(struct gps_data_t *, unsigned int, void *);
  24. extern const char *gps_sock_data(const struct gps_data_t *);
  25. extern int gps_sock_mainloop(struct gps_data_t *, int,
  26. void (*)(struct gps_data_t *));
  27. extern int gps_shm_open(struct gps_data_t *);
  28. extern void gps_shm_close(struct gps_data_t *);
  29. extern bool gps_shm_waiting(const struct gps_data_t *, int);
  30. extern int gps_shm_read(struct gps_data_t *);
  31. extern int gps_shm_mainloop(struct gps_data_t *, int,
  32. void (*)(struct gps_data_t *));
  33. extern int gps_dbus_open(struct gps_data_t *);
  34. extern int gps_dbus_mainloop(struct gps_data_t *, int,
  35. void (*)(struct gps_data_t *));
  36. extern int json_ais_read(const char *, char *, size_t, struct ais_t *,
  37. const char **);
  38. /* debugging apparatus for the client library */
  39. #define DEBUG_CALLS 1 /* shallowest debug level */
  40. #define DEBUG_JSON 5 /* minimum level for verbose JSON debugging */
  41. #define libgps_debug_trace(args) (void) libgps_trace args
  42. extern int libgps_debuglevel;
  43. extern void libgps_dump_state(struct gps_data_t *);
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #define PRIVATE(gpsdata) ((struct privdata_t *)(gpsdata)->privdata)
  48. #endif /* _GPSD_LIBGPS_H_ */
  49. // vim: set expandtab shiftwidth=4