datacache API implementation More...
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_datacache_lib.h"
#include "gnunet_statistics_service.h"
#include "gnunet_datacache_plugin.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_DATACACHE_Handle |
Internal state of the datacache library. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log_from (kind, "datacache", __VA_ARGS__) |
#define | LOG_STRERROR_FILE(kind, op, fn) GNUNET_log_from_strerror_file (kind, "datacache", op, fn) |
Functions | |
static void | env_delete_notify (void *cls, const struct GNUNET_HashCode *key, size_t size) |
Function called by plugins to notify the datacache about content deletions. More... | |
struct GNUNET_DATACACHE_Handle * | GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section) |
Create a data cache. More... | |
void | GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h) |
Destroy a data cache (and free associated resources). More... | |
enum GNUNET_GenericReturnValue | GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, uint32_t xor_distance, const struct GNUNET_DATACACHE_Block *block) |
Store an item in the datacache. More... | |
unsigned int | GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, 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 datacache. More... | |
unsigned int | GNUNET_DATACACHE_get_closest (struct GNUNET_DATACACHE_Handle *h, 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... | |
datacache API implementation
Definition in file datacache.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log_from (kind, "datacache", __VA_ARGS__) |
Definition at line 32 of file datacache.c.
#define LOG_STRERROR_FILE | ( | kind, | |
op, | |||
fn | |||
) | GNUNET_log_from_strerror_file (kind, "datacache", op, fn) |
Definition at line 34 of file datacache.c.
|
static |
Function called by plugins to notify the datacache about content deletions.
cls | closure |
key | key of the content that was deleted |
size | number of bytes that were made available |
Definition at line 104 of file datacache.c.
References GNUNET_assert, GNUNET_CONTAINER_bloomfilter_remove(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_h2s(), GNUNET_NO, GNUNET_STATISTICS_update(), h, key, LOG, and size.
Referenced by GNUNET_DATACACHE_create().