diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-11-06 10:34:19 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-07 12:59:15 -0800 |
commit | d6b410940975c7ccaf63c3509eda4ff25d16190f (patch) | |
tree | 5542de55997a256c1d168a404aaa231853715210 /save-xml.c | |
parent | 9aefaa1ec87aff88bb1170bd6a79b76d351f804f (diff) | |
download | subsurface-d6b410940975c7ccaf63c3509eda4ff25d16190f.tar.gz |
Load and save extra data in Subsurface XML format
Includes test dive to test missing attributes and the overall syntax.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-xml.c')
-rw-r--r-- | save-xml.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/save-xml.c b/save-xml.c index dc85d328b..a128cf04d 100644 --- a/save-xml.c +++ b/save-xml.c @@ -301,6 +301,19 @@ static void save_tags(struct membuffer *b, struct tag_entry *entry) } } +static void save_extra_data(struct membuffer *b, struct extra_data *ed) +{ + while (ed) { + if (ed->key && ed->value) { + put_string(b, " <extradata"); + show_utf8(b, ed->key, " key='", "'", 1); + show_utf8(b, ed->value, " value='", "'", 1); + put_string(b, " />\n"); + } + ed = ed->next; + } +} + static void show_date(struct membuffer *b, timestamp_t when) { struct tm tm; @@ -341,7 +354,7 @@ static void save_dc(struct membuffer *b, struct dive *dive, struct divecomputer save_airpressure(b, dc); save_salinity(b, dc); put_duration(b, dc->surfacetime, " <surfacetime>", " min</surfacetime>\n"); - + save_extra_data(b, dc->extra_data); save_events(b, dc->events); save_samples(b, dc->samples, dc->sample); |