diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-23 16:51:27 -1000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-11-23 19:36:27 -0800 |
commit | 25b4fee655e847081031fffb60d0d4d04ab1a8ee (patch) | |
tree | 0217294aa7b15b55ea170294126ed86937eda271 /dive.h | |
parent | a9786564c23fbf032f47096f543699c8c402785b (diff) | |
download | subsurface-25b4fee655e847081031fffb60d0d4d04ab1a8ee.tar.gz |
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 <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r-- | dive.h | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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 */ |