aboutsummaryrefslogtreecommitdiff
path: root/lib/hmap.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-03-20 15:00:46 -0700
committerBen Pfaff <blp@nicira.com>2012-03-21 09:25:06 -0700
commitf4f9f0868c9150c7b032884f212db1e3bcb6b1fa (patch)
treea0bdd1136b45f9624b87390cbd6257fd2fd07aec /lib/hmap.h
parenteef4d7399be65ab0a8d75b3eb448c4c91eb651a9 (diff)
hmap: New function hmap_contains().
This is useful in a situation where one knows that an hmap_node is in some hmap, but it's not certain which one, and one needs to know whether it is in a particular one. This is not a very common case; I don't see any potential users in the current tree, although an upcoming commit will add one. Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/hmap.h')
-rw-r--r--lib/hmap.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/hmap.h b/lib/hmap.h
index ed2d78d3..246fba2c 100644
--- a/lib/hmap.h
+++ b/lib/hmap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010, 2012 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -130,6 +130,8 @@ static inline struct hmap_node *hmap_first_in_bucket(const struct hmap *,
size_t hash);
static inline struct hmap_node *hmap_next_in_bucket(const struct hmap_node *);
+bool hmap_contains(const struct hmap *, const struct hmap_node *);
+
/* Iteration. */
/* Iterates through every node in HMAP. */