aboutsummaryrefslogtreecommitdiffstats
path: root/divesite.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-18 13:34:05 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-18 13:34:05 -0700
commitbd4629b293e165c9fb8ba0c83ed1ff5016d2da94 (patch)
treee7fc7ea36e553cefa7d136fdaf29b9ba7f0a9a92 /divesite.c
parent021a151f0382e8b8cace463969bc9c3607661527 (diff)
downloadsubsurface-bd4629b293e165c9fb8ba0c83ed1ff5016d2da94.tar.gz
Add nr of dives at the site to completion string
I'm not convinced that this is useful enough to keep, but let's give it a try and see what people think. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divesite.c')
-rw-r--r--divesite.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/divesite.c b/divesite.c
index 8bc9e04f7..4348461c6 100644
--- a/divesite.c
+++ b/divesite.c
@@ -108,6 +108,19 @@ struct dive_site *alloc_dive_site()
return ds;
}
+int nr_of_dives_at_dive_site(uint32_t uuid, bool select_only)
+{
+ int j;
+ int nr = 0;
+ struct dive *d;
+ for_each_dive(j, d) {
+ if (d->dive_site_uuid == uuid && (!select_only || d->selected)) {
+ nr++;
+ }
+ }
+ return nr;
+}
+
bool is_dive_site_used(uint32_t uuid, bool select_only)
{
int j;