summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-12 12:49:25 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-12 12:49:25 -0800
commit7fb35c98d3657407287e6674e7d20ff2525ef152 (patch)
treeb7c0c094dc01dfc72a8cc84a3df9f7dabbeba3af /dive.h
parent0ce215e0d90e8d7612917b75f73bb703b9ada9ae (diff)
downloadsubsurface-7fb35c98d3657407287e6674e7d20ff2525ef152.tar.gz
Get trip location from dive's dive site
This adds another useful helper function as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index 42cec6224..76ea4b597 100644
--- a/dive.h
+++ b/dive.h
@@ -512,6 +512,14 @@ static inline struct dive_site *get_dive_site_for_dive(struct dive *dive)
return NULL;
}
+static inline char *get_dive_location(struct dive *dive)
+{
+ struct dive_site *ds = get_dive_site_by_uuid(dive->dive_site_uuid);
+ if (ds && ds->name)
+ return ds->name;
+ return NULL;
+}
+
static inline unsigned int number_of_computers(struct dive *dive)
{
unsigned int total_number = 0;