src: Add DMA localagent
[barometer.git] / src / dma / vendor / github.com / libvirt / libvirt-go / interface_wrapper.go
1 /*
2  * This file is part of the libvirt-go project
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  *
22  * Copyright (C) 2018 Red Hat, Inc.
23  *
24  */
25
26 package libvirt
27
28 /*
29 #cgo pkg-config: libvirt
30 #include <assert.h>
31 #include "interface_wrapper.h"
32
33
34 int
35 virInterfaceCreateWrapper(virInterfacePtr iface,
36                           unsigned int flags,
37                           virErrorPtr err)
38 {
39     int ret = virInterfaceCreate(iface, flags);
40     if (ret < 0) {
41         virCopyLastError(err);
42     }
43     return ret;
44 }
45
46
47 int
48 virInterfaceDestroyWrapper(virInterfacePtr iface,
49                            unsigned int flags,
50                            virErrorPtr err)
51 {
52     int ret = virInterfaceDestroy(iface, flags);
53     if (ret < 0) {
54         virCopyLastError(err);
55     }
56     return ret;
57 }
58
59
60 int
61 virInterfaceFreeWrapper(virInterfacePtr iface,
62                         virErrorPtr err)
63 {
64     int ret = virInterfaceFree(iface);
65     if (ret < 0) {
66         virCopyLastError(err);
67     }
68     return ret;
69 }
70
71
72 virConnectPtr
73 virInterfaceGetConnectWrapper(virInterfacePtr iface,
74                               virErrorPtr err)
75 {
76     virConnectPtr ret = virInterfaceGetConnect(iface);
77     if (!ret) {
78         virCopyLastError(err);
79     }
80     return ret;
81 }
82
83
84 const char *
85 virInterfaceGetMACStringWrapper(virInterfacePtr iface,
86                                 virErrorPtr err)
87 {
88     const char * ret = virInterfaceGetMACString(iface);
89     if (!ret) {
90         virCopyLastError(err);
91     }
92     return ret;
93 }
94
95
96 const char *
97 virInterfaceGetNameWrapper(virInterfacePtr iface,
98                            virErrorPtr err)
99 {
100     const char * ret = virInterfaceGetName(iface);
101     if (!ret) {
102         virCopyLastError(err);
103     }
104     return ret;
105 }
106
107
108 char *
109 virInterfaceGetXMLDescWrapper(virInterfacePtr iface,
110                               unsigned int flags,
111                               virErrorPtr err)
112 {
113     char * ret = virInterfaceGetXMLDesc(iface, flags);
114     if (!ret) {
115         virCopyLastError(err);
116     }
117     return ret;
118 }
119
120
121 int
122 virInterfaceIsActiveWrapper(virInterfacePtr iface,
123                             virErrorPtr err)
124 {
125     int ret = virInterfaceIsActive(iface);
126     if (ret < 0) {
127         virCopyLastError(err);
128     }
129     return ret;
130 }
131
132
133 int
134 virInterfaceRefWrapper(virInterfacePtr iface,
135                        virErrorPtr err)
136 {
137     int ret = virInterfaceRef(iface);
138     if (ret < 0) {
139         virCopyLastError(err);
140     }
141     return ret;
142 }
143
144
145 int
146 virInterfaceUndefineWrapper(virInterfacePtr iface,
147                             virErrorPtr err)
148 {
149     int ret = virInterfaceUndefine(iface);
150     if (ret < 0) {
151         virCopyLastError(err);
152     }
153     return ret;
154 }
155
156
157 */
158 import "C"