]> git.proxmox.com Git - mirror_ovs.git/blob - ovsdb/file.h
ovsdb: Use new ovsdb_log_write_and_free().
[mirror_ovs.git] / ovsdb / file.h
1 /* Copyright (c) 2009, 2010, 2011, 2016, 2017 Nicira, Inc.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #ifndef OVSDB_FILE_H
17 #define OVSDB_FILE_H 1
18
19 #include <stdbool.h>
20 #include "compiler.h"
21
22 struct ovsdb;
23 struct ovsdb_schema;
24 struct ovsdb_txn;
25
26 struct json *ovsdb_to_txn_json(const struct ovsdb *, const char *comment);
27 struct json *ovsdb_file_txn_to_json(const struct ovsdb_txn *);
28 struct json *ovsdb_file_txn_annotate(struct json *, const char *comment);
29 struct ovsdb_error *ovsdb_file_txn_from_json(struct ovsdb *,
30 const struct json *,
31 bool converting,
32 struct ovsdb_txn **)
33 OVS_WARN_UNUSED_RESULT;
34
35 struct ovsdb *ovsdb_file_read(const char *filename, bool rw);
36 struct ovsdb *ovsdb_file_read_as_schema(const char *filename,
37 struct ovsdb_schema *);
38
39 struct ovsdb_error *ovsdb_convert(const struct ovsdb *src,
40 const struct ovsdb_schema *new_schema,
41 struct ovsdb **dstp)
42 OVS_WARN_UNUSED_RESULT;
43
44 #endif /* ovsdb/file.h */