-indentation
[oweals/gnunet.git] / src / datastore / plugin_datastore_mysql.c
index 40f25deee924560f5ab7b49c2b963dd1d7678c6a..fab10b206288a62247a78d113364c02729d9e1df 100644 (file)
@@ -47,7 +47,7 @@
  *
  * MANUAL SETUP INSTRUCTIONS
  *
- * 1) in /etc/gnunet.conf, set
+ * 1) in gnunet.conf, set
  * @verbatim
        [datastore]
        DATABASE = "mysql"
@@ -363,7 +363,7 @@ mysql_plugin_update (void *cls, uint64_t uid, int delta,
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Updating value %llu adding %d to priority and maxing exp at %s\n",
-              vkey, delta, 
+              vkey, delta,
              GNUNET_STRINGS_absolute_time_to_string (expire));
   ret =
     GNUNET_MYSQL_statement_run_prepared (plugin->mc, plugin->update_entry, NULL,
@@ -454,7 +454,7 @@ execute_select (struct Plugin *plugin, struct GNUNET_MYSQL_StatementHandle *stmt
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Found %u-byte value under key `%s' with prio %u, anon %u, expire %s selecting from gn090 table\n",
               (unsigned int) size, GNUNET_h2s (&key),
-             priority, anonymity, 
+             priority, anonymity,
              GNUNET_STRINGS_absolute_time_to_string (expiration));
   GNUNET_assert (size < MAX_DATUM_SIZE);
   ret =
@@ -769,7 +769,7 @@ mysql_plugin_get_keys (void *cls,
   struct GNUNET_HashCode key;
   MYSQL_BIND cbind[1];
   unsigned long length;
+
   statement = GNUNET_MYSQL_statement_get_stmt (plugin->mc,
                                               plugin->get_all_keys);
   if (statement == NULL)
@@ -812,14 +812,14 @@ mysql_plugin_get_keys (void *cls,
   while (0 == (ret = mysql_stmt_fetch (statement)))
   {
     if (sizeof (struct GNUNET_HashCode) == length)
-      proc (proc_cls, &key, 1);    
+      proc (proc_cls, &key, 1);
   }
   if (ret != MYSQL_NO_DATA)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 _("`%s' failed at %s:%d with error: %s\n"),
                     "mysql_stmt_fetch", __FILE__, __LINE__,
-                    mysql_stmt_error (statement));    
+                    mysql_stmt_error (statement));
     GNUNET_MYSQL_statements_invalidate (plugin->mc);
     return;
   }
@@ -946,7 +946,7 @@ libgnunet_plugin_datastore_mysql_init (void *cls)
   struct GNUNET_DATASTORE_PluginFunctions *api;
   struct Plugin *plugin;
 
-  plugin = GNUNET_malloc (sizeof (struct Plugin));
+  plugin = GNUNET_new (struct Plugin);
   plugin->env = env;
   plugin->mc = GNUNET_MYSQL_context_create (env->cfg, "datastore-mysql");
   if (NULL == plugin->mc)
@@ -1007,7 +1007,7 @@ libgnunet_plugin_datastore_mysql_init (void *cls)
 #undef PINIT
 #undef MRUNS
 
-  api = GNUNET_malloc (sizeof (struct GNUNET_DATASTORE_PluginFunctions));
+  api = GNUNET_new (struct GNUNET_DATASTORE_PluginFunctions);
   api->cls = plugin;
   api->estimate_size = &mysql_plugin_estimate_size;
   api->put = &mysql_plugin_put;