gpsdclient.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * gpsdclient.h -- common functions for GPSD clients
  3. *
  4. * This file is Copyright 2010 by the GPSD project
  5. * SPDX-License-Identifier: BSD-2-clause
  6. *
  7. */
  8. #ifndef _GPSD_GPSDCLIENT_H_
  9. #define _GPSD_GPSDCLIENT_H_
  10. struct exportmethod_t
  11. /* describe an export method */
  12. {
  13. const char *name;
  14. const char *magic;
  15. const char *description;
  16. };
  17. struct fixsource_t
  18. /* describe a data source */
  19. {
  20. char *spec; /* pointer to actual storage */
  21. char *server;
  22. char *port;
  23. char *device;
  24. };
  25. struct exportmethod_t *export_lookup(const char *);
  26. struct exportmethod_t *export_default(void);
  27. void export_list(FILE *);
  28. enum unit {unspecified, imperial, nautical, metric};
  29. enum unit gpsd_units(void);
  30. enum deg_str_type { deg_dd, deg_ddmm, deg_ddmmss };
  31. /* Warning: deg_to_str() not thread safe */
  32. extern char *deg_to_str(enum deg_str_type type, double f);
  33. extern char *deg_to_str2(enum deg_str_type type, double f,
  34. char *buf, unsigned int buf_size,
  35. const char *suffix_pos, const char *suffix_neg);
  36. extern void gpsd_source_spec(const char *fromstring,
  37. struct fixsource_t *source);
  38. char *maidenhead(double n,double e);
  39. /* this needs to match JSON_DATE_MAX in gpsd.h */
  40. #define CLIENT_DATE_MAX 24
  41. #endif /* _GPSDCLIENT_H_ */
  42. /* gpsdclient.h ends here */
  43. // vim: set expandtab shiftwidth=4