git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
98742ab
)
shash: New function shash_is_empty().
author
Ben Pfaff
<blp@nicira.com>
Wed, 24 Jun 2009 17:21:25 +0000
(10:21 -0700)
committer
Ben Pfaff
<blp@nicira.com>
Mon, 6 Jul 2009 16:07:23 +0000
(09:07 -0700)
lib/shash.c
patch
|
blob
|
history
lib/shash.h
patch
|
blob
|
history
diff --git
a/lib/shash.c
b/lib/shash.c
index
9ddafe0
..
7f69084
100644
(file)
--- a/
lib/shash.c
+++ b/
lib/shash.c
@@
-51,6
+51,12
@@
shash_clear(struct shash *sh)
}
}
}
}
+bool
+shash_is_empty(const struct shash *shash)
+{
+ return hmap_is_empty(&shash->map);
+}
+
/* It is the caller's responsible to avoid duplicate names, if that is
* desirable. */
void
/* It is the caller's responsible to avoid duplicate names, if that is
* desirable. */
void
diff --git
a/lib/shash.h
b/lib/shash.h
index
9201bb5
..
469e66e
100644
(file)
--- a/
lib/shash.h
+++ b/
lib/shash.h
@@
-34,6
+34,7
@@
struct shash {
void shash_init(struct shash *);
void shash_destroy(struct shash *);
void shash_clear(struct shash *);
void shash_init(struct shash *);
void shash_destroy(struct shash *);
void shash_clear(struct shash *);
+bool shash_is_empty(const struct shash *);
void shash_add(struct shash *, const char *, void *);
void shash_delete(struct shash *, struct shash_node *);
struct shash_node *shash_find(const struct shash *, const char *);
void shash_add(struct shash *, const char *, void *);
void shash_delete(struct shash *, struct shash_node *);
struct shash_node *shash_find(const struct shash *, const char *);