summaryrefslogtreecommitdiffstats
path: root/divesite.c
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-06-26 14:40:12 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-26 18:50:22 -0700
commit2fec1a88de2a075fd9586f5fb5c57b5bab2a74a6 (patch)
treec4d8690c1734b0b97be4522b27d4546b51b6f12a /divesite.c
parent09f2d3b35de0fc687290eece9f94e9106cc3a7aa (diff)
downloadsubsurface-2fec1a88de2a075fd9586f5fb5c57b5bab2a74a6.tar.gz
Dive site rewrite: copy the current dive to the displayed dive
This way we can actually edit something. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> 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 e096c7172..0abd664c0 100644
--- a/divesite.c
+++ b/divesite.c
@@ -156,3 +156,16 @@ bool dive_site_is_empty(struct dive_site *ds)
ds->latitude.udeg == 0 &&
ds->longitude.udeg == 0;
}
+
+void copy_dive_site(struct dive_site *orig, struct dive_site *copy)
+{
+ free(copy->name);
+ free(copy->notes);
+ free(copy->description);
+
+ copy->latitude = orig->latitude;
+ copy->longitude = orig->longitude;
+ copy->name = copy_string(orig->name);
+ copy->notes = copy_string(orig->notes);
+ copy->description = copy_string(orig->description);
+}