X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fsmap.h;h=640c2a82c536787122907afd4fa9affd063e50ef;hb=003ce655b7116d18c86a74c50391e54990346931;hp=993d0b2434617bad3a81ec8e24b9bb6d4b4737c7;hpb=79f1cbe9f86ddfb1b5d92b80d85e09cd44768d6c;p=sliver-openvswitch.git diff --git a/lib/smap.h b/lib/smap.h index 993d0b243..640c2a82c 100644 --- a/lib/smap.h +++ b/lib/smap.h @@ -17,6 +17,8 @@ #include "hmap.h" +struct json; + /* A map from string to string. */ struct smap { struct hmap map; /* Contains "struct smap_node"s. */ @@ -46,7 +48,8 @@ void smap_add_format(struct smap *, const char *key, const char *, ...) 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 *); +void smap_steal(struct smap *, struct smap_node *, char **keyp, char **valuep); void smap_clear(struct smap *); const char *smap_get(const struct smap *, const char *); @@ -57,7 +60,10 @@ int smap_get_int(const struct smap *smap, const char *key, int def); bool smap_is_empty(const struct smap *); size_t smap_count(const struct smap *); -void smap_clone(struct smap *dst, struct smap *src); +void smap_clone(struct smap *dst, const struct smap *src); const struct smap_node **smap_sort(const struct smap *); +void smap_from_json(struct smap *, const struct json *); +struct json *smap_to_json(const struct smap *); + #endif /* smap.h */