diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-08 14:55:47 +0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-08 16:38:52 +0800 |
commit | cc33ff2fe212da4f20bb30060ee9996b3c357adc (patch) | |
tree | ae9ac856f63d30e50e414c7375316cd78d80c605 /dive.h | |
parent | 2d1d78ebfe3169b4893823764d1b29db84631006 (diff) | |
download | subsurface-cc33ff2fe212da4f20bb30060ee9996b3c357adc.tar.gz |
Add a string_to_depth() helper function to match our string_to_weight one
It's currently only used for the setting of the cylinder switching
depth, but now that one should work with user-specified units (so you
can set a max depth in feet even if you use metric, and vice versa).
In the future, if we also make the unit preferences something you can
pass in (with user preferences as a default argument value), we might
want to use this for parsing the XML too, so that we'd honor explicit
units in the XML strings. But the XML input unit preferences are not
necessarily at all the same as the user preferences, so that does
require us to extend the conversion functions to do possibly explicit
unit preference selection.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r-- | dive.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -816,6 +816,9 @@ extern double strtod_flags(const char *str, const char **ptr, unsigned int flags } #endif +extern weight_t string_to_weight(const char *str); +extern depth_t string_to_depth(const char *str); + #include "pref.h" #endif /* DIVE_H */ |