Devuan fork of gpsd
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

libgps.h 2.1 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* libgps.h -- prototypes for internals of the libgps library */
  2. /*
  3. * This file is Copyright (c) 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. #ifdef CLIENTDEBUG_ENABLE
  40. #define LIBGPS_DEBUG
  41. #endif /* CLIENTDEBUG_ENABLE */
  42. #ifdef LIBGPS_DEBUG
  43. #define DEBUG_CALLS 1 /* shallowest debug level */
  44. #define DEBUG_JSON 5 /* minimum level for verbose JSON debugging */
  45. # define libgps_debug_trace(args) (void) libgps_trace args
  46. extern int libgps_debuglevel;
  47. extern void libgps_dump_state(struct gps_data_t *);
  48. #else
  49. # define libgps_debug_trace(args) do { } while (0)
  50. #endif /* LIBGPS_DEBUG */
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #define PRIVATE(gpsdata) ((struct privdata_t *)(gpsdata)->privdata)
  55. #endif /* _GPSD_LIBGPS_H_ */