lib/extism.rb in extism-0.1.0 vs lib/extism.rb in extism-0.2.0
- old
+ new
@@ -129,11 +129,11 @@
if wasm.class == Hash
wasm = JSON.generate(wasm)
end
code = FFI::MemoryPointer.new(:char, wasm.bytesize)
code.put_bytes(0, wasm)
- @plugin = C.extism_plugin_new(context.pointer, code, wasm.bytesize, wasi)
+ @plugin = C.extism_plugin_new(context.pointer, code, wasm.bytesize, nil, 0, wasi)
if @plugin < 0
err = C.extism_error(@context.pointer, -1)
if err&.empty?
raise Error.new "extism_plugin_new failed"
else
@@ -159,11 +159,11 @@
if wasm.class == Hash
wasm = JSON.generate(wasm)
end
code = FFI::MemoryPointer.new(:char, wasm.bytesize)
code.put_bytes(0, wasm)
- ok = C.extism_plugin_update(@context.pointer, @plugin, code, wasm.bytesize, wasi)
+ ok = C.extism_plugin_update(@context.pointer, @plugin, code, wasm.bytesize, nil, 0, wasi)
if !ok
err = C.extism_error(@context.pointer, @plugin)
if err&.empty?
raise Error.new "extism_plugin_update failed"
else
@@ -228,11 +228,11 @@
module C
extend FFI::Library
ffi_lib "extism"
attach_function :extism_context_new, [], :pointer
attach_function :extism_context_free, [:pointer], :void
- attach_function :extism_plugin_new, [:pointer, :pointer, :uint64, :bool], :int32
- attach_function :extism_plugin_update, [:pointer, :int32, :pointer, :uint64, :bool], :bool
+ attach_function :extism_plugin_new, [:pointer, :pointer, :uint64, :pointer, :uint64, :bool], :int32
+ attach_function :extism_plugin_update, [:pointer, :int32, :pointer, :uint64, :pointer, :uint64, :bool], :bool
attach_function :extism_error, [:pointer, :int32], :string
attach_function :extism_plugin_call, [:pointer, :int32, :string, :pointer, :uint64], :int32
attach_function :extism_plugin_function_exists, [:pointer, :int32, :string], :bool
attach_function :extism_plugin_output_length, [:pointer, :int32], :uint64
attach_function :extism_plugin_output_data, [:pointer, :int32], :pointer