aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_datacache_plugin.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-04-30 07:56:00 +0000
committerChristian Grothoff <christian@grothoff.org>2015-04-30 07:56:00 +0000
commit786745c969589eae2aa069885b40eba0f3989507 (patch)
tree6f5c8573b021ba628b4f135f3fb964728b3e1724 /src/include/gnunet_datacache_plugin.h
parenta49b0f351926cf4376a58937a94e37426e3ae167 (diff)
downloadgnunet-786745c969589eae2aa069885b40eba0f3989507.tar.gz
gnunet-786745c969589eae2aa069885b40eba0f3989507.zip
implementing 'get_closest' API for sqlite and postgres datacache plugins
Diffstat (limited to 'src/include/gnunet_datacache_plugin.h')
-rw-r--r--src/include/gnunet_datacache_plugin.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/include/gnunet_datacache_plugin.h b/src/include/gnunet_datacache_plugin.h
index 0810a41d9..bd915bdc0 100644
--- a/src/include/gnunet_datacache_plugin.h
+++ b/src/include/gnunet_datacache_plugin.h
@@ -133,7 +133,7 @@ struct GNUNET_DATACACHE_PluginFunctions
133 * @return the number of results found 133 * @return the number of results found
134 */ 134 */
135 unsigned int (*get) (void *cls, 135 unsigned int (*get) (void *cls,
136 const struct GNUNET_HashCode * key, 136 const struct GNUNET_HashCode *key,
137 enum GNUNET_BLOCK_Type type, 137 enum GNUNET_BLOCK_Type type,
138 GNUNET_DATACACHE_Iterator iter, 138 GNUNET_DATACACHE_Iterator iter,
139 void *iter_cls); 139 void *iter_cls);
@@ -160,6 +160,25 @@ struct GNUNET_DATACACHE_PluginFunctions
160 void *iter_cls); 160 void *iter_cls);
161 161
162 162
163 /**
164 * Iterate over the results that are "close" to a particular key in
165 * the datacache. "close" is defined as numerically larger than @a
166 * key (when interpreted as a circular address space), with small
167 * distance.
168 *
169 * @param cls closure (internal context for the plugin)
170 * @param key area of the keyspace to look into
171 * @param num_results number of results that should be returned to @a iter
172 * @param iter maybe NULL (to just count)
173 * @param iter_cls closure for @a iter
174 * @return the number of results found
175 */
176 unsigned int (*get_closest) (void *cls,
177 const struct GNUNET_HashCode *key,
178 unsigned int num_results,
179 GNUNET_DATACACHE_Iterator iter,
180 void *iter_cls);
181
163}; 182};
164 183
165 184