summaryrefslogtreecommitdiffstats
path: root/core/libdivecomputer.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/libdivecomputer.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/libdivecomputer.c')
-rw-r--r--core/libdivecomputer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c
index 668661ce8..0008f0dee 100644
--- a/core/libdivecomputer.c
+++ b/core/libdivecomputer.c
@@ -571,7 +571,7 @@ static void set_dc_serial(struct divecomputer *dc, const char *serial)
extern void parse_location(char *, location_t *);
-static void parse_string_field(struct dive *dive, dc_field_string_t *str)
+static void parse_string_field(device_data_t *devdata, struct dive *dive, dc_field_string_t *str)
{
// Our dive ID is the string hash of the "Dive ID" string
if (!strcmp(str->desc, "Dive ID")) {
@@ -596,7 +596,7 @@ static void parse_string_field(struct dive *dive, dc_field_string_t *str)
parse_location(line, &location);
if (location.lat.udeg && location.lon.udeg)
- dive->dive_site = create_dive_site_with_gps(str->value, &location, time(NULL), &dive_site_table);
+ dive->dive_site = create_dive_site_with_gps(str->value, &location, time(NULL), devdata->sites);
}
}
#endif
@@ -712,7 +712,7 @@ static dc_status_t libdc_header_parser(dc_parser_t *parser, device_data_t *devda
break;
if (!str.desc || !str.value)
break;
- parse_string_field(dive, &str);
+ parse_string_field(devdata, dive, &str);
}
#endif