-indent, doxygen
[oweals/gnunet.git] / src / datacache / plugin_datacache_template.c
index 6c43959825c811353c8b7b6e8c1188e25eed161a..205cc66c76abe699c88a0fce22fa14311a814e7d 100644 (file)
@@ -49,15 +49,19 @@ struct Plugin
  * @param data data to store
  * @param type type of the value
  * @param discard_time when to discard the value in any case
- * @return 0 on error, number of bytes used otherwise
+ * @param path_info_len number of entries in 'path_info'
+ * @param path_info a path through the network
+ * @return 0 if duplicate, -1 on error, number of bytes used otherwise
  */
-static size_t
+static ssize_t
 template_plugin_put (void *cls, const struct GNUNET_HashCode * key, size_t size,
                      const char *data, enum GNUNET_BLOCK_Type type,
-                     struct GNUNET_TIME_Absolute discard_time)
+                     struct GNUNET_TIME_Absolute discard_time,
+                    unsigned int path_info_len,
+                    const struct GNUNET_PeerIdentity *path_info)
 {
   GNUNET_break (0);
-  return 0;
+  return -1;
 }
 
 
@@ -110,9 +114,9 @@ libgnunet_plugin_datacache_template_init (void *cls)
   struct GNUNET_DATACACHE_PluginFunctions *api;
   struct Plugin *plugin;
 
-  plugin = GNUNET_malloc (sizeof (struct Plugin));
+  plugin = GNUNET_new (struct Plugin);
   plugin->env = env;
-  api = GNUNET_malloc (sizeof (struct GNUNET_DATACACHE_PluginFunctions));
+  api = GNUNET_new (struct GNUNET_DATACACHE_PluginFunctions);
   api->cls = plugin;
   api->get = &template_plugin_get;
   api->put = &template_plugin_put;