summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index 4eb81752f..e03399ec1 100644
--- a/dive.h
+++ b/dive.h
@@ -405,6 +405,16 @@ static inline struct dive *get_dive(int nr)
return dive_table.dives[nr];
}
+static inline struct dive *get_dive_by_diveid(int diveid, int deviceid)
+{
+ int i;
+ for (i = 0; i < dive_table.nr; i++)
+ if (dive_table.dives[i]->dc.diveid == diveid &&
+ dive_table.dives[i]->dc.deviceid == deviceid)
+ return dive_table.dives[i];
+ return NULL;
+}
+
/*
* Iterate over each dive, with the first parameter being the index
* iterator variable, and the second one being the dive one.