forked from loongly/PureScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBinder.funcser.cs
More file actions
218 lines (207 loc) · 7.47 KB
/
Binder.funcser.cs
File metadata and controls
218 lines (207 loc) · 7.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
using PureScript;
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Object = UnityEngine.Object;
using Random = UnityEngine.Random;
using PureScript;
using AOT;
public static unsafe class UnityBind
{
static readonly PureScript_ExceptionTest_set_callback_Type PureScript_ExceptionTest_set_callbackDelegate = new PureScript_ExceptionTest_set_callback_Type(PureScript_ExceptionTest_set_callback);
static readonly PureScript_ExceptionTest_get_callback_Type PureScript_ExceptionTest_get_callbackDelegate = new PureScript_ExceptionTest_get_callback_Type(PureScript_ExceptionTest_get_callback);
static readonly PureScript_ExceptionTest_NullPointException_Type PureScript_ExceptionTest_NullPointExceptionDelegate = new PureScript_ExceptionTest_NullPointException_Type(PureScript_ExceptionTest_NullPointException);
static readonly PureScript_ExceptionTest_TestCallBack_Type PureScript_ExceptionTest_TestCallBackDelegate = new PureScript_ExceptionTest_TestCallBack_Type(PureScript_ExceptionTest_TestCallBack);
static readonly PureScript_ExceptionTest__ctor_Type PureScript_ExceptionTest__ctorDelegate = new PureScript_ExceptionTest__ctor_Type(PureScript_ExceptionTest__ctor);
static readonly PureScript_StartInfo_get_ReloadDllName_Type PureScript_StartInfo_get_ReloadDllNameDelegate = new PureScript_StartInfo_get_ReloadDllName_Type(PureScript_StartInfo_get_ReloadDllName);
static readonly PureScript_StartInfo_get_ReloadClassName_Type PureScript_StartInfo_get_ReloadClassNameDelegate = new PureScript_StartInfo_get_ReloadClassName_Type(PureScript_StartInfo_get_ReloadClassName);
static readonly PureScript_StartInfo_get_TestMethodName_Type PureScript_StartInfo_get_TestMethodNameDelegate = new PureScript_StartInfo_get_TestMethodName_Type(PureScript_StartInfo_get_TestMethodName);
static readonly PureScript_StartInfo__ctor_1_Type PureScript_StartInfo__ctor_1Delegate = new PureScript_StartInfo__ctor_1_Type(PureScript_StartInfo__ctor_1);
public static IntPtr BindFunc()
{
IntPtr memory = Marshal.AllocHGlobal(8192*8);
int curMemory = 0;;
Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(PureScript_ExceptionTest_set_callbackDelegate));
curMemory += IntPtr.Size;
Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(PureScript_ExceptionTest_get_callbackDelegate));
curMemory += IntPtr.Size;
Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(PureScript_ExceptionTest_NullPointExceptionDelegate));
curMemory += IntPtr.Size;
Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(PureScript_ExceptionTest_TestCallBackDelegate));
curMemory += IntPtr.Size;
Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(PureScript_ExceptionTest__ctorDelegate));
curMemory += IntPtr.Size;
Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(PureScript_StartInfo_get_ReloadDllNameDelegate));
curMemory += IntPtr.Size;
Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(PureScript_StartInfo_get_ReloadClassNameDelegate));
curMemory += IntPtr.Size;
Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(PureScript_StartInfo_get_TestMethodNameDelegate));
curMemory += IntPtr.Size;
Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(PureScript_StartInfo__ctor_1Delegate));
curMemory += IntPtr.Size;
Custom.Ser(memory + curMemory);
return memory;
}
static Delegate5523eb28 ExceptionTest_callback;
static void OnExceptionTest_callback(this global::PureScript.ExceptionTest arg0)
{
var arg0_h = ObjectStore.Store(arg0);
ExceptionTest_callback(arg0_h);
ScriptEngine.CheckException();
}
[MonoPInvokeCallback(typeof(PureScript_ExceptionTest_set_callback_Type))]
static void PureScript_ExceptionTest_set_callback (int thiz_h, IntPtr value_p)
{
Exception __e = null;
try
{
var thizObj = ObjectStore.Get<global::PureScript.ExceptionTest>(thiz_h);
ExceptionTest_callback = Marshal.GetDelegateForFunctionPointer<Delegate5523eb28>(value_p);
thizObj.callback = thizObj.OnExceptionTest_callback;
}
catch(Exception e)
{
__e = e;
}
if(__e != null)
ScriptEngine.OnException(__e.ToString());
}
[MonoPInvokeCallback(typeof(PureScript_ExceptionTest_get_callback_Type))]
static IntPtr PureScript_ExceptionTest_get_callback (int thiz_h)
{
Exception __e = null;
try
{
var thizObj = ObjectStore.Get<global::PureScript.ExceptionTest>(thiz_h);
var _value = thizObj.callback;
var _value_p = Marshal.GetFunctionPointerForDelegate(_value);
return _value_p;
}
catch(Exception e)
{
__e = e;
}
if(__e != null)
ScriptEngine.OnException(__e.ToString());
return default(IntPtr);
}
[MonoPInvokeCallback(typeof(PureScript_ExceptionTest_NullPointException_Type))]
static void PureScript_ExceptionTest_NullPointException (int thiz_h)
{
Exception __e = null;
try
{
var thizObj = ObjectStore.Get<global::PureScript.ExceptionTest>(thiz_h);
thizObj.NullPointException();
}
catch(Exception e)
{
__e = e;
}
if(__e != null)
ScriptEngine.OnException(__e.ToString());
}
[MonoPInvokeCallback(typeof(PureScript_ExceptionTest_TestCallBack_Type))]
static void PureScript_ExceptionTest_TestCallBack (int thiz_h)
{
Exception __e = null;
try
{
var thizObj = ObjectStore.Get<global::PureScript.ExceptionTest>(thiz_h);
thizObj.TestCallBack();
}
catch(Exception e)
{
__e = e;
}
if(__e != null)
ScriptEngine.OnException(__e.ToString());
}
[MonoPInvokeCallback(typeof(PureScript_ExceptionTest__ctor_Type))]
static int PureScript_ExceptionTest__ctor ()
{
Exception __e = null;
try
{
var _value = new global::PureScript.ExceptionTest();
var _valueHandle = ObjectStore.Store(_value);
return _valueHandle;
}
catch(Exception e)
{
__e = e;
}
if(__e != null)
ScriptEngine.OnException(__e.ToString());
return default(int);
}
[MonoPInvokeCallback(typeof(PureScript_StartInfo_get_ReloadDllName_Type))]
static System.String PureScript_StartInfo_get_ReloadDllName ()
{
Exception __e = null;
try
{
var _value = PureScript.StartInfo.ReloadDllName;
return _value;
}
catch(Exception e)
{
__e = e;
}
if(__e != null)
ScriptEngine.OnException(__e.ToString());
return default(System.String);
}
[MonoPInvokeCallback(typeof(PureScript_StartInfo_get_ReloadClassName_Type))]
static System.String PureScript_StartInfo_get_ReloadClassName ()
{
Exception __e = null;
try
{
var _value = PureScript.StartInfo.ReloadClassName;
return _value;
}
catch(Exception e)
{
__e = e;
}
if(__e != null)
ScriptEngine.OnException(__e.ToString());
return default(System.String);
}
[MonoPInvokeCallback(typeof(PureScript_StartInfo_get_TestMethodName_Type))]
static System.String PureScript_StartInfo_get_TestMethodName ()
{
Exception __e = null;
try
{
var _value = PureScript.StartInfo.TestMethodName;
return _value;
}
catch(Exception e)
{
__e = e;
}
if(__e != null)
ScriptEngine.OnException(__e.ToString());
return default(System.String);
}
[MonoPInvokeCallback(typeof(PureScript_StartInfo__ctor_1_Type))]
static int PureScript_StartInfo__ctor_1 ()
{
Exception __e = null;
try
{
var _value = new global::PureScript.StartInfo();
var _valueHandle = ObjectStore.Store(_value);
return _valueHandle;
}
catch(Exception e)
{
__e = e;
}
if(__e != null)
ScriptEngine.OnException(__e.ToString());
return default(int);
}
}