diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-04-28 15:05:12 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-04-28 15:05:12 +0000 |
commit | 7581e114280c0c33f375b5d3ba49508b82680755 (patch) | |
tree | d24afeeda69f94b70d1dc325db06810a4b0b1be0 /src/include/gnunet_container_lib.h | |
parent | 553909348c19833330ad94d7a1064eaf48f97e3f (diff) | |
download | gnunet-7581e114280c0c33f375b5d3ba49508b82680755.tar.gz gnunet-7581e114280c0c33f375b5d3ba49508b82680755.zip |
extending datacache API with function to return random element, implemented (only) in heap plugin right now
Diffstat (limited to 'src/include/gnunet_container_lib.h')
-rw-r--r-- | src/include/gnunet_container_lib.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index 125bc81b2..1ecf4f52a 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h | |||
@@ -854,6 +854,22 @@ GNUNET_CONTAINER_multihashmap_get_multiple (const struct GNUNET_CONTAINER_MultiH | |||
854 | void *it_cls); | 854 | void *it_cls); |
855 | 855 | ||
856 | 856 | ||
857 | /** | ||
858 | * @ingroup hashmap | ||
859 | * Call @a it on a random value from the map, or not at all | ||
860 | * if the map is empty. | ||
861 | * | ||
862 | * @param map the map | ||
863 | * @param it function to call on a random entry | ||
864 | * @param it_cls extra argument to @a it | ||
865 | * @return the number of key value pairs processed, zero or one. | ||
866 | */ | ||
867 | unsigned int | ||
868 | GNUNET_CONTAINER_multihashmap_get_random (const struct GNUNET_CONTAINER_MultiHashMap *map, | ||
869 | GNUNET_CONTAINER_HashMapIterator it, | ||
870 | void *it_cls); | ||
871 | |||
872 | |||
857 | /* ***************** Version of Multihashmap for peer identities ****************** */ | 873 | /* ***************** Version of Multihashmap for peer identities ****************** */ |
858 | 874 | ||
859 | /** | 875 | /** |