gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r35682 - gnunet/src/datacache


From: gnunet
Subject: [GNUnet-SVN] r35682 - gnunet/src/datacache
Date: Thu, 30 Apr 2015 09:56:54 +0200

Author: grothoff
Date: 2015-04-30 09:56:54 +0200 (Thu, 30 Apr 2015)
New Revision: 35682

Modified:
   gnunet/src/datacache/plugin_datacache_template.c
Log:
implementing 'get_closest' API for template

Modified: gnunet/src/datacache/plugin_datacache_template.c
===================================================================
--- gnunet/src/datacache/plugin_datacache_template.c    2015-04-30 07:56:00 UTC 
(rev 35681)
+++ gnunet/src/datacache/plugin_datacache_template.c    2015-04-30 07:56:54 UTC 
(rev 35682)
@@ -124,7 +124,33 @@
 }
 
 
+
 /**
+ * Iterate over the results that are "close" to a particular key in
+ * the datacache.  "close" is defined as numerically larger than @a
+ * key (when interpreted as a circular address space), with small
+ * distance.
+ *
+ * @param cls closure (internal context for the plugin)
+ * @param key area of the keyspace to look into
+ * @param num_results number of results that should be returned to @a iter
+ * @param iter maybe NULL (to just count)
+ * @param iter_cls closure for @a iter
+ * @return the number of results found
+ */
+static unsigned int
+template_plugin_get_closest (void *cls,
+                             const struct GNUNET_HashCode *key,
+                             unsigned int num_results,
+                             GNUNET_DATACACHE_Iterator iter,
+                             void *iter_cls)
+{
+  GNUNET_break (0);
+  return 0;
+}
+
+
+/**
  * Entry point for the plugin.
  *
  * @param cls closure (the `struct GNUNET_DATACACHE_PluginEnvironmnet`)
@@ -145,6 +171,7 @@
   api->put = &template_plugin_put;
   api->del = &template_plugin_del;
   api->get_random = &template_plugin_get_random;
+  api->get_closest = &template_plugin_get_closest;
   GNUNET_log_from (GNUNET_ERROR_TYPE_INFO,
                    "template",
                    "Template datacache running\n");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]