Похожие чаты

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 ответов

24 просмотра

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

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта