2017-04-27 18:18:03 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2011-09-05 19:12:58 +00:00
|
|
|
#ifndef DIVELIST_H
|
|
|
|
#define DIVELIST_H
|
|
|
|
|
2013-04-01 10:51:49 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
2013-04-24 23:52:18 +00:00
|
|
|
#endif
|
2013-04-24 23:33:29 +00:00
|
|
|
|
2015-06-20 13:45:12 +00:00
|
|
|
/* this is used for both git and xml format */
|
|
|
|
#define DATAFORMAT_VERSION 3
|
|
|
|
|
2011-09-19 23:41:56 +00:00
|
|
|
struct dive;
|
|
|
|
|
2011-11-13 17:29:07 +00:00
|
|
|
extern void update_cylinder_related_info(struct dive *);
|
2011-09-21 04:29:09 +00:00
|
|
|
extern void mark_divelist_changed(int);
|
|
|
|
extern int unsaved_changes(void);
|
2012-09-03 04:48:30 +00:00
|
|
|
extern void remove_autogen_trips(void);
|
2017-11-22 19:42:33 +00:00
|
|
|
extern int init_decompression(struct deco_state *ds, struct dive *dive);
|
2013-04-07 03:49:06 +00:00
|
|
|
|
|
|
|
/* divelist core logic functions */
|
2013-04-24 23:33:29 +00:00
|
|
|
extern void process_dives(bool imported, bool prefer_imported);
|
2014-07-20 13:07:57 +00:00
|
|
|
extern char *get_dive_gas_string(struct dive *dive);
|
2013-10-07 20:43:17 +00:00
|
|
|
|
2013-04-07 03:49:06 +00:00
|
|
|
extern dive_trip_t *find_trip_by_idx(int idx);
|
2013-10-07 20:43:17 +00:00
|
|
|
|
2015-10-02 01:13:48 +00:00
|
|
|
struct dive **grow_dive_table(struct dive_table *table);
|
2013-04-07 03:49:06 +00:00
|
|
|
extern int trip_has_selected_dives(dive_trip_t *trip);
|
|
|
|
extern void get_dive_gas(struct dive *dive, int *o2_p, int *he_p, int *o2low_p);
|
|
|
|
extern int get_divenr(struct dive *dive);
|
2015-06-02 02:13:51 +00:00
|
|
|
extern int get_divesite_idx(struct dive_site *ds);
|
2013-04-07 03:49:06 +00:00
|
|
|
extern dive_trip_t *find_matching_trip(timestamp_t when);
|
2013-12-12 23:03:25 +00:00
|
|
|
extern void remove_dive_from_trip(struct dive *dive, short was_autogen);
|
2013-04-07 03:49:06 +00:00
|
|
|
extern dive_trip_t *create_and_hookup_trip_from_dive(struct dive *dive);
|
|
|
|
extern void autogroup_dives(void);
|
2013-09-24 04:57:28 +00:00
|
|
|
extern struct dive *merge_two_dives(struct dive *a, struct dive *b);
|
2013-09-24 10:42:40 +00:00
|
|
|
extern bool consecutive_selected();
|
2013-04-07 03:49:06 +00:00
|
|
|
extern void select_dive(int idx);
|
|
|
|
extern void deselect_dive(int idx);
|
2014-05-24 20:19:05 +00:00
|
|
|
extern void select_dives_in_trip(struct dive_trip *trip);
|
|
|
|
extern void deselect_dives_in_trip(struct dive_trip *trip);
|
2014-11-12 06:59:04 +00:00
|
|
|
extern void filter_dive(struct dive *d, bool shown);
|
2014-05-24 21:02:08 +00:00
|
|
|
extern void combine_trips(struct dive_trip *trip_a, struct dive_trip *trip_b);
|
2014-05-24 15:27:42 +00:00
|
|
|
extern void find_new_trip_start_time(dive_trip_t *trip);
|
|
|
|
extern struct dive *first_selected_dive();
|
|
|
|
extern struct dive *last_selected_dive();
|
|
|
|
extern bool is_trip_before_after(struct dive *dive, bool before);
|
2014-08-18 19:12:05 +00:00
|
|
|
extern void set_dive_nr_for_current_dive();
|
2013-04-07 03:49:06 +00:00
|
|
|
|
2015-06-20 13:45:12 +00:00
|
|
|
int get_min_datafile_version();
|
|
|
|
void reset_min_datafile_version();
|
|
|
|
void report_datafile_version(int version);
|
2016-04-14 12:34:19 +00:00
|
|
|
int get_dive_id_closest_to(timestamp_t when);
|
2015-07-24 20:18:30 +00:00
|
|
|
void clear_dive_file_data();
|
2015-06-20 13:45:12 +00:00
|
|
|
|
2013-04-07 03:49:06 +00:00
|
|
|
#ifdef DEBUG_TRIP
|
|
|
|
extern void dump_selection(void);
|
|
|
|
extern void dump_trip_list(void);
|
|
|
|
#endif
|
|
|
|
|
2013-04-01 10:51:49 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // DIVELIST_H
|