summaryrefslogtreecommitdiffstats
path: root/save-git.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-06 11:23:34 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-07 13:00:14 -0800
commit4ccddf95d7660b9c2c91da1d72f08bd45988c83e (patch)
tree650029d8cb9fb8631478c93b4da6feada3c6e3a5 /save-git.c
parentd6b410940975c7ccaf63c3509eda4ff25d16190f (diff)
downloadsubsurface-4ccddf95d7660b9c2c91da1d72f08bd45988c83e.tar.gz
Load and save extra data in git format
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-git.c')
-rw-r--r--save-git.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/save-git.c b/save-git.c
index 555d66992..93348306e 100644
--- a/save-git.c
+++ b/save-git.c
@@ -119,6 +119,15 @@ static void save_tags(struct membuffer *b, struct tag_entry *tags)
put_string(b, "\n");
}
+static void save_extra_data(struct membuffer *b, struct extra_data *ed)
+{
+ while (ed) {
+ if (ed->key && ed->value)
+ put_format(b, "keyvalue \"%s\" \"%s\"\n", ed->key ? : "", ed->value ? : "");
+ ed = ed->next;
+ }
+}
+
static void put_gasmix(struct membuffer *b, struct gasmix *mix)
{
int o2 = mix->o2.permille;
@@ -334,6 +343,7 @@ static void save_dc(struct membuffer *b, struct dive *dive, struct divecomputer
save_salinity(b, dc);
put_duration(b, dc->surfacetime, "surfacetime ", "min\n");
+ save_extra_data(b, dc->extra_data);
save_events(b, dc->events);
save_samples(b, dc->samples, dc->sample);
}