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:
732dcb3
)
shash: New function shash_first().
author
Ben Pfaff
<blp@nicira.com>
Wed, 24 Jun 2009 17:21:39 +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
7f69084
..
9316372
100644
(file)
--- a/
lib/shash.c
+++ b/
lib/shash.c
@@
-97,3
+97,11
@@
shash_find_data(const struct shash *sh, const char *name)
struct shash_node *node = shash_find(sh, name);
return node ? node->data : NULL;
}
struct shash_node *node = shash_find(sh, name);
return node ? node->data : NULL;
}
+
+struct shash_node *
+shash_first(const struct shash *shash)
+{
+ struct hmap_node *node = hmap_first(&shash->map);
+ return node ? CONTAINER_OF(node, struct shash_node, node) : NULL;
+}
+
diff --git
a/lib/shash.h
b/lib/shash.h
index
469e66e
..
bcac41b
100644
(file)
--- a/
lib/shash.h
+++ b/
lib/shash.h
@@
-39,5
+39,6
@@
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_find_data(const struct shash *, const char *);
void shash_delete(struct shash *, struct shash_node *);
struct shash_node *shash_find(const struct shash *, const char *);
void *shash_find_data(const struct shash *, const char *);
+struct shash_node *shash_first(const struct shash *);
#endif /* shash.h */
#endif /* shash.h */