diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-07-14 15:33:28 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-14 15:33:28 -0700 |
commit | 9d622996bae40bf94feaa603282af973d48eeab1 (patch) | |
tree | e3d1f8a9e817b96a18979b88f6ba69bf3b797b2b /divesite.c | |
parent | 70656cddead4eaf3382d16af7be4898a34cbdec1 (diff) | |
parent | 536469107d94f265a03e44fcc755b92b9016cbca (diff) | |
download | subsurface-9d622996bae40bf94feaa603282af973d48eeab1.tar.gz |
Merge branch 'tomaz'
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divesite.c')
-rw-r--r-- | divesite.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/divesite.c b/divesite.c index 56479508b..b72672177 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); +} |