summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar glerch <guido.lerch@gmail.com>2015-09-10 16:05:16 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-10 12:28:02 -0700
commitc0cbafdc939cb9141c33b1c0e836bba8144dd467 (patch)
treebd3d29b3f1f11ca7b7ee83e345db809de15940d8
parentbd00c6b83bec7a1fda93ec5594df957b0364668e (diff)
downloadsubsurface-c0cbafdc939cb9141c33b1c0e836bba8144dd467.tar.gz
Uemis downloader: new find divespot by diveid
New routine to support finding a dive spot based on the dive id, this is needed due to the weird way Uemis is providing data. This function will be used in the uemis-downloader.c within do_uemis_import. Signed-off-by: glerch <guido.lerch@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--uemis.c12
-rw-r--r--uemis.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/uemis.c b/uemis.c
index e60e94a00..1c592832a 100644
--- a/uemis.c
+++ b/uemis.c
@@ -155,6 +155,18 @@ void uemis_mark_divelocation(int diveid, int divespot, uint32_t dive_site_uuid)
hp->dive_site_uuid = dive_site_uuid;
}
+/* support finding a dive spot based on the diveid */
+int uemis_get_divespot_id_by_diveid(uint32_t diveid)
+{
+ struct uemis_helper *hp = uemis_helper;
+ while(hp) {
+ if (hp->diveid == diveid)
+ return hp->divespot;
+ hp = hp->next;
+ }
+ return 0;
+}
+
void uemis_set_divelocation(int divespot, char *text, double longitude, double latitude)
{
struct uemis_helper *hp = uemis_helper;
diff --git a/uemis.h b/uemis.h
index d19f293de..90ae99028 100644
--- a/uemis.h
+++ b/uemis.h
@@ -17,6 +17,7 @@ int uemis_get_weight_unit(int diveid);
void uemis_mark_divelocation(int diveid, int divespot, uint32_t dive_site_uuid);
void uemis_set_divelocation(int divespot, char *text, double longitude, double latitude);
void uemis_set_max_diveid_from_dialog(int diveid);
+int uemis_get_divespot_id_by_diveid(uint32_t diveid);
typedef struct
{