An upcoming commit will add a caller.
Signed-off-by: Ben Pfaff <blp@nicira.com>
free(node);
}
+/* Deletes 'node' from 'sh'. Neither the node's key nor its value is freed;
+ * instead, ownership is transferred to the caller. Returns the node's key. */
+char *
+smap_steal(struct smap *smap, struct smap_node *node)
+{
+ char *key = node->key;
+
+ hmap_remove(&smap->map, &node->node);
+ free(node);
+ return key;
+}
+
/* Removes all key-value pairs from 'smap'. */
void
smap_clear(struct smap *smap)
void smap_replace(struct smap *, const char *, const char *);
void smap_remove(struct smap *, const char *);
-void smap_remove_node(struct smap *smap, struct smap_node *);
+void smap_remove_node(struct smap *, struct smap_node *);
+char *smap_steal(struct smap *, struct smap_node *);
void smap_clear(struct smap *);
const char *smap_get(const struct smap *, const char *);