mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add more infrastructure for a separate dive table
This will allow us to download the dives from the dive computer into a separate table just for that purpose and not into the main dive_table. I really dislike the code that's in place that dates back to the very earliest code written for Subsurface. Dumping the dives straight into the main dive_table seems really stupid to me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a92484e4ed
commit
6f25713408
3 changed files with 21 additions and 10 deletions
10
dive.h
10
dive.h
|
|
@ -506,6 +506,13 @@ static inline struct dive *get_dive(int nr)
|
|||
return dive_table.dives[nr];
|
||||
}
|
||||
|
||||
static inline struct dive *get_dive_from_table(int nr, struct dive_table *dt)
|
||||
{
|
||||
if (nr >= dt->nr || nr < 0)
|
||||
return NULL;
|
||||
return dt->dives[nr];
|
||||
}
|
||||
|
||||
static inline unsigned int number_of_computers(struct dive *dive)
|
||||
{
|
||||
unsigned int total_number = 0;
|
||||
|
|
@ -677,12 +684,15 @@ extern timestamp_t utc_mktime(struct tm *tm);
|
|||
extern void utc_mkdate(timestamp_t, struct tm *tm);
|
||||
|
||||
extern struct dive *alloc_dive(void);
|
||||
extern void record_dive_to_table(struct dive *dive, struct dive_table *table);
|
||||
extern void record_dive(struct dive *dive);
|
||||
extern void clear_dive(struct dive *dive);
|
||||
extern void copy_dive(struct dive *s, struct dive *d);
|
||||
extern void selective_copy_dive(struct dive *s, struct dive *d, struct dive_components what, bool clear);
|
||||
extern struct dive *clone_dive(struct dive *s);
|
||||
|
||||
extern void clear_table(struct dive_table *table);
|
||||
|
||||
extern struct sample *prepare_sample(struct divecomputer *dc);
|
||||
extern void finish_sample(struct divecomputer *dc);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue