GNUnet  0.10.x
Typedefs | Functions
gnunet_datacache_lib.h File Reference
#include "gnunet_util_lib.h"
#include "gnunet_block_lib.h"
Include dependency graph for gnunet_datacache_lib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef int(* GNUNET_DATACACHE_Iterator) (void *cls, const struct GNUNET_HashCode *key, size_t data_size, const char *data, enum GNUNET_BLOCK_Type type, struct GNUNET_TIME_Absolute exp, unsigned int path_info_len, const struct GNUNET_PeerIdentity *path_info)
 An iterator over a set of items stored in the datacache. More...
 

Functions

struct GNUNET_DATACACHE_HandleGNUNET_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...
 
int GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, const struct GNUNET_HashCode *key, uint32_t xor_distance, size_t data_size, const char *data, enum GNUNET_BLOCK_Type type, struct GNUNET_TIME_Absolute discard_time, unsigned int path_info_len, const struct GNUNET_PeerIdentity *path_info)
 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_random (struct GNUNET_DATACACHE_Handle *h, GNUNET_DATACACHE_Iterator iter, void *iter_cls)
 Obtain a random element from the datacache. More...
 
unsigned int GNUNET_DATACACHE_get_closest (struct GNUNET_DATACACHE_Handle *h, const struct GNUNET_HashCode *key, 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...
 

Detailed Description

Author
Christian Grothoff

datacache API

Definition in file gnunet_datacache_lib.h.