template for an implementation of a database backend for the datacache More...
Go to the source code of this file.
Data Structures | |
struct | Plugin |
Handle for a plugin. More... | |
Functions | |
static ssize_t | template_plugin_put (void *cls, uint32_t xor_distance, const struct GNUNET_DATACACHE_Block *block) |
Store an item in the datastore. More... | |
static unsigned int | template_plugin_get (void *cls, const struct GNUNET_HashCode *key, enum GNUNET_BLOCK_Type type, GNUNET_DATACACHE_Iterator iter, void *iter_cls) |
Iterate over the results for a particular key in the datastore. More... | |
static enum GNUNET_GenericReturnValue | template_plugin_del (void *cls) |
Delete the entry with the lowest expiration value from the datacache right now. More... | |
static unsigned int | template_plugin_get_closest (void *cls, const struct GNUNET_HashCode *key, enum GNUNET_BLOCK_Type type, unsigned int num_results, GNUNET_DATACACHE_Iterator iter, void *iter_cls) |
Iterate over the results that are "close" to a particular key in the datacache. More... | |
void * | libgnunet_plugin_datacache_template_init (void *cls) |
Entry point for the plugin. More... | |
void * | libgnunet_plugin_datacache_template_done (void *cls) |
Exit point from the plugin. More... | |
template for an implementation of a database backend for the datacache
Definition in file plugin_datacache_template.c.
|
static |
Store an item in the datastore.
cls | closure (our struct Plugin ) |
xor_distance | distance of key to our PID |
block | data to store |
Definition at line 52 of file plugin_datacache_template.c.
References GNUNET_break.
Referenced by libgnunet_plugin_datacache_template_init().
|
static |
Iterate over the results for a particular key in the datastore.
cls | closure (our struct Plugin ) |
key | |
type | entries of which type are relevant? |
iter | maybe NULL (to just count) |
iter_cls | closure for iter |
Definition at line 73 of file plugin_datacache_template.c.
References GNUNET_break.
Referenced by libgnunet_plugin_datacache_template_init().
|
static |
Delete the entry with the lowest expiration value from the datacache right now.
cls | closure (our struct Plugin ) |
Definition at line 92 of file plugin_datacache_template.c.
References GNUNET_break, and GNUNET_SYSERR.
Referenced by libgnunet_plugin_datacache_template_init().
|
static |
Iterate over the results that are "close" to a particular key in the datacache.
"close" is defined as numerically larger than key (when interpreted as a circular address space), with small distance.
cls | closure (internal context for the plugin) |
key | area of the keyspace to look into |
type | desired block type for the replies |
num_results | number of results that should be returned to iter |
iter | maybe NULL (to just count) |
iter_cls | closure for iter |
Definition at line 114 of file plugin_datacache_template.c.
References GNUNET_break.
Referenced by libgnunet_plugin_datacache_template_init().
void * libgnunet_plugin_datacache_template_init | ( | void * | cls | ) |
Entry point for the plugin.
cls | closure (the struct GNUNET_DATACACHE_PluginEnvironmnet ) |
struct Plugin
) Definition at line 135 of file plugin_datacache_template.c.
References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, GNUNET_DATACACHE_PluginEnvironment::cls, env, GNUNET_ERROR_TYPE_INFO, GNUNET_log_from, GNUNET_new, plugin, template_plugin_del(), template_plugin_get(), template_plugin_get_closest(), and template_plugin_put().
void * libgnunet_plugin_datacache_template_done | ( | void * | cls | ) |
Exit point from the plugin.
cls | closure (our struct Plugin ) |
Definition at line 165 of file plugin_datacache_template.c.
References Plugin::api, GNUNET_BLOCK_PluginFunctions::cls, GNUNET_DATACACHE_PluginFunctions::cls, GNUNET_free, and plugin.