From f1a8e8cace548015ce61ed445a8ae069bd12ee8c Mon Sep 17 00:00:00 2001 From: Josh Nussbaum Date: Sun, 20 Sep 2015 21:15:55 -0400 Subject: [PATCH] Added functions to FFI module --- lib/ffi.ex | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/ffi.ex b/lib/ffi.ex index 6c0395f..baf526c 100644 --- a/lib/ffi.ex +++ b/lib/ffi.ex @@ -1,2 +1,14 @@ defmodule FFI do + @on_load :init + + def init do + :erlang.load_nif("./ffi_nif", 0) + end + + def call({library, name, arguments, return_type}, params), + do: nif_call(library, name, arguments, return_type, params) + + def nif_call(library, name, arguments, return_type, params) do + :badarg + end end