-check return value
[oweals/gnunet.git] / src / block / plugin_block_test.c
index eaffa361f5d7cf5ab18b288d3852ab7de90992db..01ed14fc2cb9085250d9eb7b2223b97d4e18b54b 100644 (file)
@@ -98,7 +98,7 @@ block_plugin_test_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
  * @param block block to get the key for
  * @param block_size number of bytes in @a block
  * @param key set to the key (query) for the given block
- * @return GNUNET_OK on success, GNUNET_SYSERR if type not supported
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR if type not supported
  *         (or if extracting a key from a block of this type does not work)
  */
 static int
@@ -114,6 +114,9 @@ block_plugin_test_get_key (void *cls, enum GNUNET_BLOCK_Type type,
 
 /**
  * Entry point for the plugin.
+ *
+ * @param cls NULL
+ * @return the exported block API
  */
 void *
 libgnunet_plugin_block_test_init (void *cls)
@@ -125,7 +128,7 @@ libgnunet_plugin_block_test_init (void *cls)
   };
   struct GNUNET_BLOCK_PluginFunctions *api;
 
-  api = GNUNET_malloc (sizeof (struct GNUNET_BLOCK_PluginFunctions));
+  api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions);
   api->evaluate = &block_plugin_test_evaluate;
   api->get_key = &block_plugin_test_get_key;
   api->types = types;
@@ -135,11 +138,14 @@ libgnunet_plugin_block_test_init (void *cls)
 
 /**
  * Exit point from the plugin.
+ *
+ * @param cls the return value from #libgnunet_plugin_block_test_init
+ * @return NULL
  */
 void *
 libgnunet_plugin_block_test_done (void *cls)
 {
-  struct GNUNET_TRANSPORT_PluginFunctions *api = cls;
+  struct GNUNET_BLOCK_PluginFunctions *api = cls;
 
   GNUNET_free (api);
   return NULL;