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