rconn: Decentralize and improve disconnection logging.
[openvswitch] / lib / shash.h
index 72d8302007462fb74f1d10066e04e77406182b3e..471918b270242681475fcfc92318011c1cd3fd81 100644 (file)
 
 #include "hmap.h"
 
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
 struct shash_node {
     struct hmap_node node;
     char *name;
@@ -31,6 +35,13 @@ struct shash {
 
 #define SHASH_INITIALIZER(SHASH) { HMAP_INITIALIZER(&(SHASH)->map) }
 
+#define SHASH_FOR_EACH(SHASH_NODE, SHASH)                               \
+    HMAP_FOR_EACH (SHASH_NODE, struct shash_node, node, &(SHASH)->map)
+
+#define SHASH_FOR_EACH_SAFE(SHASH_NODE, NEXT, SHASH)                \
+    HMAP_FOR_EACH_SAFE (SHASH_NODE, NEXT, struct shash_node, node,  \
+                        &(SHASH)->map)
+
 void shash_init(struct shash *);
 void shash_destroy(struct shash *);
 void shash_clear(struct shash *);
@@ -41,4 +52,8 @@ 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 *);
 
+#ifdef  __cplusplus
+}
+#endif
+
 #endif /* shash.h */