+static void ovsdb_file_txn_init(struct ovsdb_file_txn *);
+static void ovsdb_file_txn_add_row(struct ovsdb_file_txn *,
+ const struct ovsdb_row *old,
+ const struct ovsdb_row *new,
+ const unsigned long int *changed);
+static struct ovsdb_error *ovsdb_file_txn_commit(struct json *,
+ const char *comment,
+ bool durable,
+ struct ovsdb_log *);
+
+static struct ovsdb_error *ovsdb_file_open__(const char *file_name,
+ const struct ovsdb_schema *,
+ bool read_only, struct ovsdb **,
+ struct ovsdb_file **);
+static struct ovsdb_error *ovsdb_file_txn_from_json(
+ struct ovsdb *, const struct json *, bool converting,
+ long long int *date, struct ovsdb_txn **);
+static struct ovsdb_error *ovsdb_file_create(struct ovsdb *,
+ struct ovsdb_log *,
+ const char *file_name,
+ long long int oldest_commit,
+ unsigned int n_transactions,
+ struct ovsdb_file **filep);
+
+/* Opens database 'file_name' and stores a pointer to the new database in
+ * '*dbp'. If 'read_only' is false, then the database will be locked and
+ * changes to the database will be written to disk. If 'read_only' is true,
+ * the database will not be locked and changes to the database will persist
+ * only as long as the "struct ovsdb".
+ *
+ * If 'filep' is nonnull and 'read_only' is false, then on success sets
+ * '*filep' to an ovsdb_file that represents the open file. This ovsdb_file
+ * persists until '*dbp' is destroyed.
+ *
+ * On success, returns NULL. On failure, returns an ovsdb_error (which the
+ * caller must destroy) and sets '*dbp' and '*filep' to NULL. */
+struct ovsdb_error *
+ovsdb_file_open(const char *file_name, bool read_only,
+ struct ovsdb **dbp, struct ovsdb_file **filep)
+{
+ return ovsdb_file_open__(file_name, NULL, read_only, dbp, filep);
+}
+
+/* Opens database 'file_name' with an alternate schema. The specified 'schema'
+ * is used to interpret the data in 'file_name', ignoring the schema actually
+ * stored in the file. Data in the file for tables or columns that do not
+ * exist in 'schema' are ignored, but the ovsdb file format must otherwise be
+ * observed, including column constraints.
+ *
+ * This function can be useful for upgrading or downgrading databases to
+ * "almost-compatible" formats.
+ *
+ * The database will not be locked. Changes to the database will persist only
+ * as long as the "struct ovsdb".
+ *
+ * On success, stores a pointer to the new database in '*dbp' and returns a
+ * null pointer. On failure, returns an ovsdb_error (which the caller must
+ * destroy) and sets '*dbp' to NULL. */