From 25b4fee655e847081031fffb60d0d4d04ab1a8ee Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2012 16:51:27 -1000 Subject: Move events and samples into a 'struct divecomputer' For now we only have one fixed divecomputer associated with each dive, so this doesn't really change any current semantics. But it will make it easier for us to associate a dive with multiple dive computers. Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- dive.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'dive.h') diff --git a/dive.h b/dive.h index adf266b45..95f977da0 100644 --- a/dive.h +++ b/dive.h @@ -237,6 +237,13 @@ struct event { char name[]; }; +struct divecomputer { + int samples, alloc_samples; + struct sample *sample; + + struct event *events; +}; + #define MAX_CYLINDERS (8) #define MAX_WEIGHTSYSTEMS (4) #define W_IDX_PRIMARY 0 @@ -279,9 +286,9 @@ struct dive { weightsystem_t weightsystem[MAX_WEIGHTSYSTEMS]; char *suit; int sac, otu; - struct event *events; - int samples, alloc_samples; - struct sample *sample; + + /* Eventually we'll do multiple dive computers */ + struct divecomputer dc; }; /* Pa = N/m^2 - so we determine the weight (in N) of the mass of 10m @@ -422,8 +429,8 @@ extern struct dive *alloc_dive(void); extern void record_dive(struct dive *dive); extern void delete_dive(struct dive *dive); -extern struct sample *prepare_sample(struct dive *dive); -extern void finish_sample(struct dive *dive); +extern struct sample *prepare_sample(struct divecomputer *dc); +extern void finish_sample(struct divecomputer *dc); extern void report_dives(gboolean imported, gboolean prefer_imported); extern struct dive *fixup_dive(struct dive *dive); @@ -432,7 +439,7 @@ extern struct dive *try_to_merge(struct dive *a, struct dive *b, gboolean prefer extern void renumber_dives(int nr); -extern void add_event(struct dive *dive, int time, int type, int flags, int value, const char *name); +extern void add_event(struct divecomputer *dc, int time, int type, int flags, int value, const char *name); /* UI related protopypes */ -- cgit v1.2.3-70-g09d2