]> git.proxmox.com Git - ovs.git/blame - lib/ovsdb-error.h
Initial implementation of OVSDB.
[ovs.git] / lib / ovsdb-error.h
CommitLineData
f85f8ebb
BP
1/* Copyright (c) 2009 Nicira Networks
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_ERROR_H
17#define OVSDB_ERROR_H 1
18
19#include "compiler.h"
20
21struct json;
22
23struct ovsdb_error *ovsdb_error(const char *tag, const char *details, ...)
24 PRINTF_FORMAT(2, 3)
25 WARN_UNUSED_RESULT;
26struct ovsdb_error *ovsdb_io_error(int error, const char *details, ...)
27 PRINTF_FORMAT(2, 3)
28 WARN_UNUSED_RESULT;
29struct ovsdb_error *ovsdb_syntax_error(const struct json *, const char *tag,
30 const char *details, ...)
31 PRINTF_FORMAT(3, 4)
32 WARN_UNUSED_RESULT;
33
34struct ovsdb_error *ovsdb_wrap_error(struct ovsdb_error *error,
35 const char *details, ...)
36 PRINTF_FORMAT(2, 3);
37
38struct ovsdb_error *ovsdb_internal_error(const char *file, int line,
39 const char *details, ...)
40 PRINTF_FORMAT(3, 4)
41 WARN_UNUSED_RESULT;
42#define OVSDB_BUG(MSG) ovsdb_internal_error(__FILE__, __LINE__, "%s", MSG)
43
44void ovsdb_error_destroy(struct ovsdb_error *);
45struct ovsdb_error *ovsdb_error_clone(const struct ovsdb_error *)
46 WARN_UNUSED_RESULT;
47
48char *ovsdb_error_to_string(const struct ovsdb_error *);
49struct json *ovsdb_error_to_json(const struct ovsdb_error *);
50
51const char *ovsdb_error_get_tag(const struct ovsdb_error *);
52
53#endif /* ovsdb-error.h */