From 11b5bf96779e8a01b6e67e7375dd9420358d0625 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 25 Jul 2009 23:19:49 +0000 Subject: docu --- src/include/gnunet_dht_service.h | 72 ++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 32 deletions(-) (limited to 'src/include/gnunet_dht_service.h') diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index 9e164245d..8dcbc19c5 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h @@ -37,39 +37,46 @@ extern "C" #endif #endif +// FIXME: document struct GNUNET_DHT_GetHandle; - /** - * Perform an asynchronous GET operation on the DHT identified. - * - * @param type expected type of the response object - * @param key the key to look up - * @param callback function to call on each result - * @param closure extra argument to callback - * @return handle to stop the async get - */ - struct GNUNET_DHT_GetHandle * -GNUNET_DHT_get_start) (struct GNUNET_DHT_Handle *h, - unsigned int type, - const GNUNET_HashCode * key, - GNUNET_DHT_ResultProcessor callback, - void *callback_cls); - - /** - * Stop async DHT-get. Frees associated resources. - */ - int GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle * record); - - /** - * Perform a PUT operation on the DHT identified by 'table' storing - * a binding of 'key' to 'value'. The peer does not have to be part - * of the table (if so, we will attempt to locate a peer that is!) - * - * @param key the key to store under - */ - int GNUNET_DHT_put (struct GNUNET_DHT_Handle *h, -const GNUNET_HashCode * key, - unsigned int type, unsigned int size, const char *data); + +/** + * Perform an asynchronous GET operation on the DHT identified. + * + * @param type expected type of the response object + * @param key the key to look up + * @param iter function to call on each result + * @param iter_cls closure for iter + * @return handle to stop the async get + */ +struct GNUNET_DHT_GetHandle * +GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *h, + uint32_t type, + const GNUNET_HashCode * key, + GNUNET_DHT_Iterator iter, + void *iter_cls); + + +/** + * Stop async DHT-get. Frees associated resources. + */ +int GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *record); + + +// FIXME: add continuation? expiration? +/** + * Perform a PUT operation on the DHT identified by 'table' storing + * a binding of 'key' to 'value'. The peer does not have to be part + * of the table (if so, we will attempt to locate a peer that is!) + * + * @param key the key to store under + */ +int GNUNET_DHT_put (struct GNUNET_DHT_Handle *h, + const GNUNET_HashCode * key, + uint32_t type, + uint32_t size, + const char *data); #if 0 /* keep Emacsens' auto-indent happy */ @@ -80,4 +87,5 @@ const GNUNET_HashCode * key, #endif -#endif /* DHT_SERVICE_API_H */ +#endif +/* gnunet_dht_service.h */ -- cgit v1.2.3