i'm using libltdl in order to dynamically load plugin libraries. Been following this documentation, and after i call this
lt_dlhandle lt_dlopen (const char *filename)
i need to know what symbols are defined in this library. I need the list of symbols to pass it to
void * lt_dlsym (lt_dlhandle handle, const char *name)
Which requires a symbol name as an argument.
What is the way to get the lists of loadable exported symbols in my plugin?
Like said Matthieu M. in his comment, there is no native way to get a list of loaded symbols from a dynamic lib.
However, I usually use this workaround, which is to make your plugin declare the symbols in a container, and then to retrieve this container from your main program.
plugin.h
plugin.c
I only see 2 issues with this solution:
symbols
declared in plugin.c -> non thread-safe.