/**
* Store an item in the datastore.
*
- * @param cls closure with the 'struct Plugin'
+ * @param cls closure with the 'struct Plugin'
* @param key key for the item
* @param size number of bytes in data
* @param data content stored
*/
static void
process_result (struct Plugin *plugin, PluginDatumProcessor proc,
- void *proc_cls, PGresult * res,
+ void *proc_cls, PGresult * res,
const char *filename, int line)
{
int iret;
if (sizeof (struct GNUNET_HashCode) != PQgetlength (res, i, 0))
{
memcpy (&key, PQgetvalue (res, i, 0), sizeof (struct GNUNET_HashCode));
- proc (proc_cls, &key, 1);
+ proc (proc_cls, &key, 1);
}
}
PQclear (res);
postgres_plugin_drop (void *cls)
{
struct Plugin *plugin = cls;
-
+
if (GNUNET_OK != GNUNET_POSTGRES_exec (plugin->dbh, "DROP TABLE gn090"))
GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "postgres", _("Failed to drop table from database.\n"));
}
struct GNUNET_DATASTORE_PluginFunctions *api;
struct Plugin *plugin;
- plugin = GNUNET_malloc (sizeof (struct Plugin));
+ plugin = GNUNET_new (struct Plugin);
plugin->env = env;
if (GNUNET_OK != init_connection (plugin))
{
GNUNET_free (plugin);
return NULL;
}
- api = GNUNET_malloc (sizeof (struct GNUNET_DATASTORE_PluginFunctions));
+ api = GNUNET_new (struct GNUNET_DATASTORE_PluginFunctions);
api->cls = plugin;
api->estimate_size = &postgres_plugin_estimate_size;
api->put = &postgres_plugin_put;