search for: plugin_rb_trim

Displaying 6 results from an estimated 6 matches for "plugin_rb_trim".

2017 Feb 02
0
[nbdkit PATCH 2/2] ruby: Support zero callback
...uby.h> static VALUE nbdkit_module = Qnil; +static int last_error; static VALUE set_error(VALUE self, VALUE arg) @@ -58,6 +60,7 @@ set_error(VALUE self, VALUE arg) } else { err = NUM2INT(arg); } + last_error = err; nbdkit_set_error(err); return Qnil; } @@ -367,6 +370,30 @@ plugin_rb_trim (void *handle, uint32_t count, uint64_t offset) } static int +plugin_rb_zero (void *handle, uint32_t count, uint64_t offset, int may_trim) +{ + volatile VALUE argv[4]; + + argv[0] = (VALUE) handle; + argv[1] = ULL2NUM (count); + argv[2] = ULL2NUM (offset); + argv[3] = may_trim ? Qtrue : Qfa...
2017 Feb 02
3
[nbdkit PATCH 0/2] Ruby bindings for .zero
Similar to python and perl. But MUCH easier (especially considering that this is the first time I've every tried to run Ruby). I even had fun making set_error() polymorphic. Eric Blake (2): ruby: Expose nbdkit_set_error to ruby script ruby: Support zero callback plugins/ruby/example.rb | 11 ++++++++ plugins/ruby/nbdkit-ruby-plugin.pod | 54
2017 Feb 06
0
[PATCH 1/2] Define .errno_is_preserved constant instead of a .errno_is_reliable callback.
...gin_rb_config_help \ "script=<FILENAME> (required) The Ruby plugin to run.\n" \ "[other arguments may be used by the plugin that you load]" @@ -511,8 +501,6 @@ static struct nbdkit_plugin plugin = { .flush = plugin_rb_flush, .trim = plugin_rb_trim, .zero = plugin_rb_zero, - - .errno_is_reliable = plugin_rb_errno_is_reliable, }; NBDKIT_REGISTER_PLUGIN(plugin) diff --git a/src/connections.c b/src/connections.c index cf06ac5..a0d689a 100644 --- a/src/connections.c +++ b/src/connections.c @@ -498,10 +498,7 @@ negotiate_hands...
2017 Jan 27
0
[nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...ILENAME> (required) The Ruby plugin to run.\n" \ "[other arguments may be used by the plugin that you load]" @@ -450,6 +460,8 @@ static struct nbdkit_plugin plugin = { .pwrite = plugin_rb_pwrite, .flush = plugin_rb_flush, .trim = plugin_rb_trim, + + .errno_is_reliable = plugin_rb_errno_is_reliable, }; NBDKIT_REGISTER_PLUGIN(plugin) diff --git a/src/connections.c b/src/connections.c index c0f0567..23e82a9 100644 --- a/src/connections.c +++ b/src/connections.c @@ -498,7 +498,10 @@ negotiate_handshake (struct connection *conn) int r;...
2017 Feb 06
3
[PATCH nbdkit 0/2] Change .errno_is_reliable function to .errno_is_preserved constant.
See patch 1 for rationale.
2017 Jan 27
6
[nbdkit PATCH v3 0/4] bind .zero to Python
This cleans up the existing code base with regards to implicit use of errno from language bindings, then rebases the previous work in python on top of that. I'm still playing with the perl bindings, but got further after reading 'perldoc perlembed'. Eric Blake (4): plugins: Don't use bogus errno from non-C plugins plugins: Add new nbdkit_set_error() utility function python: