From 931c9386c21d2717b9fa6e48b2e663e8cbb1f77a Mon Sep 17 00:00:00 2001 From: Green Sky Date: Sun, 4 Feb 2024 12:49:04 +0100 Subject: [PATCH] updates and move zox plugs to their repo --- external/solanaceae_llama-cpp-web | 2 +- external/solanaceae_plugin | 2 +- external/solanaceae_zox | 2 +- external/totato | 2 +- plugins/CMakeLists.txt | 24 ------------ plugins/plugin_zox_ngc.cpp | 59 ---------------------------- plugins/plugin_zox_ngc_hs.cpp | 65 ------------------------------- 7 files changed, 4 insertions(+), 152 deletions(-) delete mode 100644 plugins/plugin_zox_ngc.cpp delete mode 100644 plugins/plugin_zox_ngc_hs.cpp diff --git a/external/solanaceae_llama-cpp-web b/external/solanaceae_llama-cpp-web index eba657c..4dc877e 160000 --- a/external/solanaceae_llama-cpp-web +++ b/external/solanaceae_llama-cpp-web @@ -1 +1 @@ -Subproject commit eba657c484613d0102d62cddcc7f492d154a0b95 +Subproject commit 4dc877ef68a4e100f067c6696ed9e4169e4d70b6 diff --git a/external/solanaceae_plugin b/external/solanaceae_plugin index 17ffaee..82cfb6d 160000 --- a/external/solanaceae_plugin +++ b/external/solanaceae_plugin @@ -1 +1 @@ -Subproject commit 17ffaee013d97412eab2395cb9555ca3213c5302 +Subproject commit 82cfb6d4920a2d6eb19e3f3560b20ec281a5fa81 diff --git a/external/solanaceae_zox b/external/solanaceae_zox index 6a48ace..d948897 160000 --- a/external/solanaceae_zox +++ b/external/solanaceae_zox @@ -1 +1 @@ -Subproject commit 6a48ace06f296b1a113890d80ffa5c19f2f4f58c +Subproject commit d948897c3e0713b53d2aebea1fb7b2950109c662 diff --git a/external/totato b/external/totato index 8b3af55..949929f 160000 --- a/external/totato +++ b/external/totato @@ -1 +1 @@ -Subproject commit 8b3af55834517bddce3ff9944b21c0195a7c67d9 +Subproject commit 949929f490db78ccbbc41f3f851b96d379fbe67e diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 8b8ac01..d94f77a 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -15,30 +15,6 @@ target_link_libraries(plugin_ngcft1 PUBLIC ######################################## -add_library(plugin_zox_ngc SHARED - ./plugin_zox_ngc.cpp -) -set_property(TARGET plugin_zox_ngc PROPERTY C_VISIBILITY_PRESET hidden) - -target_link_libraries(plugin_zox_ngc PUBLIC - solanaceae_plugin - solanaceae_zox -) - -######################################## - -add_library(plugin_zox_ngc_hs SHARED - ./plugin_zox_ngc_hs.cpp -) -set_property(TARGET plugin_zox_ngc_hs PROPERTY C_VISIBILITY_PRESET hidden) - -target_link_libraries(plugin_zox_ngc_hs PUBLIC - solanaceae_plugin - solanaceae_zox -) - -######################################## - add_library(plugin_transfer_auto_accept SHARED ./plugin_transfer_auto_accept.cpp ./transfer_auto_accept.hpp diff --git a/plugins/plugin_zox_ngc.cpp b/plugins/plugin_zox_ngc.cpp deleted file mode 100644 index 389b519..0000000 --- a/plugins/plugin_zox_ngc.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include - -#include - -#include -#include -#include - -static std::unique_ptr g_zngc = nullptr; - -constexpr const char* plugin_name = "ZoxNGC"; - -extern "C" { - -SOLANA_PLUGIN_EXPORT const char* solana_plugin_get_name(void) { - return plugin_name; -} - -SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_get_version(void) { - return SOLANA_PLUGIN_VERSION; -} - -SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api) { - std::cout << "PLUGIN " << plugin_name << " START()\n"; - - if (solana_api == nullptr) { - return 1; - } - - try { - auto* tox_event_provider_i = PLUG_RESOLVE_INSTANCE(ToxEventProviderI); - - // static store, could be anywhere tho - // construct with fetched dependencies - g_zngc = std::make_unique(*tox_event_provider_i); - - // register types - PLUG_PROVIDE_INSTANCE(ZoxNGCEventProviderI, plugin_name, g_zngc.get()); - } catch (const ResolveException& e) { - std::cerr << "PLUGIN " << plugin_name << " " << e.what << "\n"; - return 2; - } - - return 0; -} - -SOLANA_PLUGIN_EXPORT void solana_plugin_stop(void) { - std::cout << "PLUGIN " << plugin_name << " STOP()\n"; - - g_zngc.reset(); -} - -SOLANA_PLUGIN_EXPORT float solana_plugin_tick(float delta) { - (void)delta; - return std::numeric_limits::max(); -} - -} // extern C - diff --git a/plugins/plugin_zox_ngc_hs.cpp b/plugins/plugin_zox_ngc_hs.cpp deleted file mode 100644 index 28e2a8d..0000000 --- a/plugins/plugin_zox_ngc_hs.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include - -#include -#include -#include -#include - -#include -#include - -static std::unique_ptr g_zngchs = nullptr; - -constexpr const char* plugin_name = "ZoxNGCHistorySync"; - -extern "C" { - -SOLANA_PLUGIN_EXPORT const char* solana_plugin_get_name(void) { - return plugin_name; -} - -SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_get_version(void) { - return SOLANA_PLUGIN_VERSION; -} - -SOLANA_PLUGIN_EXPORT uint32_t solana_plugin_start(struct SolanaAPI* solana_api) { - std::cout << "PLUGIN " << plugin_name << " START()\n"; - - if (solana_api == nullptr) { - return 1; - } - - try { - auto* tox_i = PLUG_RESOLVE_INSTANCE(ToxI); - auto* tox_event_provider_i = PLUG_RESOLVE_INSTANCE(ToxEventProviderI); - auto* zox_ngc_event_provider_i = PLUG_RESOLVE_INSTANCE(ZoxNGCEventProviderI); - auto* cr = PLUG_RESOLVE_INSTANCE_VERSIONED(Contact3Registry, "1"); - auto* tcm = PLUG_RESOLVE_INSTANCE(ToxContactModel2); - auto* rmm = PLUG_RESOLVE_INSTANCE(RegistryMessageModel); - - // static store, could be anywhere tho - // construct with fetched dependencies - g_zngchs = std::make_unique(*tox_event_provider_i, *zox_ngc_event_provider_i, *tox_i, *cr, *tcm, *rmm); - - // register types - PLUG_PROVIDE_INSTANCE(ZoxNGCHistorySync, plugin_name, g_zngchs.get()); - } catch (const ResolveException& e) { - std::cerr << "PLUGIN " << plugin_name << " " << e.what << "\n"; - return 2; - } - - return 0; -} - -SOLANA_PLUGIN_EXPORT void solana_plugin_stop(void) { - std::cout << "PLUGIN " << plugin_name << " STOP()\n"; - - g_zngchs.reset(); -} - -SOLANA_PLUGIN_EXPORT float solana_plugin_tick(float delta) { - return g_zngchs->tick(delta); -} - -} // extern C -