diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-20 06:45:12 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-20 06:45:12 -0700 |
commit | de35c886837016c80fc65043d8a2f0b373efec5b (patch) | |
tree | 87eaf634a88f557d88d9580d5b5ad759f9e1ceeb /divelist.c | |
parent | 70d4421cd0ab235ee4f37ed7f8b6ad863da703bb (diff) | |
download | subsurface-de35c886837016c80fc65043d8a2f0b373efec5b.tar.gz |
Track minimum datafile version
Add infrastructure and helper functions to track minimum datafile version.
To make this information useful we need to keep the XML and git data
format versions in track moving forward.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divelist.c')
-rw-r--r-- | divelist.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/divelist.c b/divelist.c index 468373591..953dd7839 100644 --- a/divelist.c +++ b/divelist.c @@ -1080,3 +1080,21 @@ void set_dive_nr_for_current_dive() else if (selected_dive == dive_table.nr - 1 && get_dive(dive_table.nr - 2)->number) current_dive->number = get_dive(dive_table.nr - 2)->number + 1; } + +static int min_datafile_version; + +int get_min_datafile_version() +{ + return min_datafile_version; +} + +void reset_min_datafile_version() +{ + min_datafile_version = 0; +} + +void report_datafile_version(int version) +{ + if (min_datafile_version == 0 || min_datafile_version > version) + min_datafile_version = version; +} |