summaryrefslogtreecommitdiffstats
path: root/core/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-02-28 22:45:17 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 18:19:07 +0300
commit37146c5742503becf75468fb07aab56011cb9101 (patch)
tree666e4d609b3d9b882082fcc258d6d153c6c68fa5 /core/uemis-downloader.c
parent926b6895bbce7cc539ca4d0c3a425876dfa33d6b (diff)
downloadsubsurface-37146c5742503becf75468fb07aab56011cb9101.tar.gz
Parser: parse into custom dive site table
To extend the undo system to dive sites, the importers and downloaders must not parse directly into the global dive site table. Instead, pass a dive_site_table argument to parse into. For now, always pass the global dive_site_table so that this commit should not cause any functional change. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/uemis-downloader.c')
-rw-r--r--core/uemis-downloader.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/uemis-downloader.c b/core/uemis-downloader.c
index 36cac2c5a..ef7e070ce 100644
--- a/core/uemis-downloader.c
+++ b/core/uemis-downloader.c
@@ -993,7 +993,7 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char *
} else if (!is_log && dive && !strcmp(tag, "divespot_id")) {
int divespot_id = atoi(val);
if (divespot_id != -1) {
- struct dive_site *ds = create_dive_site("from Uemis", dive->when, &dive_site_table);
+ struct dive_site *ds = create_dive_site("from Uemis", dive->when, devdata->sites);
dive->dive_site = ds;
uemis_mark_divelocation(dive->dc.diveid, divespot_id, ds);
}
@@ -1174,7 +1174,7 @@ static bool load_uemis_divespot(const char *mountpath, int divespot_id)
return false;
}
-static void get_uemis_divespot(const char *mountpath, int divespot_id, struct dive *dive)
+static void get_uemis_divespot(device_data_t *devdata, const char *mountpath, int divespot_id, struct dive *dive)
{
struct dive_site *nds = dive->dive_site;
@@ -1191,11 +1191,11 @@ static void get_uemis_divespot(const char *mountpath, int divespot_id, struct di
* we search all existing divesites if we have one with the same name already. The function
* returns the first found which is luckily not the newly created.
*/
- ods = get_dive_site_by_name(nds->name, &dive_site_table);
+ ods = get_dive_site_by_name(nds->name, devdata->sites);
if (ods) {
/* if the uuid's are the same, the new site is a duplicate and can be deleted */
if (nds->uuid != ods->uuid) {
- delete_dive_site(nds, &dive_site_table);
+ delete_dive_site(nds, devdata->sites);
dive->dive_site = ods;
}
}
@@ -1204,7 +1204,7 @@ static void get_uemis_divespot(const char *mountpath, int divespot_id, struct di
/* if we can't load the dive site details, delete the site we
* created in process_raw_buffer
*/
- delete_dive_site(dive->dive_site, &dive_site_table);
+ delete_dive_site(dive->dive_site, devdata->sites);
}
}
}
@@ -1257,7 +1257,7 @@ static bool get_matching_dive(int idx, char *newmax, int *uemis_mem_status, devi
#endif
int divespot_id = uemis_get_divespot_id_by_diveid(dive->dc.diveid);
if (divespot_id >= 0)
- get_uemis_divespot(mountpath, divespot_id, dive);
+ get_uemis_divespot(data, mountpath, divespot_id, dive);
} else {
/* in this case we found a deleted file, so let's increment */