aboutsummaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index 0552c31da..a402f9932 100644
--- a/dive.c
+++ b/dive.c
@@ -224,6 +224,30 @@ void copy_events(struct dive *s, struct dive *d)
}
}
+int nr_cylinders(struct dive *dive)
+{
+ int nr;
+
+ for (nr = MAX_CYLINDERS; nr; --nr) {
+ cylinder_t *cylinder = dive->cylinder + nr - 1;
+ if (!cylinder_nodata(cylinder))
+ break;
+ }
+ return nr;
+}
+
+int nr_weightsystems(struct dive *dive)
+{
+ int nr;
+
+ for (nr = MAX_WEIGHTSYSTEMS; nr; --nr) {
+ weightsystem_t *ws = dive->weightsystem + nr - 1;
+ if (!weightsystem_none(ws))
+ break;
+ }
+ return nr;
+}
+
void copy_cylinders(struct dive *s, struct dive *d)
{
int i;