search for: get_size_wrapp

Displaying 8 results from an estimated 8 matches for "get_size_wrapp".

Did you mean: get_size_wrapper
2020 Apr 10
3
[PATCH nbdkit UNFINISHED] Add the ability to write plugins in golang.
Sorry Dan, but I really do dislike golang with a passion :-) Here is a patch that allows you to write nbdkit plugins in golang. As with C, OCaml and Rust, you can write a plugin in Go which compiles directly to a .so file that can be loaded into golang, so in that sense it works completely differently from scripting language plugins like Perl and Python where there's an
2020 Apr 15
2
Re: [PATCH nbdkit UNFINISHED] Add the ability to write plugins in golang.
...Features() plugin.name = C.CString(name) plugin.open = (*[0]byte)(C.open_wrapper) plugin.close = (*[0]byte)(C.close_wrapper) for _, feature := range features { switch feature { case NBDKitFeatureGetSize: plugin.get_size = (*[0]byte)(C.get_size_wrapper) case NBDKitFeaturePread: plugin.pread = (*[0]byte)(C.pread_wrapper) } } } ....all the methods like C.pread_wrapper/C.get_size_wrapper need to invoke pluginImpl methods.... // This type implements all methods in NBDKitPlugin, wit...
2020 Apr 10
0
[PATCH nbdkit UNFINISHED] Add the ability to write plugins in golang.
...IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +extern void *open_wrapper (int readonly); +extern void close_wrapper (void *handle); +extern int64_t get_size_wrapper (void *handle); +extern int pread_wrapper (void *handle, void *buf, + uint32_t count, uint64_t offset, uint32_t flags); +extern int pwrite_wrapper (void *handle, const void *buf, + uint32_t count, uint64_t offset, uint32_t flags); +// XXX ALL WRA...
2020 Sep 01
0
[nbdkit PATCH 2/2] ocaml: Implement .list_exports and friends
...rror ("%s", caml_format_exception (Extract_exception (rv))); + caml_enter_blocking_section (); + CAMLreturnT (const char *, NULL); + } + + desc = nbdkit_strdup_intern (String_val (rv)); + + caml_enter_blocking_section (); + CAMLreturnT (const char *, desc); +} + static int64_t get_size_wrapper (void *h) { @@ -856,10 +939,13 @@ SET(get_ready) SET(after_fork) SET(preconnect) +SET(list_exports) +SET(default_export) SET(open) SET(close) SET(get_size) +SET(export_description) SET(can_write) SET(can_flush) @@ -900,10 +986,13 @@ remove_roots (void) REMOVE (after_fork); REMOV...
2020 Sep 21
0
[nbdkit PATCH v3 14/14] ocaml: Implement .list_exports and friends
...rror ("%s", caml_format_exception (Extract_exception (rv))); + caml_enter_blocking_section (); + CAMLreturnT (const char *, NULL); + } + + desc = nbdkit_strdup_intern (String_val (rv)); + + caml_enter_blocking_section (); + CAMLreturnT (const char *, desc); +} + static int64_t get_size_wrapper (void *h) { @@ -747,7 +831,7 @@ extents_wrapper (void *h, uint32_t count, uint64_t offset, uint32_t flags, } /* Convert extents list into calls to nbdkit_add_extent. */ - while (rv != Val_int (0)) { + while (rv != Val_emptylist) { uint64_t length; uint32_t type = 0; @@ -856,1...
2020 Apr 21
2
[PATCH nbdkit v2] Add the ability to write plugins in golang.
...THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +extern int config_wrapper (const char *key, const char *value); +extern int config_complete_wrapper (void); +extern void *open_wrapper (int readonly); +extern void close_wrapper (void *handle); +extern int64_t get_size_wrapper (void *handle); +extern int pread_wrapper (void *handle, void *buf, + uint32_t count, uint64_t offset, uint32_t flags); diff --git a/plugins/golang/config-test.go b/plugins/golang/config-test.go new file mode 100644 index 00000000..0f5cfe6b --- /dev/null +++ b/plugins/gol...
2020 Sep 01
4
[nbdkit PATCH 0/2] More language bindings for .list_exports
This picks up python and ocaml. Some of our languages are lacking a number of bindings (for example, lua and perl lack .extents, so I didn't have anything to copy from), and I felt less comfortable with golang and rust. But for python and ocaml, I was able to test a working implementation. Eric Blake (2): python: Implement .list_exports and friends ocaml: Implement .list_exports and
2020 Sep 21
18
[nbdkit PATCH v3 00/14] exportname filter
It's been several weeks since I posted v2 (I got distracted by improving libnbd to better test things, which in turn surfaced some major memory leak problems in nbdsh that are now fixed). Many of the patches are minor rebases from v2, with the biggest changes being fallout from: - patch 2: rename nbdkit_add_default_export to nbdkit_use_default_export - overall: this missed 1.22, so update