aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-03 15:24:08 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-03 15:24:08 +0000
commit84a70da19fdf98b028b98e23a228e32f591535fe (patch)
tree3fde202b9a1d16c4594c25f5a64dea15e989a160 /src/include
parent7ae7229d2de6a6ef842634265847a46ac46f8c5c (diff)
downloadgnunet-84a70da19fdf98b028b98e23a228e32f591535fe.tar.gz
gnunet-84a70da19fdf98b028b98e23a228e32f591535fe.zip
implementing plugin directory scanner for #1746
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_plugin_lib.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/include/gnunet_plugin_lib.h b/src/include/gnunet_plugin_lib.h
index d143a6ccf..ff795d975 100644
--- a/src/include/gnunet_plugin_lib.h
+++ b/src/include/gnunet_plugin_lib.h
@@ -62,6 +62,7 @@ typedef void *(*GNUNET_PLUGIN_Callback) (void *arg);
62int 62int
63GNUNET_PLUGIN_test (const char *library_name); 63GNUNET_PLUGIN_test (const char *library_name);
64 64
65
65/** 66/**
66 * Setup plugin (runs the "init" callback and returns whatever "init" 67 * Setup plugin (runs the "init" callback and returns whatever "init"
67 * returned). If "init" returns NULL, the plugin is unloaded. 68 * returned). If "init" returns NULL, the plugin is unloaded.
@@ -79,6 +80,40 @@ GNUNET_PLUGIN_load (const char *library_name, void *arg);
79 80
80 81
81/** 82/**
83 * Signature of a function called by 'GNUNET_PLUGIN_load_all'.
84 *
85 * @param cls closure
86 * @param library_name full name of the library (to be used with
87 * 'GNUNET_PLUGIN_unload')
88 * @param lib_ret return value from the initialization function
89 * of the library (same as what 'GNUNET_PLUGIN_load' would
90 * have returned for the given library name)
91 */
92typedef void (*GNUNET_PLUGIN_LoaderCallback)(void *cls,
93 const char *library_name,
94 void *lib_ret);
95
96
97/**
98 * Load all compatible plugins with the given base name.
99 *
100 * Note that the library must export symbols called
101 * "basename_ANYTHING_init" and "basename_ANYTHING__done". These will
102 * be called when the library is loaded and unloaded respectively.
103 *
104 * @param basename basename of the plugins to load
105 * @param arg argument to the plugin initialization function
106 * @param cb function to call for each plugin found
107 * @param cb_cls closure for 'cb'
108 */
109void
110GNUNET_PLUGIN_load_all (const char *basename,
111 void *arg,
112 GNUNET_PLUGIN_LoaderCallback cb,
113 void *cb_cls);
114
115
116/**
82 * Unload plugin (runs the "done" callback and returns whatever "done" 117 * Unload plugin (runs the "done" callback and returns whatever "done"
83 * returned). The plugin is then unloaded. 118 * returned). The plugin is then unloaded.
84 * 119 *