Example #1
0
        public static JSValue JS_NewCFunction2(JSContext ctx, JSCFunction func, string name, int length,
                                               JSCFunctionEnum cproto, int magic)
        {
            var fn = Marshal.GetFunctionPointerForDelegate(func);

            return(JS_NewCFunction2(ctx, fn, name, length, cproto, magic));
        }
Example #2
0
        public static JSValue JSB_NewCFunctionMagic(JSContext ctx, JSCFunctionMagic func, JSAtom atom, int length,
                                                    JSCFunctionEnum cproto, int magic)
        {
            var fn = Marshal.GetFunctionPointerForDelegate(func);

            return(JSB_NewCFunctionMagic(ctx, fn, atom, length, cproto, magic));
        }
Example #3
0
        public static JSValue JS_NewCFunctionMagic(JSContext ctx, JSCFunctionMagic func,
                                                   [MarshalAs(UnmanagedType.LPStr)] string name,
                                                   int length, JSCFunctionEnum cproto, int magic)
        {
            var fn = Marshal.GetFunctionPointerForDelegate(func);

            return(JS_NewCFunction2(ctx, fn, name, length, cproto, magic));
        }
Example #4
0
        public static JSValue JS_NewCFunction2(JSContext ctx, JSCFunction func, string name, int length,
                                               JSCFunctionEnum cproto, int magic)
        {
#if JSB_UNITYLESS
            GCHandle.Alloc(func);
#endif
            var fn = Marshal.GetFunctionPointerForDelegate(func);
            return(JS_NewCFunction2(ctx, fn, name, length, cproto, magic));
        }
Example #5
0
        public static JSValue JSB_NewCFunctionMagic(JSContext ctx, JSCFunctionMagic func, JSAtom atom, int length,
                                                    JSCFunctionEnum cproto, int magic)
        {
#if JSB_UNITYLESS
            GCHandle.Alloc(func);
#endif
            var fn = Marshal.GetFunctionPointerForDelegate(func);
            return(JSB_NewCFunctionMagic(ctx, fn, atom, length, cproto, magic));
        }
Example #6
0
 private static extern JSValue JS_NewCFunction2(JSContext ctx, IntPtr func,
                                                [MarshalAs(UnmanagedType.LPStr)] string name,
                                                int length, JSCFunctionEnum cproto, int magic);
Example #7
0
 private static extern JSValue JSB_NewCFunctionMagic(JSContext ctx, IntPtr func, JSAtom atom, int length,
                                                     JSCFunctionEnum cproto, int magic);