aboutsummaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-11-24 16:50:21 -1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-25 13:04:59 -0800
commitc019da8fd5e09ee9efd7f158c68e8afaf7140e56 (patch)
tree2d15c51bc8fab4e898d2b7268baa4844888a3744 /dive.h
parent8d62f20aa0fccfe4ae6f0de6f5ccd1bcb0920075 (diff)
downloadsubsurface-c019da8fd5e09ee9efd7f158c68e8afaf7140e56.tar.gz
Add basic divecomputer info setup with xml parsing and saving
This also knows how to save and restore multiple dive computers in the XML data, but there's no way to actually *create* that kind of information yet (nor do we display it). Tested by creating fake XML files with multiple dive computers by hand so far. The dive computer information right now contains (apart from the sample and event data that we've always had): - the vendor and product name of the dive computer - the date of the dive according to the dive computer (so if you change the dive date manually, the dive computer date stays around) Note that if the dive computer date matches the dive date, we won't bother saving the redundant information in the XML file. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/dive.h b/dive.h
index 95f977da0..2e7841b45 100644
--- a/dive.h
+++ b/dive.h
@@ -43,6 +43,8 @@
* We don't actually use these all yet, so maybe they'll change, but
* I made a number of types as guidelines.
*/
+typedef gint64 timestamp_t;
+
typedef struct {
int seconds;
} duration_t;
@@ -238,10 +240,12 @@ struct event {
};
struct divecomputer {
+ timestamp_t when;
+ const char *vendor, *product;
int samples, alloc_samples;
struct sample *sample;
-
struct event *events;
+ struct divecomputer *next;
};
#define MAX_CYLINDERS (8)
@@ -249,7 +253,6 @@ struct divecomputer {
#define W_IDX_PRIMARY 0
#define W_IDX_SECONDARY 1
-typedef gint64 timestamp_t;
typedef enum { TF_NONE, NO_TRIP, IN_TRIP, AUTOGEN_TRIP, ASSIGNED_TRIP, NUM_TRIPFLAGS } tripflag_t;
extern const char *tripflag_names[NUM_TRIPFLAGS];