adding number of preferences to allow iterating over preferences
[oweals/gnunet.git] / src / include / gnunet_container_lib.h
index 60082489c03ae3e5452e5aa4fc319251f5197890..125bc81b21bcec5b405e1fbc7677da493507a1f2 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2001-2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2001-2013 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -612,9 +612,10 @@ enum GNUNET_CONTAINER_MultiHashMapOption
  *         iterate,
  *         #GNUNET_NO if not.
  */
-typedef int (*GNUNET_CONTAINER_HashMapIterator) (void *cls,
-                                                 const struct GNUNET_HashCode *key,
-                                                 void *value);
+typedef int
+(*GNUNET_CONTAINER_HashMapIterator) (void *cls,
+                                     const struct GNUNET_HashCode *key,
+                                     void *value);
 
 
 /**
@@ -696,6 +697,18 @@ GNUNET_CONTAINER_multihashmap_remove_all (struct GNUNET_CONTAINER_MultiHashMap *
                                           const struct GNUNET_HashCode *key);
 
 
+/**
+ * @ingroup hashmap
+ * Remove all entries from the map.
+ * Note that the values would not be "freed".
+ *
+ * @param map the map
+ * @return number of values removed
+ */
+unsigned int
+GNUNET_CONTAINER_multihashmap_clear (struct GNUNET_CONTAINER_MultiHashMap *map);
+
+
 /**
  * @ingroup hashmap
  * Check if the map contains any value under the given
@@ -756,8 +769,7 @@ GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap *map,
  * @return the number of key value pairs
  */
 unsigned int
-GNUNET_CONTAINER_multihashmap_size (const struct GNUNET_CONTAINER_MultiHashMap
-                                    *map);
+GNUNET_CONTAINER_multihashmap_size (const struct GNUNET_CONTAINER_MultiHashMap *map);
 
 
 /**
@@ -771,8 +783,7 @@ GNUNET_CONTAINER_multihashmap_size (const struct GNUNET_CONTAINER_MultiHashMap
  *         #GNUNET_SYSERR if it aborted iteration
  */
 int
-GNUNET_CONTAINER_multihashmap_iterate (const struct
-                                       GNUNET_CONTAINER_MultiHashMap *map,
+GNUNET_CONTAINER_multihashmap_iterate (const struct GNUNET_CONTAINER_MultiHashMap *map,
                                        GNUNET_CONTAINER_HashMapIterator it,
                                        void *it_cls);
 
@@ -856,9 +867,10 @@ GNUNET_CONTAINER_multihashmap_get_multiple (const struct GNUNET_CONTAINER_MultiH
  *         iterate,
  *         #GNUNET_NO if not.
  */
-typedef int (*GNUNET_CONTAINER_PeerMapIterator) (void *cls,
-                                                 const struct GNUNET_PeerIdentity *key,
-                                                 void *value);
+typedef int
+(*GNUNET_CONTAINER_PeerMapIterator) (void *cls,
+                                     const struct GNUNET_PeerIdentity *key,
+                                     void *value);
 
 
 struct GNUNET_CONTAINER_MultiPeerMap;