aboutsummaryrefslogtreecommitdiffstats
path: root/core/equipment.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-06-04 13:52:48 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-06-19 13:11:10 -0700
commit619d3fb1fd4b7ab532537b7eca78f668d2ce381b (patch)
tree7a4575845be7b5a196a1450c370b660a18ef9e13 /core/equipment.h
parent83522747581500ef39005bc76b1048db1cd3bd29 (diff)
downloadsubsurface-619d3fb1fd4b7ab532537b7eca78f668d2ce381b.tar.gz
Cleanup: move gas-functions to own translation unit
But only functions that operate only on gases. Functions concerning cylinders or dives remain in dive.c or are moved to equipment.c Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/equipment.h')
-rw-r--r--core/equipment.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/core/equipment.h b/core/equipment.h
index 73e21b8ed..eb789ede8 100644
--- a/core/equipment.h
+++ b/core/equipment.h
@@ -2,7 +2,7 @@
#ifndef EQUIPMENT_H
#define EQUIPMENT_H
-#include "units.h"
+#include "gas.h"
#ifdef __cplusplus
extern "C" {
@@ -10,15 +10,6 @@ extern "C" {
struct dive;
-// o2 == 0 && he == 0 -> air
-// o2 < 0 -> invalid
-struct gasmix {
- fraction_t o2;
- fraction_t he;
-};
-static const struct gasmix gasmix_invalid = { { -1 }, { -1 } };
-static const struct gasmix gasmix_air = { { 0 }, { 0 } };
-
enum cylinderuse {OC_GAS, DILUENT, OXYGEN, NOT_USED, NUM_GAS_USE}; // The different uses for cylinders
typedef struct
@@ -63,6 +54,8 @@ extern bool weightsystem_none(const weightsystem_t *ws);
extern void remove_cylinder(struct dive *dive, int idx);
extern void remove_weightsystem(struct dive *dive, int idx);
extern void reset_cylinders(struct dive *dive, bool track_gas);
+extern int gas_volume(const cylinder_t *cyl, pressure_t p); /* Volume in mliter of a cylinder at pressure 'p' */
+extern int find_best_gasmix_match(struct gasmix mix, const cylinder_t array[], unsigned int used);
#ifdef DEBUG_CYL
extern void dump_cylinders(struct dive *dive, bool verbose);
#endif