summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-06 19:07:17 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-06 19:07:17 -0700
commit05857e0a05bc15672ddd5e835714d2cd20405b97 (patch)
treeccebf7f5b18082538c7d8d9fe46ce9e329150da2 /dive.h
parenta5a3cba574d5f4a742f57eef590c44da6355d6f6 (diff)
downloadsubsurface-05857e0a05bc15672ddd5e835714d2cd20405b97.tar.gz
Start "output unit management" support
This doesn't actually *do* anything yet, but it introduces the notion of output units, and allows you to pick metric or imperial. Of course, since the output doesn't currently care, the units you pick are irrelevant. But just wait.. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index 82b336e53..ea8fceec1 100644
--- a/dive.h
+++ b/dive.h
@@ -126,6 +126,22 @@ struct dive {
struct sample sample[];
};
+/*
+ * We keep our internal data in well-specified units, but
+ * the input and output may come in some random format. This
+ * keeps track of those units.
+ */
+struct units {
+ enum { METERS, FEET } length;
+ enum { LITER, CUFT } volume;
+ enum { BAR, PSI, PASCAL } pressure;
+ enum { CELSIUS, FAHRENHEIT, KELVIN } temperature;
+ enum { KG, LBS } weight;
+};
+
+extern const struct units SI_units, IMPERIAL_units;
+extern struct units input_units, output_units;
+
extern int verbose;
struct dive_table {