summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index b6738d171..9d359fe18 100644
--- a/dive.h
+++ b/dive.h
@@ -471,6 +471,7 @@ extern struct dive_table dive_table;
extern int selected_dive;
#define current_dive (get_dive(selected_dive))
+#define current_dc (get_dive_dc(current_dive, dc_number))
static inline struct dive *get_gps_location(int nr, struct dive_table *table)
{
@@ -486,6 +487,16 @@ static inline struct dive *get_dive(int nr)
return dive_table.dives[nr];
}
+static inline struct divecomputer *get_dive_dc(struct dive *dive, int nr)
+{
+ struct divecomputer *dc = NULL;
+ if (nr >= 0)
+ dc = &dive->dc;
+ while (nr-- > 0)
+ dc = dc->next;
+ return dc;
+}
+
/*
* Iterate over each dive, with the first parameter being the index
* iterator variable, and the second one being the dive one.
@@ -670,6 +681,7 @@ void add_duration_to_nth_dp(struct diveplan *diveplan, int idx, int duration, gb
void add_depth_to_nth_dp(struct diveplan *diveplan, int idx, int depth);
void add_gas_to_nth_dp(struct diveplan *diveplan, int idx, int o2, int he);
void free_dps(struct divedatapoint *dp);
+void get_gas_string(int o2, int he, char *buf, int len);
#ifdef DEBUGFILE
extern char *debugfilename;