Update FFI.Library to use FFI.call
This commit is contained in:
@@ -14,16 +14,13 @@ defmodule FFI.Library do
|
||||
|
||||
defmacro attach_function(name, arguments, return_type) do
|
||||
quote do
|
||||
def unquote(name)(pid, params) do
|
||||
args = {unquote(name), params}
|
||||
def unquote(name)(params) do
|
||||
definition = {ffi_lib,
|
||||
unquote(name),
|
||||
unquote(arguments),
|
||||
unquote(return_type)}
|
||||
|
||||
GenServer.call(pid, args)
|
||||
end
|
||||
|
||||
def handle_call({unquote(name), params}, _from, state) do
|
||||
IO.puts ffi_lib
|
||||
a = IO.puts(params)
|
||||
{:reply, a, state}
|
||||
FFI.call(definition, params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user