Core: add trip_table parameter to trip-functions

Currently trips are added to the global trip table. If we want to
make dive-import undoable, we should be able to parse trips of a
log-file into a distinct table. Therefore, add a trip_table
parameter to
	- insert_trip()
	- create_and_hookup_trip_from_dive()
	- autogroup_dives()
	- unregister_trip()
	- remove_dive_from_trip()

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-11-26 23:39:37 +01:00 committed by Dirk Hohndel
parent 7df8d8c888
commit ec37c71f5e
9 changed files with 45 additions and 46 deletions

View file

@ -28,10 +28,10 @@ extern void get_dive_gas(const struct dive *dive, int *o2_p, int *he_p, int *o2l
extern int get_divenr(const struct dive *dive);
extern int get_divesite_idx(const struct dive_site *ds);
extern struct dive_trip *unregister_dive_from_trip(struct dive *dive);
extern void remove_dive_from_trip(struct dive *dive);
extern void remove_dive_from_trip(struct dive *dive, struct trip_table *trip_table);
extern dive_trip_t *alloc_trip(void);
extern dive_trip_t *create_trip_from_dive(struct dive *dive);
extern dive_trip_t *create_and_hookup_trip_from_dive(struct dive *dive);
extern dive_trip_t *create_and_hookup_trip_from_dive(struct dive *dive, struct trip_table *trip_table);
extern dive_trip_t *get_dives_to_autogroup(struct dive_table *table, int start, int *from, int *to, bool *allocated);
extern dive_trip_t *get_trip_for_new_dive(struct dive *new_dive, bool *allocated);
extern bool consecutive_selected();