Update Red Hat Copyright Notices
[nbdkit.git] / plugins / golang / src / libguestfs.org / nbdkit / wrappers.go
blob68fb563b447bba2e11705a02835785ca0d96a620
1 /* cgo wrappers.
2 * Copyright Red Hat
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * * Neither the name of Red Hat nor the names of its contributors may be
16 * used to endorse or promote products derived from this software without
17 * specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
33 package nbdkit
36 #cgo pkg-config: nbdkit
38 #include <stdio.h>
39 #include <stdlib.h>
41 #define NBDKIT_API_VERSION 2
42 #include <nbdkit-plugin.h>
43 #include "wrappers.h"
45 extern void implLoad ();
46 void
47 wrapper_load (void)
49 implLoad ();
52 extern void implUnload ();
53 void
54 wrapper_unload (void)
56 implUnload ();
59 extern void implDumpPlugin ();
60 void
61 wrapper_dump_plugin (void)
63 implDumpPlugin ();
66 extern int implConfig ();
67 int
68 wrapper_config (const char *key, const char *value)
70 return implConfig (key, value);
73 extern int implConfigComplete ();
74 int
75 wrapper_config_complete (void)
77 return implConfigComplete ();
80 extern int implGetReady ();
81 int
82 wrapper_get_ready (void)
84 return implGetReady ();
87 extern int implPreConnect ();
88 int
89 wrapper_preconnect (int readonly)
91 return implPreConnect (readonly);
94 extern void *implOpen ();
95 void *
96 wrapper_open (int readonly)
98 return implOpen (readonly);
101 extern void implClose ();
102 void
103 wrapper_close (void *handle)
105 return implClose (handle);
108 extern int64_t implGetSize ();
109 int64_t
110 wrapper_get_size (void *handle)
112 return implGetSize (handle);
115 extern int implCanWrite ();
117 wrapper_can_write (void *handle)
119 return implCanWrite (handle);
122 extern int implCanFlush ();
124 wrapper_can_flush (void *handle)
126 return implCanFlush (handle);
129 extern int implIsRotational ();
131 wrapper_is_rotational (void *handle)
133 return implIsRotational (handle);
136 extern int implCanTrim ();
138 wrapper_can_trim (void *handle)
140 return implCanTrim (handle);
143 extern int implCanZero ();
145 wrapper_can_zero (void *handle)
147 return implCanZero (handle);
150 extern int implCanMultiConn ();
152 wrapper_can_multi_conn (void *handle)
154 return implCanMultiConn (handle);
157 extern int implPRead ();
159 wrapper_pread (void *handle, void *buf,
160 uint32_t count, uint64_t offset, uint32_t flags)
162 return implPRead (handle, buf, count, offset, flags);
165 extern int implPWrite ();
167 wrapper_pwrite (void *handle, const void *buf,
168 uint32_t count, uint64_t offset, uint32_t flags)
170 return implPWrite (handle, buf, count, offset, flags);
173 extern int implFlush ();
175 wrapper_flush (void *handle, uint32_t flags)
177 return implFlush (handle, flags);
180 extern int implTrim ();
182 wrapper_trim (void *handle,
183 uint32_t count, uint64_t offset, uint32_t flags)
185 return implTrim (handle, count, offset, flags);
188 extern int implZero ();
190 wrapper_zero (void *handle,
191 uint32_t count, uint64_t offset, uint32_t flags)
193 return implZero (handle, count, offset, flags);
196 import "C"