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
|
defmacro attach_function(name, arguments, return_type) do
|
||||||
quote do
|
quote do
|
||||||
def unquote(name)(pid, params) do
|
def unquote(name)(params) do
|
||||||
args = {unquote(name), params}
|
definition = {ffi_lib,
|
||||||
|
unquote(name),
|
||||||
|
unquote(arguments),
|
||||||
|
unquote(return_type)}
|
||||||
|
|
||||||
GenServer.call(pid, args)
|
FFI.call(definition, params)
|
||||||
end
|
|
||||||
|
|
||||||
def handle_call({unquote(name), params}, _from, state) do
|
|
||||||
IO.puts ffi_lib
|
|
||||||
a = IO.puts(params)
|
|
||||||
{:reply, a, state}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user