Update FFI.Library to use FFI.call

This commit is contained in:
Josh Nussbaum
2015-09-20 21:16:39 -04:00
parent 5310d6f92b
commit 6ffa064069

View File

@@ -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