]> git.tdb.fi Git - ext/subsurface.git/blobdiff - dive.h
Start cleaning up dive accessors
[ext/subsurface.git] / dive.h
diff --git a/dive.h b/dive.h
index a8e3c319afd58cbc9011d910f17a409997d9f707..23e2f544c0a959158e161e53953fa6893c029d8a 100644 (file)
--- a/dive.h
+++ b/dive.h
@@ -121,6 +121,13 @@ struct dive_table {
 
 extern struct dive_table dive_table;
 
+static inline struct dive *get_dive(unsigned int nr)
+{
+       if (nr >= dive_table.nr)
+               return NULL;
+       return dive_table.dives[nr];
+}
+
 extern void parse_xml_init(void);
 extern void parse_xml_file(const char *filename);