예제 #1
0
 public void Dispose()
 {
     if (this.ptr != IntPtr.Zero)
     {
         MetacallAPI.metacall_value_destroy(this.ptr);
     }
 }
예제 #2
0
        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));
        }
예제 #3
0
        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);
        }
예제 #4
0
 public bool HasFunction(string name)
 {
     return(MetacallAPI.metacall_function(name) != IntPtr.Zero);
 }
예제 #5
0
        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);
        }
예제 #6
0
파일: Metacall.cs 프로젝트: lineCode/core-6
 static Metacall()
 {
     MetacallAPI.metacall_initialize();
 }