summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-02 16:40:28 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-02 16:40:28 -0700
commit5f05173e793d49319c727240014b59a04bd4075c (patch)
tree166aa17ed74dadf70b9a78cb3385d92d610a7e41 /dive.h
parentef0d00e76a2343f5d730eff3381d6715e3134ae8 (diff)
downloadsubsurface-5f05173e793d49319c727240014b59a04bd4075c.tar.gz
Do a dive de-dup pass
If given multiple dives at the same time, just de-dup the dives. This happens when you've dumped the whole dive-computer several times, and some dives show up in multiple dumps. When de-duping, try to avoid dropping data. So if one dive has notes attached to it, and the other one does not, pick the notes from the dive that does have them. Obvious stuff like that. The sample merge is also written so that it should be possible to merge two dives. Which we don't actually do yet. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index c1b95e3f6..eaafe8aeb 100644
--- a/dive.h
+++ b/dive.h
@@ -138,4 +138,9 @@ extern void parse_xml_file(const char *filename);
extern void flush_dive_info_changes(void);
extern void save_dives(const char *filename);
+static inline unsigned int dive_size(int samples)
+{
+ return sizeof(struct dive) + samples*sizeof(struct sample);
+}
+
#endif /* DIVE_H */