diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-02-28 22:45:17 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | 37146c5742503becf75468fb07aab56011cb9101 (patch) | |
tree | 666e4d609b3d9b882082fcc258d6d153c6c68fa5 /core/liquivision.c | |
parent | 926b6895bbce7cc539ca4d0c3a425876dfa33d6b (diff) | |
download | subsurface-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/liquivision.c')
-rw-r--r-- | core/liquivision.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/liquivision.c b/core/liquivision.c index bec4b771b..019f7613c 100644 --- a/core/liquivision.c +++ b/core/liquivision.c @@ -132,7 +132,7 @@ static int handle_event_ver3(int code, const unsigned char *ps, unsigned int ps_ return skip; } -static void parse_dives (int log_version, const unsigned char *buf, unsigned int buf_size, struct dive_table *table) +static void parse_dives(int log_version, const unsigned char *buf, unsigned int buf_size, struct dive_table *table, struct dive_site_table *sites) { unsigned int ptr = 0; unsigned char model; @@ -227,7 +227,7 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int // now that we have the dive time we can store the divesite // (we need the dive time to create deterministic uuids) if (found_divesite) { - dive->dive_site = find_or_create_dive_site_with_name(location, dive->when, &dive_site_table); + dive->dive_site = find_or_create_dive_site_with_name(location, dive->when, sites); free(location); } //unsigned int end_time = array_uint32_le(buf + ptr); @@ -441,7 +441,7 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int free(dive); } -int try_to_open_liquivision(const char *filename, struct memblock *mem, struct dive_table *table, struct trip_table *trips) +int try_to_open_liquivision(const char *filename, struct memblock *mem, struct dive_table *table, struct trip_table *trips, struct dive_site_table *sites) { UNUSED(filename); UNUSED(trips); @@ -466,7 +466,7 @@ int try_to_open_liquivision(const char *filename, struct memblock *mem, struct d } ptr += 4; - parse_dives(log_version, buf + ptr, buf_size - ptr, table); + parse_dives(log_version, buf + ptr, buf_size - ptr, table, sites); return 1; } |