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... | |
static void * | open_library (const struct GNUNET_OS_ProjectData *pd, const char *library_name) |
Open library library_name using search path from pd. More... | |
enum GNUNET_GenericReturnValue | GNUNET_PLUGIN_test (const struct GNUNET_OS_ProjectData *pd, const char *library_name) |
Test if a plugin exists. More... | |
void * | GNUNET_PLUGIN_load (const struct GNUNET_OS_ProjectData *pd, 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 enum GNUNET_GenericReturnValue | find_libraries (void *cls, const char *filename) |
Function called on each plugin in the directory. More... | |
void | GNUNET_PLUGIN_load_all (const struct GNUNET_OS_ProjectData *pd, const char *basename, void *arg, GNUNET_PLUGIN_LoaderCallback cb, void *cb_cls) |
Load all compatible plugins with the given base name. More... | |
Variables | |
static int | initialized |
Have we been initialized? 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 69 of file plugin.c.
References _.
Referenced by GNUNET_PLUGIN_load(), and GNUNET_PLUGIN_test().
|
static |
Shutdown libtool.
Definition at line 88 of file plugin.c.
References getenv().
Referenced by GNUNET_PLUGIN_load(), GNUNET_PLUGIN_test(), and 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 103 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 |
Open library library_name using search path from pd.
pd | program data with paths |
library_name | name of plugin to load |
Definition at line 137 of file plugin.c.
References GNUNET_asprintf(), GNUNET_free, GNUNET_OS_installation_get_path(), and GNUNET_OS_IPK_LIBDIR.
Referenced by GNUNET_PLUGIN_load(), and GNUNET_PLUGIN_test().
|
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 362 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(), GNUNET_strdup, and LoadAllContext::pd.
Referenced by GNUNET_PLUGIN_load_all().
|
static |
Have we been initialized?
Definition at line 57 of file plugin.c.
Referenced by __attribute__(), GNUNET_PLUGIN_load(), GNUNET_PLUGIN_test(), and GNUNET_PLUGIN_unload().
|
static |
List of plugins we have loaded.
Definition at line 62 of file plugin.c.
Referenced by extract_files(), GNUNET_PLUGIN_load(), GNUNET_PLUGIN_test(), GNUNET_PLUGIN_unload(), and main().