json: Better handle JSON objects with duplicate names.
[openvswitch] / lib / ovsdb-data.h
index 063536b220e0a079161bc8bde5c5ce429d7da826..e12153c9c71b9974a4d7bd6e87c0be1f19e11d65 100644 (file)
@@ -75,7 +75,8 @@ struct json *ovsdb_atom_to_json(const union ovsdb_atom *,
                                 enum ovsdb_atomic_type);
 
 char *ovsdb_atom_from_string(union ovsdb_atom *,
-                             const struct ovsdb_base_type *, const char *)
+                             const struct ovsdb_base_type *, const char *,
+                             struct ovsdb_symbol_table *)
     WARN_UNUSED_RESULT;
 void ovsdb_atom_to_string(const union ovsdb_atom *, enum ovsdb_atomic_type,
                           struct ds *);
@@ -122,7 +123,12 @@ void ovsdb_datum_swap(struct ovsdb_datum *, struct ovsdb_datum *);
 
 /* Checking and maintaining invariants. */
 struct ovsdb_error *ovsdb_datum_sort(struct ovsdb_datum *,
-                                     const struct ovsdb_type *);
+                                     enum ovsdb_atomic_type key_type)
+    WARN_UNUSED_RESULT;
+
+void ovsdb_datum_sort_assert(struct ovsdb_datum *,
+                             enum ovsdb_atomic_type key_type);
+
 struct ovsdb_error *ovsdb_datum_check_constraints(
     const struct ovsdb_datum *, const struct ovsdb_type *)
     WARN_UNUSED_RESULT;
@@ -137,7 +143,8 @@ struct json *ovsdb_datum_to_json(const struct ovsdb_datum *,
                                  const struct ovsdb_type *);
 
 char *ovsdb_datum_from_string(struct ovsdb_datum *,
-                             const struct ovsdb_type *, const char *)
+                              const struct ovsdb_type *, const char *,
+                              struct ovsdb_symbol_table *)
     WARN_UNUSED_RESULT;
 void ovsdb_datum_to_string(const struct ovsdb_datum *,
                            const struct ovsdb_type *, struct ds *);
@@ -211,6 +218,7 @@ struct ovsdb_symbol *ovsdb_symbol_table_put(struct ovsdb_symbol_table *,
                                             const struct uuid *, bool used);
 struct ovsdb_symbol *ovsdb_symbol_table_insert(struct ovsdb_symbol_table *,
                                                const char *name);
+const char *ovsdb_symbol_table_find_unused(const struct ovsdb_symbol_table *);
 \f
 /* Tokenization
  *