Plugins in C
eli.thegreenplace.net
eli.thegreenplace.net
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.
Ultimately, the real problem is that teaching bad designs to people because they're new to the language is counterproductive.
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)
1. http://www.openwall.com/lists/musl/2012/08/20/1 2. http://www.openwall.com/lists/musl/2012/08/23/20
http://eli.thegreenplace.net/2012/08/07/fundamental-concepts...
bye