diff options
-rw-r--r-- | core/load-git.c | 4 | ||||
-rw-r--r-- | core/parse-xml.c | 2 | ||||
-rw-r--r-- | core/save-git.c | 3 | ||||
-rw-r--r-- | core/save-xml.c | 2 |
4 files changed, 10 insertions, 1 deletions
diff --git a/core/load-git.c b/core/load-git.c index e7732a69f..f9982a5e0 100644 --- a/core/load-git.c +++ b/core/load-git.c @@ -390,6 +390,10 @@ static void parse_cylinder_keyvalue(void *_cylinder, const char *key, const char cylinder->cylinder_use = cylinderuse_from_text(value); return; } + if (!strcmp(key, "depth")) { + cylinder->depth = get_depth(value); + return; + } report_error("Unknown cylinder key/value pair (%s/%s)", key, value); } diff --git a/core/parse-xml.c b/core/parse-xml.c index 49e477c0b..6fd298710 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -1467,6 +1467,8 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf) return; if (MATCH("use.cylinder", cylinder_use, &dive->cylinder[cur_cylinder_index].cylinder_use)) return; + if (MATCH("depth.cylinder", depth, &dive->cylinder[cur_cylinder_index].depth)) + return; if (MATCH("o2", gasmix, &dive->cylinder[cur_cylinder_index].gasmix.o2)) return; if (MATCH("o2percent", gasmix, &dive->cylinder[cur_cylinder_index].gasmix.o2)) diff --git a/core/save-git.c b/core/save-git.c index 7d7c8d9d2..4c80b3b29 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -157,7 +157,8 @@ static void save_cylinder_info(struct membuffer *b, struct dive *dive) put_pressure(b, cylinder->end, " end=", "bar"); if (cylinder->cylinder_use != OC_GAS) put_format(b, " use=%s", cylinderuse_text[cylinder->cylinder_use]); - + if (cylinder->depth.mm != 0) + put_milli(b, " depth='", cylinder->depth.mm, " m'"); put_string(b, "\n"); } } diff --git a/core/save-xml.c b/core/save-xml.c index fe1d73817..fa8ad8961 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -159,6 +159,8 @@ static void save_cylinder_info(struct membuffer *b, struct dive *dive) put_pressure(b, cylinder->end, " end='", " bar'"); if (cylinder->cylinder_use != OC_GAS) show_utf8(b, cylinderuse_text[cylinder->cylinder_use], " use='", "'", 1); + if (cylinder->depth.mm != 0) + put_milli(b, " depth='", cylinder->depth.mm, " m'"); put_format(b, " />\n"); } } |