X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Finclude%2Fgnunet_datacache_plugin.h;h=fbfcdf1e8bdf9f37d53563b1ac130ce8822f626a;hb=66ffc809472f27d69b9ad7361f8ba29c2674f716;hp=6aa9b1d06233df1af431f8275b55f6bcbeb53f4a;hpb=bdc3b54372a92874c2ecb58069eac5bdfe6fcddc;p=oweals%2Fgnunet.git diff --git a/src/include/gnunet_datacache_plugin.h b/src/include/gnunet_datacache_plugin.h index 6aa9b1d06..fbfcdf1e8 100644 --- a/src/include/gnunet_datacache_plugin.h +++ b/src/include/gnunet_datacache_plugin.h @@ -19,7 +19,7 @@ */ /** - * @file datacache/gnunet_datacache_plugin.h + * @file include/gnunet_datacache_plugin.h * @brief API for database backends for the datacache * @author Christian Grothoff */ @@ -40,14 +40,14 @@ extern "C" /** * Function called by plugins to notify the datacache * about content deletions. - * + * * @param cls closure * @param key key of the content that was deleted * @param size number of bytes that were made available */ -typedef void (*GNUNET_DATACACHE_DeleteNotifyCallback)(void *cls, - const GNUNET_HashCode *key, - size_t size); +typedef void (*GNUNET_DATACACHE_DeleteNotifyCallback) (void *cls, + const GNUNET_HashCode * + key, size_t size); /** @@ -57,7 +57,7 @@ typedef void (*GNUNET_DATACACHE_DeleteNotifyCallback)(void *cls, */ struct GNUNET_DATACACHE_PluginEnvironment { - + /** * Configuration to use. @@ -91,11 +91,12 @@ struct GNUNET_DATACACHE_PluginEnvironment /** * @brief struct returned by the initialization function of the plugin */ -struct GNUNET_DATACACHE_PluginFunctions { +struct GNUNET_DATACACHE_PluginFunctions +{ /** * Closure to pass to all plugin functions. - */ + */ void *cls; /** @@ -108,12 +109,9 @@ struct GNUNET_DATACACHE_PluginFunctions { * @param discard_time when to discard the value in any case * @return 0 on error, number of bytes used otherwise */ - size_t (*put) (void *cls, - const GNUNET_HashCode * key, - size_t size, - const char *data, - enum GNUNET_BLOCK_Type type, - struct GNUNET_TIME_Absolute discard_time); + size_t (*put) (void *cls, const GNUNET_HashCode * key, size_t size, + const char *data, enum GNUNET_BLOCK_Type type, + struct GNUNET_TIME_Absolute discard_time); /** @@ -127,20 +125,18 @@ struct GNUNET_DATACACHE_PluginFunctions { * @param iter_cls closure for iter * @return the number of results found */ - unsigned int (*get) (void *cls, - const GNUNET_HashCode * key, - enum GNUNET_BLOCK_Type type, - GNUNET_DATACACHE_Iterator iter, - void *iter_cls); + unsigned int (*get) (void *cls, const GNUNET_HashCode * key, + enum GNUNET_BLOCK_Type type, + GNUNET_DATACACHE_Iterator iter, void *iter_cls); /** * Delete the entry with the lowest expiration value * from the datacache right now. - * + * * @param cls closure (internal context for the plugin) * @return GNUNET_OK on success, GNUNET_SYSERR on error - */ + */ int (*del) (void *cls);