Похожие чаты

I'M doubting a lot about doing a refactor on a

plugin system I'm writing, I have the following architecture:

program.exe // contains the main and it's linked dynamically to core.so

core.so // contains the plugin system manager and the host functionality

plugin.so // it's a plugin, not linked to anything, dynamically loaded by core.so

I'm doubting how to expose the host functionality to the plugins:

1) Rely on the linker (I fear this option because it may not be portable)

2) Rely on dlsym/GetProcAddress over the current process

3) Inject with a struct of pointers to functions the API from the host to the plugin in the initialization / register entry point

1 and 2: May work without big refactors but may not be portable
3: May imply a fully refactor of all plugins

What do you think about it? What option would you choose? Do you know any other option?

PD: All exposed APIs (plugins/host) are written in C for improving portability.

4 ответов

7 просмотров

Boost::dll to the rescue.

Parra- Автор вопроса
Пользователь 61653
Boost::dll to the rescue.

that's already solved, I've got my own cross platform implementation for dlopen/GetProcAddress

Parra- Автор вопроса
Пользователь 61653
THen just use no 2.

Redis does something like that: https://github.com/RedisLabs/RedisModulesSDK/blob/c0740b8209abae38775adc6f3fefe05a520be55b/redismodule.h#L791

Похожие вопросы

Обсуждают сегодня

читать файл максимально быстро? странный вопрос))
zamtmn
53
Посоветуйте пожалуйста аудио плеер для библиотеки mp3- FLAC на компьютере. На Винде пользовался Aimp, в том числе для конвертации. Много нужных команд было прямо в контекст...
Виктор Кузнецов
31
How Much Btc Falling Down ?
Suriya
22
It is definitely an interesting conversation. Breaking up the users into 2 personas: 1. Someone who wants to use the products (I want “x” pegged stablecoin that provides safe...
Bueno Pues
10
Привет. Сразу скажу, что на C/C++/Rust я не пишу, но тем не менее возникла потребность дебага C/C++/Rust кода. Суть: есть серверное приложение, которое периодически ведёт себ...
ninekeem 🐳
4
So, does this mean leap 6 is closed source now? https://github.com/AntelopeIO/spring/blob/main/LICENSE
Kameron James | zeos.one
20
А чего сейчас в моде вместо Error для эксепшенов? А то я тут внезапно узрел что он не рекомендуется :) У Try::Tiny какой-то совершенно ужасный синтаксис если надо конкретные э...
Denis F
16
Ajeeb aadmi hai, isko padhna nahi aata kya?
Jay Bansal
43
Guys is any possible go up? Shib
Prem Kumar
21
@LGCYMan @JustinKKW Q/A List 1. this part confuses me on #8: "From there, a bridge between erc20 LGXY and erc20 LGXY will be out once that swap is closed." does this mean ...
Sig | LGXY | BattleVerse L1 | BitWin
1
Карта сайта