aboutsummaryrefslogtreecommitdiffstats
path: root/core/dive.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-11-08 16:58:33 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-11-18 16:50:09 -0800
commit6b283e598a3a08c6133d66b5d5617370296e7d0e (patch)
tree685ccf1fd839d72471b179bf12aa72d2bdcec7de /core/dive.h
parentbc7afebc23477ef23f2b9741bf45b2180cbafe15 (diff)
downloadsubsurface-6b283e598a3a08c6133d66b5d5617370296e7d0e.tar.gz
Dive list: replace dive-list of trips by a table
The dives of each trip were kept in a list. Replace this by a struct dive_table. This will make it significantly easier to keep the dives of a trip in sorted state. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/dive.h')
-rw-r--r--core/dive.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/core/dive.h b/core/dive.h
index 07223322f..790d39d7f 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -286,13 +286,18 @@ typedef enum {
NUM_TRIPFLAGS
} tripflag_t;
+struct dive_table {
+ int nr, allocated;
+ struct dive **dives;
+};
+
typedef struct dive_trip
{
timestamp_t when;
char *location;
char *notes;
- struct dive *dives;
- int nrdives, showndives;
+ struct dive_table dives;
+ int showndives;
/* Used by the io-routines to mark trips that have already been written. */
bool saved;
bool autogen;
@@ -306,7 +311,6 @@ struct dive {
int number;
tripflag_t tripflag;
dive_trip_t *divetrip;
- struct dive *next, **pprev;
bool selected;
bool hidden_by_filter;
timestamp_t when;
@@ -428,11 +432,6 @@ extern const struct units SI_units, IMPERIAL_units;
extern const struct units *get_units(void);
extern int run_survey, verbose, quit, force_root;
-struct dive_table {
- int nr, allocated;
- struct dive **dives;
-};
-
extern struct dive_table dive_table, downloadTable;
extern struct dive displayed_dive;
extern unsigned int dc_number;