public void Dispose() { if (this.ptr != IntPtr.Zero) { MetacallAPI.metacall_value_destroy(this.ptr); } }
public ExecutionResult Invoke(string function, params object[] args) { List <IntPtr> metacallArgs = new List <IntPtr>(args.Length); foreach (var arg in args) { metacallArgs.Add(primitiveToIntPtr[arg.GetType()](arg)); } IntPtr ptr = MetacallAPI.metacallv(function, metacallArgs.ToArray()); return(ExecutionResult.Make(ptr)); }
public IFunction GetFuntion(string name) { IntPtr pointer = IntPtr.Zero; IFunction result = null; pointer = MetacallAPI.metacall_function(name); if (pointer != IntPtr.Zero) { result = new Function(this, pointer); } return(result); }
public bool HasFunction(string name) { return(MetacallAPI.metacall_function(name) != IntPtr.Zero); }
public bool LoadScriptFromFile(string tag, params string[] files) { var ff = files.Select(x => Marshal.StringToHGlobalAnsi(x)).ToArray(); return(MetacallAPI.metacall_load_from_file(tag, ff, (long)files.Length) == 0); }
static Metacall() { MetacallAPI.metacall_initialize(); }