mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
2d1d78ebfe
commit
cc33ff2fe2
2 changed files with 28 additions and 8 deletions
3
dive.h
3
dive.h
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue