Get trip location from dive's dive site

This adds another useful helper function as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-02-12 12:49:25 -08:00
parent 0ce215e0d9
commit 7fb35c98d3
2 changed files with 11 additions and 4 deletions

8
dive.h
View file

@ -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;