Methods to access plugins. More...
Go to the source code of this file.
Data Structures | |
struct | PluginList |
Linked list of active plugins. More... | |
struct | LoadAllContext |
Closure for find_libraries(). More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "util-plugin", __VA_ARGS__) |
Functions | |
static void | plugin_init (void) |
Setup libtool paths. More... | |
static void | plugin_fini (void) |
Shutdown libtool. More... | |
static GNUNET_PLUGIN_Callback | resolve_function (struct PluginList *plug, const char *name) |
Lookup a function in the plugin. More... | |
enum GNUNET_GenericReturnValue | GNUNET_PLUGIN_test (const char *library_name) |
Test if a plugin exists. More... | |
void * | GNUNET_PLUGIN_load (const char *library_name, void *arg) |
Setup plugin (runs the "init" callback and returns whatever "init" returned). More... | |
void * | GNUNET_PLUGIN_unload (const char *library_name, void *arg) |
Unload plugin (runs the "done" callback and returns whatever "done" returned). More... | |
static int | find_libraries (void *cls, const char *filename) |
Function called on each plugin in the directory. More... | |
void | GNUNET_PLUGIN_load_all (const char *basename, void *arg, GNUNET_PLUGIN_LoaderCallback cb, void *cb_cls) |
Load all compatible plugins with the given base name. More... | |
void | GNUNET_PLUGIN_load_all_in_context (const struct GNUNET_OS_ProjectData *ctx, const char *basename, void *arg, GNUNET_PLUGIN_LoaderCallback cb, void *cb_cls) |
Load all compatible plugins with the given base name while inside the given context (i.e. More... | |
Variables | |
static int | initialized |
Have we been initialized? More... | |
static char * | old_dlsearchpath |
Libtool search path before we started. More... | |
static struct PluginList * | plugins |
List of plugins we have loaded. More... | |
Methods to access plugins.
Definition in file plugin.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "util-plugin", __VA_ARGS__) |
|
static |
Setup libtool paths.
Definition at line 76 of file plugin.c.
References _, GNUNET_asprintf(), GNUNET_free, GNUNET_OS_installation_get_path(), GNUNET_OS_IPK_LIBDIR, GNUNET_strdup, and old_dlsearchpath.
Referenced by GNUNET_PLUGIN_load(), and GNUNET_PLUGIN_test().
|
static |
Shutdown libtool.
Definition at line 120 of file plugin.c.
References getenv(), GNUNET_free, and old_dlsearchpath.
Referenced by GNUNET_PLUGIN_unload().
|
static |
Lookup a function in the plugin.
plug | the plugin to check |
name | name of the symbol to look for |
Definition at line 141 of file plugin.c.
References _, GNUNET_asprintf(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, PluginList::handle, LOG, name, and PluginList::name.
Referenced by GNUNET_PLUGIN_load(), GNUNET_PLUGIN_test(), and GNUNET_PLUGIN_unload().
|
static |
Function called on each plugin in the directory.
Loads the plugins that match the given basename.
cls | the struct LoadAllContext describing which plugins to load and what to do with them |
filename | name of a plugin library to check |
Definition at line 321 of file plugin.c.
References LoadAllContext::arg, LoadAllContext::basename, LoadAllContext::cb, LoadAllContext::cb_cls, DIR_SEPARATOR_STR, filename, GNUNET_free, GNUNET_OK, GNUNET_PLUGIN_load(), and GNUNET_strdup.
Referenced by GNUNET_PLUGIN_load_all().
|
static |
Have we been initialized?
Definition at line 59 of file plugin.c.
Referenced by __attribute__(), GNUNET_PLUGIN_load(), GNUNET_PLUGIN_test(), and GNUNET_PLUGIN_unload().
|
static |
Libtool search path before we started.
Definition at line 64 of file plugin.c.
Referenced by plugin_fini(), and plugin_init().
|
static |
List of plugins we have loaded.
Definition at line 69 of file plugin.c.
Referenced by extract_files(), GNUNET_PLUGIN_load(), GNUNET_PLUGIN_unload(), and main().