initscript: pass complete path to pidfile to status command
[sliver-openvswitch.git] / lib / shash.h
index 9201bb5..5794a20 100644 (file)
@@ -31,12 +31,21 @@ 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 *);
-void shash_add(struct shash *, const char *, void *);
+bool shash_is_empty(const struct shash *);
+struct shash_node *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 *);
+struct shash_node *shash_first(const struct shash *);
 
 #endif /* shash.h */