aboutsummaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-10 09:20:57 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-10 10:26:06 -0800
commit92c0d8c5160232642571b52b66176594c796f21d (patch)
treed3b78a6deba3af0119b493dbfd0a8ec8c4a13304 /dive.h
parent54919c1c4ec94cd21150c5320fa0956d13df5904 (diff)
downloadsubsurface-92c0d8c5160232642571b52b66176594c796f21d.tar.gz
Move global variables covered by Preferences into one structure
Now we can simply remember the state of all the preferences at the beginning of preferences_dialog() and restore them if the user presses 'Cancel'. Fixes #21 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/dive.h b/dive.h
index 4cfa6fa38..487bc0d0e 100644
--- a/dive.h
+++ b/dive.h
@@ -390,9 +390,32 @@ struct units {
enum { KG, LBS } weight;
};
+/*
+ * We're going to default to SI units for input. Yes,
+ * technically the SI unit for pressure is Pascal, but
+ * we default to bar (10^5 pascal), which people
+ * actually use. Similarly, C instead of Kelvin.
+ * And kg instead of g.
+ */
+#define SI_UNITS { \
+ .length = METERS, \
+ .volume = LITER, \
+ .pressure = BAR, \
+ .temperature = CELSIUS, \
+ .weight = KG \
+}
+
+#define IMPERIAL_UNITS { \
+ .length = FEET, \
+ .volume = CUFT, \
+ .pressure = PSI, \
+ .temperature = FAHRENHEIT, \
+ .weight = LBS \
+}
extern const struct units SI_units, IMPERIAL_units;
-extern struct units input_units, output_units;
+extern struct units input_units;
+extern struct units *get_output_units(void);
extern int verbose;
struct dive_table {