diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-12 12:56:34 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-12 12:56:34 -0700 |
commit | aa416e3c96dfa53db5ae277e72f6a03821c45cac (patch) | |
tree | d0adaa4ac077f64fa08e084348281c49821ff3fe /dive.h | |
parent | d45db9fac7b3d2ea0426a96158432f54d938f5c7 (diff) | |
download | subsurface-aa416e3c96dfa53db5ae277e72f6a03821c45cac.tar.gz |
Abstract out dive/sample allocation a bit
We're going to start to want to allocate dives and samples for the
libdivecomputer import too, so let's clean things up a bit for that.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'dive.h')
-rw-r--r-- | dive.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -137,7 +137,7 @@ struct dive { depth_t visibility; temperature_t airtemp, watertemp; cylinder_t cylinder[MAX_CYLINDERS]; - int samples; + int samples, alloc_samples; struct sample sample[]; }; @@ -193,6 +193,12 @@ static inline unsigned int dive_size(int samples) return sizeof(struct dive) + samples*sizeof(struct sample); } +extern struct dive *alloc_dive(void); +extern void record_dive(struct dive *dive); + +extern struct sample *prepare_sample(struct dive **divep); +extern void finish_sample(struct dive *dive, struct sample *sample); + extern struct dive *fixup_dive(struct dive *dive); extern struct dive *try_to_merge(struct dive *a, struct dive *b); |