[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r14251 - gnunet/src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r14251 - gnunet/src/util |
Date: |
Mon, 24 Jan 2011 22:35:50 +0100 |
Author: grothoff
Date: 2011-01-24 22:35:50 +0100 (Mon, 24 Jan 2011)
New Revision: 14251
Modified:
gnunet/src/util/container_multihashmap.c
Log:
api
Modified: gnunet/src/util/container_multihashmap.c
===================================================================
--- gnunet/src/util/container_multihashmap.c 2011-01-24 21:28:52 UTC (rev
14250)
+++ gnunet/src/util/container_multihashmap.c 2011-01-24 21:35:50 UTC (rev
14251)
@@ -336,6 +336,36 @@
/**
+ * Check if the map contains the given value under the given
+ * key.
+ *
+ * @param map the map
+ * @param key the key to test if a value exists for it
+ * @param value value to test for
+ * @return GNUNET_YES if such a value exists,
+ * GNUNET_NO if not
+ */
+int GNUNET_CONTAINER_multihashmap_contains_value (const struct
+ GNUNET_CONTAINER_MultiHashMap
+ *map,
+ const GNUNET_HashCode * key,
+ const void *value)
+{
+ struct MapEntry *e;
+
+ e = map->map[idx_of (map, key)];
+ while (e != NULL)
+ {
+ if ( (0 == memcmp (key, &e->key, sizeof (GNUNET_HashCode))) &&
+ (e->value == value) )
+ return GNUNET_YES;
+ e = e->next;
+ }
+ return GNUNET_NO;
+}
+
+
+/**
* Grow the given map to a more appropriate size.
*
* @param map the hash map to grow
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r14251 - gnunet/src/util,
gnunet <=