summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-16 22:11:34 +0000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-16 22:13:12 +0000
commit202c5cbfeb6888b05ae4b14b4f563666bc6ca763 (patch)
treee99552b1afb08bf86e50a930ba7c8f1c4eb9fc4e /parse-xml.c
parent84dc8b8962ae8a4a75ca1ec81acd09989f757c98 (diff)
downloadsubsurface-202c5cbfeb6888b05ae4b14b4f563666bc6ca763.tar.gz
Save CCR cylinder use in XML and git
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 0b17db79e..70ac63ee2 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -317,6 +317,16 @@ static void pressure(char *buffer, pressure_t *pressure)
}
}
+static void cylinder_use(char *buffer, enum cylinderuse *cyl_use)
+{
+ for (enum cylinderuse i = 0; i < NUM_GAS_USE; i++) {
+ if (same_string(buffer, cylinderuse_text[i])) {
+ *cyl_use = i;
+ return;
+ }
+ }
+}
+
static void salinity(char *buffer, int *salinity)
{
union int_or_float val;
@@ -1226,6 +1236,8 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf)
return;
if (MATCH("end.cylinder", pressure, &dive->cylinder[cur_cylinder_index].end))
return;
+ if (MATCH("use.cylinder", cylinder_use, &dive->cylinder[cur_cylinder_index].cylinder_use))
+ return;
if (MATCH("description.weightsystem", utf8_string, &dive->weightsystem[cur_ws_index].description))
return;
if (MATCH("weight.weightsystem", weight, &dive->weightsystem[cur_ws_index].weight))