diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-07-15 21:25:26 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-15 21:25:26 -0700 |
commit | 1dbb6071bd0826790e8afb5be1020f42e257681b (patch) | |
tree | b72ad6fa658f66f0dc886d85a0d25bea9df9efe3 /divesite.c | |
parent | 542e04266d016c35e688e69d382204b7cefc3711 (diff) | |
download | subsurface-1dbb6071bd0826790e8afb5be1020f42e257681b.tar.gz |
Add helper function that checks if a dive site is in use
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divesite.c')
-rw-r--r-- | divesite.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/divesite.c b/divesite.c index b72672177..8bc9e04f7 100644 --- a/divesite.c +++ b/divesite.c @@ -108,6 +108,20 @@ struct dive_site *alloc_dive_site() return ds; } +bool is_dive_site_used(uint32_t uuid, bool select_only) +{ + int j; + bool found = false; + struct dive *d; + for_each_dive(j, d) { + if (d->dive_site_uuid == uuid && (!select_only || d->selected)) { + found = true; + break; + } + } + return found; +} + void delete_dive_site(uint32_t id) { int nr = dive_site_table.nr; |