-0.9.0pre4:
+0.9.0:
* GNUNET-GTK: [CG]
- provide context menus to allow aborts of downloads/uploads
- provide way to handle errors (search, download, publish errors)
-
-0.9.0:
* new webpage:
- write chapter on DHT/block [Nate]
- make a NICE download page
+ insert
+ download
+ search
+* blocks:
+ + should block plugins live in block/ or with fs/dht/vpn?
0.9.1:
* TRANSPORT: [MW]
queue of size > 2), might be better to have at MOST one message pending
per plugin/target and only send the next one after the continuation was
called (or use 'notify_transmit_ready-style API?)
- - WLAN transport backend [DB]
+ - WLAN transport backend (code cleanup) [MW]
- need to periodically probe latency/transport cost changes & possibly switch transport
(working ATS)
* DV:
struct GNUNET_BLOCK_Context
{
/**
- * NULL-terminated array of our plugins.
+ * Array of our plugins.
*/
struct Plugin **plugins;
+ /**
+ * Size of the 'plugins' array.
+ */
+ unsigned int num_plugins;
+
/**
* Our configuration.
*/
}
+/**
+ * Add a plugin to the list managed by the block library.
+ *
+ * @param cls the block context
+ * @param library_name name of the plugin
+ * @param lib_ret the plugin API
+ */
+static void
+add_plugin (void *cls,
+ const char *library_name,
+ void *lib_ret)
+{
+ struct GNUNET_BLOCK_Context *ctx = cls;
+ struct GNUNET_BLOCK_PluginFunctions *api = lib_ret;
+ struct Plugin *plugin;
+
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("Loading block plugin `%s'\n"),
+ library_name);
+ plugin = GNUNET_malloc (sizeof (struct Plugin));
+ plugin->api = api;
+ plugin->library_name = GNUNET_strdup (library_name);
+ GNUNET_array_append (ctx->plugins, ctx->num_plugins, plugin);
+}
+
+
+
/**
* Create a block context. Loads the block plugins.
*
GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg)
{
struct GNUNET_BLOCK_Context *ctx;
- struct GNUNET_BLOCK_PluginFunctions *api;
- struct Plugin *plugin;
- unsigned int num_plugins;
- char *plugs;
- char *pos;
- char *libname;
ctx = GNUNET_malloc (sizeof (struct GNUNET_BLOCK_Context));
ctx->cfg = cfg;
- num_plugins = 0;
- if (GNUNET_OK ==
- GNUNET_CONFIGURATION_get_value_string (cfg, "block", "PLUGINS", &plugs))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading block plugins `%s'\n"),
- plugs);
- pos = strtok (plugs, " ");
- while (pos != NULL)
- {
- GNUNET_asprintf (&libname, "libgnunet_plugin_block_%s", pos);
- api = GNUNET_PLUGIN_load (libname, NULL);
- if (api == NULL)
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Failed to load block plugin `%s'\n"), pos);
- GNUNET_free (libname);
- }
- else
- {
- plugin = GNUNET_malloc (sizeof (struct Plugin));
- plugin->api = api;
- plugin->library_name = libname;
- GNUNET_array_append (ctx->plugins, num_plugins, plugin);
- }
- pos = strtok (NULL, " ");
- }
- GNUNET_free (plugs);
- }
- GNUNET_array_append (ctx->plugins, num_plugins, NULL);
+ GNUNET_PLUGIN_load_all ("libgnunet_plugin_block_",
+ NULL,
+ &add_plugin,
+ ctx);
return ctx;
}
unsigned int i;
struct Plugin *plugin;
- i = 0;
- while (NULL != (plugin = ctx->plugins[i]))
+ for (i = 0; i<ctx->num_plugins;i++)
{
+ plugin = ctx->plugins[i];
GNUNET_break (NULL ==
GNUNET_PLUGIN_unload (plugin->library_name, plugin->api));
GNUNET_free (plugin->library_name);
GNUNET_free (plugin);
- i++;
}
GNUNET_free (ctx->plugins);
GNUNET_free (ctx);
unsigned int i;
unsigned int j;
- i = 0;
- while (NULL != (plugin = ctx->plugins[i]))
+ for (i=0;i<ctx->num_plugins;i++)
{
+ plugin = ctx->plugins[i];
j = 0;
while (0 != (plugin->api->types[j]))
{
return plugin->api;
j++;
}
- i++;
}
return NULL;
}