Why not export a struct with function pointers like everyone else? You should take a look at how VST plugins are implemented. You load the dlo, call a function passing in your own struct of application functions and get back a struct of plugin functions. No weird naming conventions needed, easily version-able. Tried and true.
Plugins in C
11–12 of 12 posts
Re: Plugins in C
#12Why not export a struct with function pointers like everyone else? You should take a look at how VST plugins are implemented. You load the dlo, call a function passing in your own struct of application functions and get back a struct of plugin functions. No weird naming conventions needed, easily version-able. Tried and true.
Do you mean the plugins calling PluginManager functions to register hooks? I just wanted to present a simple method without a lot of code. Using structs is an alternative, more convenient in some cases. One problem with it is that it imposes an ABI, while one registration function per hook does not.
Anyhow, this was just a basic example showing how plugins can work. I do plan to explore alternatives in the future, and specifically looking at existing pluggable applications (Apache, for instance)