mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
8352274758
commit
619d3fb1fd
8 changed files with 174 additions and 149 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue