summaryrefslogtreecommitdiffstats
path: root/divesite.c
diff options
context:
space:
mode:
Diffstat (limited to 'divesite.c')
-rw-r--r--divesite.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/divesite.c b/divesite.c
index 998fe23bf..800ccc9bd 100644
--- a/divesite.c
+++ b/divesite.c
@@ -200,3 +200,19 @@ void clear_dive_site(struct dive_site *ds)
ds->taxonomy.nr = 0;
free_taxonomy(&ds->taxonomy);
}
+
+uint32_t find_or_create_dive_site_with_name(const char *name)
+{
+ int i;
+ struct dive_site *ds;
+ bool found = false;
+ for_each_dive_site(i,ds) {
+ if (same_string(name, ds->name)) {
+ found = true;
+ break;
+ }
+ }
+ if (ds)
+ return ds->uuid;
+ return create_dive_site(name);
+}