dpif: Hide the contents of struct dpif.
[openvswitch] / lib / shash.c
index 9ddafe0be6fa47314cf773c6230acbbeb0e5caeb..93163727655a02ba633883015d755a4780b99d1d 100644 (file)
@@ -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
@@ -91,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 *
+shash_first(const struct shash *shash)
+{
+    struct hmap_node *node = hmap_first(&shash->map);
+    return node ? CONTAINER_OF(node, struct shash_node, node) : NULL;
+}
+