summaryrefslogtreecommitdiffstats
path: root/core/divelist.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-11-08 14:02:36 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-11-18 16:50:09 -0800
commitbc7afebc23477ef23f2b9741bf45b2180cbafe15 (patch)
treefbb52713f0d9b74f6db70b50ead1fa781a61f7e4 /core/divelist.h
parent0618aa737fde54e634d16273ec0246ced9c454aa (diff)
downloadsubsurface-bc7afebc23477ef23f2b9741bf45b2180cbafe15.tar.gz
Core: add add_dive_to_table() function
Up to now, dives were added to the global dive table with add_single_dive(). Split out the funtionality to add a dive to an arbitrary dive in the add_dive_to_table_function(). The difference compared to record_dive_to_table is that dives are added at a specific position or the sort-criterion given by dive_less_than(). This will allow to use a dive tabe for trips instead of a linked list. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/divelist.h')
-rw-r--r--core/divelist.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/divelist.h b/core/divelist.h
index 94774616e..f98587cff 100644
--- a/core/divelist.h
+++ b/core/divelist.h
@@ -22,7 +22,10 @@ extern void process_loaded_dives();
extern void process_imported_dives(struct dive_table *import_table, bool prefer_imported, bool downloaded);
extern char *get_dive_gas_string(const struct dive *dive);
-struct dive **grow_dive_table(struct dive_table *table);
+extern struct dive **grow_dive_table(struct dive_table *table);
+extern int dive_get_insertion_index(struct dive_table *table, struct dive *dive);
+extern void add_dive_to_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 int get_divesite_idx(const struct dive_site *ds);