diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-03-04 23:20:29 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | c22fd9f4fd6699333629b8acb1e9c135a9783082 (patch) | |
tree | 7fad8249eb4fb3fa2797329716b1038d115a62d9 /core/divelist.h | |
parent | f2cdca7bccfcdfa04639600689b2b13b38b56898 (diff) | |
download | subsurface-c22fd9f4fd6699333629b8acb1e9c135a9783082.tar.gz |
Dive sites: prepare for dive site ref-counting
Add a dive site table to each dive site to keep track of dives
that have been added to a dive site. Add two functions to add
dives to / remove dives from dive sites.
Since dive sites now contain a dive table, the order of includes
had to be changed: "divesite.h" now includes "dive.h" and not
vice-versa. This caused some include churn.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/divelist.h')
-rw-r--r-- | core/divelist.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/divelist.h b/core/divelist.h index 1880856df..831d5a3c1 100644 --- a/core/divelist.h +++ b/core/divelist.h @@ -2,6 +2,8 @@ #ifndef DIVELIST_H #define DIVELIST_H +#include "dive.h" + #ifdef __cplusplus extern "C" { #endif @@ -9,8 +11,6 @@ extern "C" { /* this is used for both git and xml format */ #define DATAFORMAT_VERSION 3 -struct dive; - extern void update_cylinder_related_info(struct dive *); extern void mark_divelist_changed(bool); extern int unsaved_changes(void); @@ -33,10 +33,12 @@ extern char *get_dive_gas_string(const struct dive *dive); extern struct dive **grow_dive_table(struct dive_table *table); extern int dive_table_get_insertion_index(struct dive_table *table, struct dive *dive); +extern void add_to_dive_table(struct dive_table *table, int idx, struct dive *dive); extern void add_single_dive(int idx, struct dive *dive); extern void get_dive_gas(const struct dive *dive, int *o2_p, int *he_p, int *o2low_p); extern int get_divenr(const struct dive *dive); extern struct dive_trip *unregister_dive_from_trip(struct dive *dive); +extern void remove_dive(struct dive_table *table, const struct dive *dive); extern void remove_dive_from_trip(struct dive *dive, struct trip_table *trip_table_arg); extern dive_trip_t *alloc_trip(void); extern dive_trip_t *create_trip_from_dive(struct dive *dive); |