Description
Hello!
I am not an expert on programming on Windows, so I am not too familiar with the special things that need to be taken care of when using LoadLibrary
, GetProcAddr
and FreeLibrary
- but I do know that for all the dl*()
functions.
While looking for a small abstraction above the two, I came across this library - but I actually closed the page down multiple times, but kept finding back here through Google and Github. Now, I can not really see how to properly utilize this library, as I see no docs...
What I want to do is implement native module loading for (the Wren programming language)[http://wren.io]. Therefore, I would need to do the following:
- Load a shared object (i.e.
mymodule.so
ormymodule.dll
- or on Macmymodule.dylib
) - Pick up a set of functions from it (to initialize and de-initialize)
- Unload the libraries at the end of the program's lifecycle.
The two main functions that need to be implemented are just there to properly bootstrap a module - it is supposed to return a struct
with a set of functions and configuration, while the de-initialization function does the opposite, and makes sure all handles/pointers are freed properly.
So, how do I realize this quickly using this library? I only want to load one module at a time and store them within a module cache, so I can iterate through that and destruct/free them at that moment?
Kind regards,
Ingwie.