aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_container_lib.h
diff options
context:
space:
mode:
authorBertrand Marc <beberking@gmail.com>2012-06-06 20:47:48 +0200
committerBertrand Marc <beberking@gmail.com>2012-06-06 20:47:48 +0200
commit740b30688bd745a527f96f9116c19acb3480971a (patch)
tree2709a3f4dba11c174aa9e1ba3612e30c578e76a9 /src/include/gnunet_container_lib.h
parent2b81464a43485fcc8ce079fafdee7b7a171835f4 (diff)
Imported Upstream version 0.9.3upstream/0.9.3
Diffstat (limited to 'src/include/gnunet_container_lib.h')
-rw-r--r--src/include/gnunet_container_lib.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index 75443b6..a78d8cc 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -70,7 +70,8 @@ typedef int (*GNUNET_HashCodeIterator) (void *cls, GNUNET_HashCode * next);
*
* @param filename the name of the file (or the prefix)
* @param size the size of the bloom-filter (number of
- * bytes of storage space to use)
+ * bytes of storage space to use); will be rounded up
+ * to next power of 2
* @param k the number of GNUNET_CRYPTO_hash-functions to apply per
* element (number of bits set per element in the set)
* @return the bloomfilter
@@ -1152,12 +1153,28 @@ GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l);
* @param l list
* @param buf payload buffer to find
* @param len length of the payload (number of bytes in buf)
+ *
+ * @return GNUNET_YES if found, GNUNET_NO otherwise
*/
int
GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l,
const void *buf, size_t len);
-
+/**
+ * Check if a list contains a certain element using 'compare' function
+ *
+ * @param l list
+ * @param buf payload buffer to find
+ * @param len length of the payload (number of bytes in buf)
+ * @param compare comparison function
+ *
+ * @return NULL if the 'buf' could not be found, pointer to the
+ * list element, if found
+ */
+void *
+GNUNET_CONTAINER_slist_contains2 (const struct GNUNET_CONTAINER_SList *l,
+ const void *buf, size_t len,
+ int (*compare)(const void *, const size_t, const void *, const size_t));
/**
* Count the elements of a list
* @param l list