From 8da07c23a94221fea5d73ebac9a522f72e3adef3 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 19 Oct 2009 22:00:02 +0000 Subject: [PATCH] fix --- src/util/container_multihashmap.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/util/container_multihashmap.c b/src/util/container_multihashmap.c index 410564a48..41c11bf1b 100644 --- a/src/util/container_multihashmap.c +++ b/src/util/container_multihashmap.c @@ -19,7 +19,7 @@ */ /** * @file util/container_multihashmap.c - * @brief hash map where the same key maybe present multiple times + * @brief hash map where the same key may be present multiple times * @author Christian Grothoff */ @@ -28,6 +28,9 @@ #include "gnunet_container_lib.h" #include "gnunet_crypto_lib.h" +/** + * + */ struct MapEntry { GNUNET_HashCode key; @@ -35,6 +38,9 @@ struct MapEntry struct MapEntry *next; }; +/** + * + */ struct GNUNET_CONTAINER_MultiHashMap { @@ -45,6 +51,7 @@ struct GNUNET_CONTAINER_MultiHashMap unsigned int map_length; }; + struct GNUNET_CONTAINER_MultiHashMap * GNUNET_CONTAINER_multihashmap_create (unsigned int len) { @@ -58,6 +65,7 @@ GNUNET_CONTAINER_multihashmap_create (unsigned int len) return ret; } + void GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap *map) @@ -84,6 +92,7 @@ idx_of (const struct GNUNET_CONTAINER_MultiHashMap *m, return (*(unsigned int *) key) % m->map_length; } + unsigned int GNUNET_CONTAINER_multihashmap_size (const struct GNUNET_CONTAINER_MultiHashMap *map) @@ -91,6 +100,7 @@ GNUNET_CONTAINER_multihashmap_size (const struct GNUNET_CONTAINER_MultiHashMap return map->size; } + void * GNUNET_CONTAINER_multihashmap_get (const struct GNUNET_CONTAINER_MultiHashMap *map, const GNUNET_HashCode * key) @@ -107,6 +117,7 @@ GNUNET_CONTAINER_multihashmap_get (const struct GNUNET_CONTAINER_MultiHashMap return NULL; } + int GNUNET_CONTAINER_multihashmap_iterate (const struct GNUNET_CONTAINER_MultiHashMap *map, @@ -132,6 +143,7 @@ GNUNET_CONTAINER_multihashmap_iterate (const struct return count; } + int GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap *map, const GNUNET_HashCode * key, @@ -163,6 +175,7 @@ GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap return GNUNET_NO; } + int GNUNET_CONTAINER_multihashmap_remove_all (struct GNUNET_CONTAINER_MultiHashMap *map, const GNUNET_HashCode * key) @@ -201,6 +214,7 @@ GNUNET_CONTAINER_multihashmap_remove_all (struct GNUNET_CONTAINER_MultiHashMap return ret; } + int GNUNET_CONTAINER_multihashmap_contains (const struct GNUNET_CONTAINER_MultiHashMap *map, @@ -220,6 +234,7 @@ GNUNET_CONTAINER_multihashmap_contains (const struct return GNUNET_NO; } + static void grow (struct GNUNET_CONTAINER_MultiHashMap *map) { @@ -245,6 +260,7 @@ grow (struct GNUNET_CONTAINER_MultiHashMap *map) GNUNET_free (old); } + int GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap *map, const GNUNET_HashCode * key, @@ -284,6 +300,7 @@ GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap *map, return GNUNET_OK; } + int GNUNET_CONTAINER_multihashmap_get_multiple (const struct GNUNET_CONTAINER_MultiHashMap @@ -309,6 +326,7 @@ GNUNET_CONTAINER_multihashmap_get_multiple (const struct return count; } + void * GNUNET_CONTAINER_multihashmap_get_random (const struct GNUNET_CONTAINER_MultiHashMap *map) @@ -331,4 +349,4 @@ GNUNET_CONTAINER_multihashmap_get_random (const struct return e->value; } -/* end of multihashmap.c */ +/* end of container_multihashmap.c */ -- 2.25.1