core: convert taxonomy.c to C++

Since the taxonomy is now a real C++ struct with constructor
and destructor, dive_site has to be converted to C++ as well.

A bit hairy for now, but will ultimately be distinctly simpler.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-04 13:39:04 +02:00 committed by bstoeger
parent 3c1401785b
commit 3f8b4604be
39 changed files with 259 additions and 336 deletions

View file

@ -13,6 +13,7 @@
#include <stdlib.h>
#ifdef __cplusplus
#include <string>
extern "C" {
#endif
@ -114,7 +115,11 @@ extern depth_t gas_mnd(struct gasmix mix, depth_t end, const struct dive *dive,
extern struct dive *get_dive(int nr);
extern struct dive *get_dive_from_table(int nr, const struct dive_table *dt);
extern struct dive_site *get_dive_site_for_dive(const struct dive *dive);
extern const char *get_dive_country(const struct dive *dive);
#ifdef __cplusplus
} // TODO: remove
extern std::string get_dive_country(const struct dive *dive);
extern "C" {
#endif
extern const char *get_dive_location(const struct dive *dive);
extern unsigned int number_of_computers(const struct dive *dive);
extern struct divecomputer *get_dive_dc(struct dive *dive, int nr);
@ -227,7 +232,6 @@ extern void update_setpoint_events(const struct dive *dive, struct divecomputer
* QVariants and through QML.
*/
#include <QObject>
#include <string>
Q_DECLARE_METATYPE(struct dive *);
extern std::string existing_filename;