Dive site: create new dive site at location from GPS data

Some dive computers save GPS data. Currently, this is stored
by libdivecomputer in an "extra field". When generating a
new dive site for a dive try to use this data to place the
dive site.

To do so, create a "dive_get_gps_location()" function. This
function can be extended later to use e.g. event. When creating
a dive site, use the result of this function over a potential
pre-existing dive site.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-04-24 23:59:59 +02:00 committed by Dirk Hohndel
parent c529cfd361
commit bab7033ccb
3 changed files with 56 additions and 0 deletions

View file

@ -456,6 +456,7 @@ extern struct dive *get_dive_by_uniq_id(int id);
extern int get_idx_by_uniq_id(int id);
extern bool dive_site_has_gps_location(const struct dive_site *ds);
extern int dive_has_gps_location(const struct dive *dive);
extern location_t dive_get_gps_location(const struct dive *d);
extern int report_error(const char *fmt, ...);
extern void set_error_cb(void(*cb)(char *)); // Callback takes ownership of passed string