mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Core: Implement same_weightsystem() function to compare weights
This will be used later when joining and editing dives. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ca4103ea6a
commit
efdb3503ea
2 changed files with 7 additions and 0 deletions
|
@ -72,6 +72,12 @@ void add_weightsystem_description(const weightsystem_t *weightsystem)
|
|||
}
|
||||
}
|
||||
|
||||
bool same_weightsystem(weightsystem_t w1, weightsystem_t w2)
|
||||
{
|
||||
return w1->weight.grams == w2->weight.grams &&
|
||||
same_string(w1->description, w2->description);
|
||||
}
|
||||
|
||||
bool cylinder_nodata(const cylinder_t *cyl)
|
||||
{
|
||||
return !cyl->type.size.mliter &&
|
||||
|
|
|
@ -47,6 +47,7 @@ typedef struct
|
|||
extern int cylinderuse_from_text(const char *text);
|
||||
extern void add_cylinder_description(const cylinder_type_t *);
|
||||
extern void add_weightsystem_description(const weightsystem_t *);
|
||||
extern bool same_weightsystem(weightsystem_t w1, weightsystem_t w2);
|
||||
extern bool cylinder_nodata(const cylinder_t *cyl);
|
||||
extern bool cylinder_none(const cylinder_t *cyl);
|
||||
extern bool weightsystem_none(const weightsystem_t *ws);
|
||||
|
|
Loading…
Add table
Reference in a new issue