From fa4298d790b2a2adf19435239b96664cc40a09a8 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Thu, 18 Jan 2024 00:29:55 +0100 Subject: [PATCH] interface versions --- solanaceae/toxcore/tox_event_interface.hpp | 2 ++ solanaceae/toxcore/tox_interface.hpp | 4 ++++ solanaceae/toxcore/tox_private_interface.hpp | 2 ++ 3 files changed, 8 insertions(+) diff --git a/solanaceae/toxcore/tox_event_interface.hpp b/solanaceae/toxcore/tox_event_interface.hpp index 88b345b..4777bae 100644 --- a/solanaceae/toxcore/tox_event_interface.hpp +++ b/solanaceae/toxcore/tox_event_interface.hpp @@ -62,6 +62,8 @@ struct ToxEventI { // defines the interface where to subscribe struct ToxEventProviderI { + static constexpr const char* version {"1"}; + virtual ~ToxEventProviderI(void) {} // TODO: unsub virtual void subscribe(ToxEventI* object, const Tox_Event_Type event_type) = 0; diff --git a/solanaceae/toxcore/tox_interface.hpp b/solanaceae/toxcore/tox_interface.hpp index f8e3553..3a13eec 100644 --- a/solanaceae/toxcore/tox_interface.hpp +++ b/solanaceae/toxcore/tox_interface.hpp @@ -14,6 +14,8 @@ // defines the full interface for tox // HACK: raw struct ToxI_raw { + static constexpr const char* version {"6"}; + virtual ~ToxI_raw(void) {} // TODO: tox version @@ -177,6 +179,8 @@ struct ToxI_raw { // HACK: work around zppbits inability to pass string_view as parameter ( https://github.com/eyalz800/zpp_bits/issues/107 ) struct ToxI : public ToxI_raw { + static constexpr const char* version {ToxI_raw::version}; + Tox_Err_Set_Info toxSelfSetName_str(const std::string& name) { return toxSelfSetName(name); } diff --git a/solanaceae/toxcore/tox_private_interface.hpp b/solanaceae/toxcore/tox_private_interface.hpp index 29add51..7af91a3 100644 --- a/solanaceae/toxcore/tox_private_interface.hpp +++ b/solanaceae/toxcore/tox_private_interface.hpp @@ -4,6 +4,8 @@ // defines the private interface for tox struct ToxPrivateI { + static constexpr const char* version {"1"}; + virtual ~ToxPrivateI(void) {} virtual uint16_t toxDHTGetNumCloselist(void) = 0;