Packages

Call Erlang/Elixir functions from NIF and use the returned value in NIF.

Current section

Files

Jump to
nif_call lib nif.ex
Raw

lib/nif.ex

defmodule NifCall.NIF do
@moduledoc false
defmacro __using__(using_opts) do
funcname = Keyword.get(using_opts, :on_evaluated, :nif_call_evaluated)
quote do
def unquote(:"#{funcname}")(_from_ref, _results), do: :erlang.nif_error(:not_loaded)
end
end
end