1 /**
2 Boost Software License - Version 1.0 - August 17th, 2003
3 Permission is hereby granted,free of charge,to any person or organization
4 obtaining a copy of the software and accompanying documentation covered by
5 this license (the "Software") to use,reproduce,display,distribute,
6 execute,and transmit the Software,and to prepare derivative works of the
7 Software,and to permit third-parties to whom the Software is furnished to
8 do so,all subject to the following:
9 
10 The copyright notices in the Software and this entire statement,including
11 the above license grant,this restriction and the following disclaimer,
12 must be included in all copies of the Software,in whole or in part,and
13 all derivative works of the Software,unless such copies or derivative
14 works are solely in the form of machine-executable object code generated by
15 a source language processor.
16 
17 THE SOFTWARE IS PROVIDED "AS IS",WITHOUT WARRANTY OF ANY KIND,EXPRESS OR
18 IMPLIED,INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE,TITLE AND NON-INFRINGEMENT. IN NO EVENT
20 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
21 FOR ANY DAMAGES OR OTHER LIABILITY,WHETHER IN CONTRACT,TORT OR OTHERWISE,
22 ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 DEALINGS IN THE SOFTWARE.
24 */
25 module derelict.mono.types;
26 
27 private
28 {
29 	import core.stdc.config;
30 	import core.stdc.stdint;
31 	import core.stdc.stdlib;
32 }
33 
34 extern (C):
35 nothrow:
36 
37 // utils/mono-publib.h
38 alias mono_bool = int;
39 alias mono_byte = ubyte;
40 alias mono_unichar2 = wchar;
41 alias mono_unichar4 = dchar;
42 
43 alias MonoFunc = void function(void* data, void* user_data);
44 alias MonoHFunc = void function(void* key, void* value, void* user_data);
45 
46 enum MONO_ALLOCATOR_VTABLE_VERSION = 1;
47 struct MonoAllocatorVTable
48 {
49 	int version_;
50 	typeof(&.malloc) malloc;
51 	typeof(&.realloc) realloc;
52 	typeof(&.free) free;
53 	typeof(&.calloc) calloc;
54 }
55 
56 version(linux)
57 	enum MONO_ZERO_LEN_ARRAY = 0;
58 else
59 	enum MONO_ZERO_LEN_ARRAY = 1;
60 
61 // utils/mono-logger.h
62 
63 alias MonoPrintCallback = void function(const(char)* string_, mono_bool is_stdout);
64 alias MonoLogCallback = void function(const(char)* log_domain,
65 		const(char)* log_level, const(char)* message, mono_bool fatal, void* user_data);
66 
67 // utils/mono-error.h
68 enum : int
69 {
70 	/**
71 	The supplied strings were dup'd by means of calling mono_error_dup_strings.
72 	*/
73 	MONO_ERROR_FREE_STRINGS = 0x0001,
74 
75 	/**
76 	Something happened while processing the error and the resulting message is incomplete.
77 	*/
78 	MONO_ERROR_INCOMPLETE = 0x0002,
79 	/**
80 	This MonoError is heap allocated in a mempool
81         */
82 	MONO_ERROR_MEMPOOL_BOXED = 0x0004
83 }
84 
85 enum : int
86 {
87 	MONO_ERROR_NONE = 0,
88 	MONO_ERROR_MISSING_METHOD = 1,
89 	MONO_ERROR_MISSING_FIELD = 2,
90 	MONO_ERROR_TYPE_LOAD = 3,
91 	MONO_ERROR_FILE_NOT_FOUND = 4,
92 	MONO_ERROR_BAD_IMAGE = 5,
93 	MONO_ERROR_OUT_OF_MEMORY = 6,
94 	MONO_ERROR_ARGUMENT = 7,
95 	MONO_ERROR_ARGUMENT_NULL = 11,
96 	MONO_ERROR_NOT_VERIFIABLE = 8,
97 	MONO_ERROR_INVALID_PROGRAM = 12,
98 
99 	/**
100 	 * This is a generic error mechanism is you need to raise an arbitrary corlib exception.
101 	 * You must pass the exception name otherwise prepare_exception will fail with internal execution. 
102 	 */
103 	MONO_ERROR_GENERIC = 9,
104 	/** This one encapsulates a managed exception instance */
105 	MONO_ERROR_EXCEPTION_INSTANCE = 10,
106 
107 	/** Not a valid error code - indicates that the error was cleaned up and reused */
108 	MONO_ERROR_CLEANUP_CALLED_SENTINEL = 0xffff
109 }
110 
111 struct MonoError
112 {
113 	ushort error_code;
114 	ushort hidden_0; /**DON'T TOUCH */
115 	void*[12] hidden_1; /**DON'T TOUCH */
116 }
117 
118 alias _MonoError = MonoError;
119 
120 struct MonoErrorBoxed;
121 alias _MonoErrorBoxed = MonoErrorBoxed;
122 
123 // utils/mono-dl-fallback.h
124 enum : int
125 {
126 	MONO_DL_EAGER = 0,
127 	MONO_DL_LAZY = 1,
128 	MONO_DL_LOCAL = 2,
129 	MONO_DL_MASK = 3
130 }
131 
132 struct MonoDlFallbackHandler;
133 
134 alias MonoDlFallbackLoad = void* function(const(char)* name, int flags,
135 		char** err, void* user_data);
136 alias MonoDlFallbackSymbol = void* function(void* handle, const(char)* name,
137 		char** err, void* user_data);
138 alias MonoDlFallbackClose = void* function(void* handle, void* user_data);
139 
140 // utils/mono-counters.h
141 enum : int
142 {
143 	/** Counter type, bits 0-7. */
144 	MONO_COUNTER_INT, /** 32 bit int */
145 	MONO_COUNTER_UINT, /** 32 bit uint */
146 	MONO_COUNTER_WORD, /** pointer-sized int */
147 	MONO_COUNTER_LONG, /** 64 bit int */
148 	MONO_COUNTER_ULONG, /** 64 bit uint */
149 	MONO_COUNTER_DOUBLE,
150 	MONO_COUNTER_STRING, /** char* */
151 	MONO_COUNTER_TIME_INTERVAL, /** 64 bits signed int holding usecs. */
152 	MONO_COUNTER_TYPE_MASK = 0xf,
153 	MONO_COUNTER_CALLBACK = 128, /** ORed with the other values */
154 	MONO_COUNTER_SECTION_MASK = 0x00ffff00,
155 	/** Sections, bits 8-23 (16 bits) */
156 	MONO_COUNTER_JIT = 1 << 8,
157 	MONO_COUNTER_GC = 1 << 9,
158 	MONO_COUNTER_METADATA = 1 << 10,
159 	MONO_COUNTER_GENERICS = 1 << 11,
160 	MONO_COUNTER_SECURITY = 1 << 12,
161 	MONO_COUNTER_RUNTIME = 1 << 13,
162 	MONO_COUNTER_SYSTEM = 1 << 14,
163 	MONO_COUNTER_PERFCOUNTERS = 1 << 15,
164 	MONO_COUNTER_PROFILER = 1 << 16,
165 	MONO_COUNTER_LAST_SECTION,
166 
167 	/** Unit, bits 24-27 (4 bits) */
168 	MONO_COUNTER_UNIT_SHIFT = 24,
169 	MONO_COUNTER_UNIT_MASK = (0xFu << MONO_COUNTER_UNIT_SHIFT),
170 	MONO_COUNTER_RAW = 0 << 24, /** Raw value */
171 	MONO_COUNTER_BYTES = 1 << 24, /** Quantity of bytes. RSS, active heap, etc */
172 	MONO_COUNTER_TIME = 2 << 24, /** Time interval in 100ns units. Minor pause, JIT compilation*/
173 	MONO_COUNTER_COUNT = 3 << 24, /**  Number of things (threads, queued jobs) or Number of events triggered (Major collections, Compiled methods).*/
174 	MONO_COUNTER_PERCENTAGE = 4 << 24, /** [0-1] Fraction Percentage of something. Load average. */
175 
176 	/** Monotonicity, bits 28-31 (4 bits) */
177 	MONO_COUNTER_VARIANCE_SHIFT = 28,
178 	MONO_COUNTER_VARIANCE_MASK = (
179 			0xFu << MONO_COUNTER_VARIANCE_SHIFT),
180 	MONO_COUNTER_MONOTONIC = 1 << 28, /** This counter value always increase/decreases over time. Reported by --stat. */
181 	MONO_COUNTER_CONSTANT = 1 << 29, /** Fixed value. Used by configuration data. */
182 	MONO_COUNTER_VARIABLE = 1 << 30, /** This counter value can be anything on each sampling. Only interesting when sampling. */
183 
184 
185 
186 }
187 
188 struct MonoCounter;
189 alias _MonoCounter = MonoCounter;
190 alias MonoResourceType = int;
191 enum : MonoResourceType
192 {
193 	MONO_RESOURCE_JIT_CODE, /** bytes */
194 	MONO_RESOURCE_METADATA, /** bytes */
195 	MONO_RESOURCE_GC_HEAP, /** bytes */
196 	MONO_RESOURCE_COUNT /** non-ABI value */
197 }
198 
199 alias MonoCounterRegisterCallback = void function(MonoCounter*);
200 alias CountersEnumCallback = mono_bool function(MonoCounter* counter, void* user_data);
201 alias MonoResourceCallback = void function(int resource_type, uintptr_t value, int is_soft);
202 
203 // metadata/appdomain.h
204 alias MonoThreadStartCB = void function(intptr_t tid, void* stack_start, void* func);
205 alias MonoThreadAttachCB = void function(intptr_t tid, void* stack_start);
206 
207 struct _MonoAppDomain;
208 alias MonoAppDomain = _MonoAppDomain;
209 struct _MonoJitInfo;
210 alias MonoJitInfo = _MonoJitInfo;
211 
212 alias MonoDomainFunc = void function(MonoDomain* domain, void* user_data);
213 alias MonoCoreClrPlatformCB = int function(const(char)* image_name);
214 
215 // metadata/assembly.d
216 alias MonoAssemblyLoadFunc = void function(MonoAssembly* assembly, void* user_data);
217 alias MonoAssemblySearchFunc = _MonoAssembly* function(MonoAssemblyName* aname, void* user_data);
218 alias MonoAssemblyPreLoadFunc = _MonoAssembly* function(MonoAssemblyName* aname,
219 		char** assemblies_path, void* user_data);
220 struct MonoBundledAssembly
221 {
222 	const(char)* name;
223 	const(ubyte)* data;
224 	const uint size;
225 }
226 
227 // metadata/attrdefs.h
228 
229 /**
230  * 23.1.1  Values for AssemblyHashAlgorithm
231  */
232 enum
233 {
234 	MONO_ASSEMBLY_HASH_NONE = 0,
235 	MONO_ASSEMBLY_HASH_MD5 = 32771,
236 	MONO_ASSEMBLY_HASH_SHA1 = 32772
237 }
238 
239 /**
240  * 23.1.2 AssemblyRefs
241  */
242 enum
243 {
244 	MONO_ASSEMBLYREF_FULL_PUBLIC_KEY = 1,
245 	MONO_ASSEMBLYREF_RETARGETABLE = 256,
246 	MONO_ASSEMBLYREF_JIT_TRACKING = 32768,
247 	MONO_ASSEMBLYREF_NO_JIT_OPT = 16384
248 }
249 
250 /**
251  * 23.1.4 Flags for Event.EventAttributes
252  */
253 enum
254 {
255 	MONO_EVENT_SPECIALNAME = 512,
256 	MONO_EVENT_RTSPECIALNAME = 1024
257 }
258 
259 /**
260  * Field Attributes (23.1.5).
261  */
262 enum
263 {
264 	MONO_FIELD_ATTR_FIELD_ACCESS_MASK = 7,
265 	MONO_FIELD_ATTR_COMPILER_CONTROLLED = 0,
266 	MONO_FIELD_ATTR_PRIVATE = 1,
267 	MONO_FIELD_ATTR_FAM_AND_ASSEM = 2,
268 	MONO_FIELD_ATTR_ASSEMBLY = 3,
269 	MONO_FIELD_ATTR_FAMILY = 4,
270 	MONO_FIELD_ATTR_FAM_OR_ASSEM = 5,
271 	MONO_FIELD_ATTR_PUBLIC = 6,
272 
273 	MONO_FIELD_ATTR_STATIC = 16,
274 	MONO_FIELD_ATTR_INIT_ONLY = 32,
275 	MONO_FIELD_ATTR_LITERAL = 64,
276 	MONO_FIELD_ATTR_NOT_SERIALIZED = 128,
277 	MONO_FIELD_ATTR_SPECIAL_NAME = 512,
278 	MONO_FIELD_ATTR_PINVOKE_IMPL = 8192,
279 
280 	/** For runtime use only */
281 	MONO_FIELD_ATTR_RESERVED_MASK = 38144,
282 	MONO_FIELD_ATTR_RT_SPECIAL_NAME = 1024,
283 	MONO_FIELD_ATTR_HAS_MARSHAL = 4096,
284 	MONO_FIELD_ATTR_HAS_DEFAULT = 32768,
285 	MONO_FIELD_ATTR_HAS_RVA = 256
286 }
287 
288 /**
289  * 23.1.6 Flags for FileAttributes
290  */
291 enum
292 {
293 	MONO_FILE_HAS_METADATA = 0,
294 	MONO_FILE_HAS_NO_METADATA = 1
295 }
296 
297 /**
298  * 23.1.7 Flags for generic parameters
299  */
300 enum
301 {
302 	MONO_GEN_PARAM_VARIANCE_MASK = 3,
303 	MONO_GEN_PARAM_NON_VARIANT = 0,
304 	MONO_GEN_PARAM_VARIANT = 1,
305 	MONO_GEN_PARAM_COVARIANT = 2,
306 	MONO_GEN_PARAM_CONSTRAINT_MASK = 28,
307 	MONO_GEN_PARAM_CONSTRAINT_CLASS = 4,
308 	MONO_GEN_PARAM_CONSTRAINT_VTYPE = 8,
309 	MONO_GEN_PARAM_CONSTRAINT_DCTOR = 16
310 }
311 
312 /**
313  * 23.1.8 Flags for ImplMap [PInvokeAttributes]
314  */
315 enum
316 {
317 	MONO_PINVOKE_NO_MANGLE = 1,
318 	MONO_PINVOKE_CHAR_SET_MASK = 6,
319 	MONO_PINVOKE_CHAR_SET_NOT_SPEC = 0,
320 	MONO_PINVOKE_CHAR_SET_ANSI = 2,
321 	MONO_PINVOKE_CHAR_SET_UNICODE = 4,
322 	MONO_PINVOKE_CHAR_SET_AUTO = 6,
323 	MONO_PINVOKE_BEST_FIT_ENABLED = 16,
324 	MONO_PINVOKE_BEST_FIT_DISABLED = 32,
325 	MONO_PINVOKE_BEST_FIT_MASK = 48,
326 	MONO_PINVOKE_SUPPORTS_LAST_ERROR = 64,
327 	MONO_PINVOKE_CALL_CONV_MASK = 1792,
328 	MONO_PINVOKE_CALL_CONV_WINAPI = 256,
329 	MONO_PINVOKE_CALL_CONV_CDECL = 512,
330 	MONO_PINVOKE_CALL_CONV_STDCALL = 768,
331 	MONO_PINVOKE_CALL_CONV_THISCALL = 1024,
332 	MONO_PINVOKE_CALL_CONV_FASTCALL = 1280,
333 	MONO_PINVOKE_THROW_ON_UNMAPPABLE_ENABLED = 4096,
334 	MONO_PINVOKE_THROW_ON_UNMAPPABLE_DISABLED = 8192,
335 	MONO_PINVOKE_THROW_ON_UNMAPPABLE_MASK = 12288,
336 	MONO_PINVOKE_CALL_CONV_GENERIC = 16,
337 	MONO_PINVOKE_CALL_CONV_GENERICINST = 10
338 }
339 
340 /**
341  * 23.1.9 Flags for ManifestResource
342  */
343 enum
344 {
345 	MONO_MANIFEST_RESOURCE_VISIBILITY_MASK = 7,
346 	MONO_MANIFEST_RESOURCE_PUBLIC = 1,
347 	MONO_MANIFEST_RESOURCE_PRIVATE = 2
348 }
349 
350 /**
351  * Method Attributes (23.1.10)
352  */
353 enum
354 {
355 	MONO_METHOD_ATTR_ACCESS_MASK = 7,
356 	MONO_METHOD_ATTR_COMPILER_CONTROLLED = 0,
357 	MONO_METHOD_ATTR_PRIVATE = 1,
358 	MONO_METHOD_ATTR_FAM_AND_ASSEM = 2,
359 	MONO_METHOD_ATTR_ASSEM = 3,
360 	MONO_METHOD_ATTR_FAMILY = 4,
361 	MONO_METHOD_ATTR_FAM_OR_ASSEM = 5,
362 	MONO_METHOD_ATTR_PUBLIC = 6,
363 
364 	MONO_METHOD_ATTR_STATIC = 16,
365 	MONO_METHOD_ATTR_FINAL = 32,
366 	MONO_METHOD_ATTR_VIRTUAL = 64,
367 	MONO_METHOD_ATTR_HIDE_BY_SIG = 128,
368 
369 	MONO_METHOD_ATTR_VTABLE_LAYOUT_MASK = 256,
370 	MONO_METHOD_ATTR_REUSE_SLOT = 0,
371 	MONO_METHOD_ATTR_NEW_SLOT = 256,
372 	MONO_METHOD_ATTR_STRICT = 512,
373 	MONO_METHOD_ATTR_ABSTRACT = 1024,
374 
375 	MONO_METHOD_ATTR_SPECIAL_NAME = 2048,
376 
377 	MONO_METHOD_ATTR_PINVOKE_IMPL = 8192,
378 	MONO_METHOD_ATTR_UNMANAGED_EXPORT = 8,
379 
380 	/**
381      * For runtime use only
382      */
383 	MONO_METHOD_ATTR_RESERVED_MASK = 53248,
384 	MONO_METHOD_ATTR_RT_SPECIAL_NAME = 4096,
385 	MONO_METHOD_ATTR_HAS_SECURITY = 16384,
386 	MONO_METHOD_ATTR_REQUIRE_SEC_OBJECT = 32768
387 }
388 
389 /**
390  * Method Impl Attributes (23.1.11)
391  */
392 enum
393 {
394 	MONO_METHOD_IMPL_ATTR_CODE_TYPE_MASK = 3,
395 	MONO_METHOD_IMPL_ATTR_IL = 0,
396 	MONO_METHOD_IMPL_ATTR_NATIVE = 1,
397 	MONO_METHOD_IMPL_ATTR_OPTIL = 2,
398 	MONO_METHOD_IMPL_ATTR_RUNTIME = 3,
399 
400 	MONO_METHOD_IMPL_ATTR_MANAGED_MASK = 4,
401 	MONO_METHOD_IMPL_ATTR_UNMANAGED = 4,
402 	MONO_METHOD_IMPL_ATTR_MANAGED = 0,
403 
404 	MONO_METHOD_IMPL_ATTR_FORWARD_REF = 16,
405 	MONO_METHOD_IMPL_ATTR_PRESERVE_SIG = 128,
406 	MONO_METHOD_IMPL_ATTR_INTERNAL_CALL = 4096,
407 	MONO_METHOD_IMPL_ATTR_SYNCHRONIZED = 32,
408 	MONO_METHOD_IMPL_ATTR_NOINLINING = 8,
409 	MONO_METHOD_IMPL_ATTR_NOOPTIMIZATION = 64,
410 	MONO_METHOD_IMPL_ATTR_MAX_METHOD_IMPL_VAL = 65535
411 }
412 
413 /**
414  * Method Semantics ([MethodSemanticAttributes]) 23.1.12,
415  */
416 enum
417 {
418 	MONO_METHOD_SEMANTIC_SETTER = 1,
419 	MONO_METHOD_SEMANTIC_GETTER = 2,
420 	MONO_METHOD_SEMANTIC_OTHER = 4,
421 	MONO_METHOD_SEMANTIC_ADD_ON = 8,
422 	MONO_METHOD_SEMANTIC_REMOVE_ON = 16,
423 	MONO_METHOD_SEMANTIC_FIRE = 32
424 }
425 
426 /**
427  * Flags for Params (23.1.13)
428  */
429 enum
430 {
431 	MONO_PARAM_ATTR_IN = 1,
432 	MONO_PARAM_ATTR_OUT = 2,
433 	MONO_PARAM_ATTR_OPTIONAL = 16,
434 	MONO_PARAM_ATTR_RESERVED_MASK = 61440,
435 	MONO_PARAM_ATTR_HAS_DEFAULT = 4096,
436 	MONO_PARAM_ATTR_HAS_MARSHAL = 8192,
437 	MONO_PARAM_ATTR_UNUSED = 53216
438 }
439 
440 /**
441  * 23.1.14 PropertyAttributes
442  */
443 enum
444 {
445 	MONO_PROPERTY_ATTR_SPECIAL_NAME = 512,
446 	MONO_PROPERTY_ATTR_RESERVED_MASK = 62464,
447 	MONO_PROPERTY_ATTR_RT_SPECIAL_NAME = 1024,
448 	MONO_PROPERTY_ATTR_HAS_DEFAULT = 4096,
449 	MONO_PROPERTY_ATTR_UNUSED = 59903
450 }
451 
452 /**
453  * Type Attributes (23.1.15).
454  */
455 enum
456 {
457 	MONO_TYPE_ATTR_VISIBILITY_MASK = 7,
458 	MONO_TYPE_ATTR_NOT_PUBLIC = 0,
459 	MONO_TYPE_ATTR_PUBLIC = 1,
460 	MONO_TYPE_ATTR_NESTED_PUBLIC = 2,
461 	MONO_TYPE_ATTR_NESTED_PRIVATE = 3,
462 	MONO_TYPE_ATTR_NESTED_FAMILY = 4,
463 	MONO_TYPE_ATTR_NESTED_ASSEMBLY = 5,
464 	MONO_TYPE_ATTR_NESTED_FAM_AND_ASSEM = 6,
465 	MONO_TYPE_ATTR_NESTED_FAM_OR_ASSEM = 7,
466 
467 	MONO_TYPE_ATTR_LAYOUT_MASK = 24,
468 	MONO_TYPE_ATTR_AUTO_LAYOUT = 0,
469 	MONO_TYPE_ATTR_SEQUENTIAL_LAYOUT = 8,
470 	MONO_TYPE_ATTR_EXPLICIT_LAYOUT = 16,
471 
472 	MONO_TYPE_ATTR_CLASS_SEMANTIC_MASK = 32,
473 	MONO_TYPE_ATTR_CLASS = 0,
474 	MONO_TYPE_ATTR_INTERFACE = 32,
475 
476 	MONO_TYPE_ATTR_ABSTRACT = 128,
477 	MONO_TYPE_ATTR_SEALED = 256,
478 	MONO_TYPE_ATTR_SPECIAL_NAME = 1024,
479 
480 	MONO_TYPE_ATTR_IMPORT = 4096,
481 	MONO_TYPE_ATTR_SERIALIZABLE = 8192,
482 
483 	MONO_TYPE_ATTR_STRING_FORMAT_MASK = 196608,
484 	MONO_TYPE_ATTR_ANSI_CLASS = 0,
485 	MONO_TYPE_ATTR_UNICODE_CLASS = 65536,
486 	MONO_TYPE_ATTR_AUTO_CLASS = 131072,
487 	MONO_TYPE_ATTR_CUSTOM_CLASS = 196608,
488 	MONO_TYPE_ATTR_CUSTOM_MASK = 12582912,
489 
490 	MONO_TYPE_ATTR_BEFORE_FIELD_INIT = 1048576,
491 	MONO_TYPE_ATTR_FORWARDER = 2097152,
492 
493 	MONO_TYPE_ATTR_RESERVED_MASK = 264192,
494 	MONO_TYPE_ATTR_RT_SPECIAL_NAME = 2048,
495 	MONO_TYPE_ATTR_HAS_SECURITY = 262144
496 }
497 
498 // metadata/blob.h
499 /**
500  * Encoding for type signatures used in the Metadata
501  */
502 alias MonoTypeEnum = int;
503 enum : MonoTypeEnum
504 {
505 	MONO_TYPE_END = 0, /** End of List */
506 	MONO_TYPE_VOID = 1,
507 	MONO_TYPE_BOOLEAN = 2,
508 	MONO_TYPE_CHAR = 3,
509 	MONO_TYPE_I1 = 4,
510 	MONO_TYPE_U1 = 5,
511 	MONO_TYPE_I2 = 6,
512 	MONO_TYPE_U2 = 7,
513 	MONO_TYPE_I4 = 8,
514 	MONO_TYPE_U4 = 9,
515 	MONO_TYPE_I8 = 10,
516 	MONO_TYPE_U8 = 11,
517 	MONO_TYPE_R4 = 12,
518 	MONO_TYPE_R8 = 13,
519 	MONO_TYPE_STRING = 14,
520 	MONO_TYPE_PTR = 15, /** arg: <type> token */
521 	MONO_TYPE_BYREF = 16, /** arg: <type> token */
522 	MONO_TYPE_VALUETYPE = 17, /** arg: <type> token */
523 	MONO_TYPE_CLASS = 18, /** arg: <type> token */
524 	MONO_TYPE_VAR = 19, /** number */
525 	MONO_TYPE_ARRAY = 20, /** type, rank, boundsCount, bound1, loCount, lo1 */
526 	MONO_TYPE_GENERICINST = 21, /** <type> <type-arg-count> <type-1> \x{2026} <type-n> */
527 	MONO_TYPE_TYPEDBYREF = 22,
528 	MONO_TYPE_I = 24,
529 	MONO_TYPE_U = 25,
530 	MONO_TYPE_FNPTR = 27, /** arg: full method signature */
531 	MONO_TYPE_OBJECT = 28,
532 	MONO_TYPE_SZARRAY = 29, /** 0-based one-dim-array */
533 	MONO_TYPE_MVAR = 30, /** number */
534 	MONO_TYPE_CMOD_REQD = 31, /** arg: typedef or typeref token */
535 	MONO_TYPE_CMOD_OPT = 32, /** optional arg: typedef or typref token */
536 	MONO_TYPE_INTERNAL = 33, /** CLR internal type */
537 
538 	MONO_TYPE_MODIFIER = 64, /** Or with the following types */
539 	MONO_TYPE_SENTINEL = 65, /** Sentinel for varargs method signature */
540 	MONO_TYPE_PINNED = 69, /** Local var that points to pinned object */
541 
542 	MONO_TYPE_ENUM = 85 /** an enumeration */
543 }
544 
545 alias MonoMetaTableEnum = int;
546 enum : MonoMetaTableEnum
547 {
548 	MONO_TABLE_MODULE = 0,
549 	MONO_TABLE_TYPEREF = 1,
550 	MONO_TABLE_TYPEDEF = 2,
551 	MONO_TABLE_FIELD_POINTER = 3,
552 	MONO_TABLE_FIELD = 4,
553 	MONO_TABLE_METHOD_POINTER = 5,
554 	MONO_TABLE_METHOD = 6,
555 	MONO_TABLE_PARAM_POINTER = 7,
556 	MONO_TABLE_PARAM = 8,
557 	MONO_TABLE_INTERFACEIMPL = 9,
558 	MONO_TABLE_MEMBERREF = 10, /** 0xa */
559 	MONO_TABLE_CONSTANT = 11,
560 	MONO_TABLE_CUSTOMATTRIBUTE = 12,
561 	MONO_TABLE_FIELDMARSHAL = 13,
562 	MONO_TABLE_DECLSECURITY = 14,
563 	MONO_TABLE_CLASSLAYOUT = 15,
564 	MONO_TABLE_FIELDLAYOUT = 16, /** 0x10 */
565 	MONO_TABLE_STANDALONESIG = 17,
566 	MONO_TABLE_EVENTMAP = 18,
567 	MONO_TABLE_EVENT_POINTER = 19,
568 	MONO_TABLE_EVENT = 20,
569 	MONO_TABLE_PROPERTYMAP = 21,
570 	MONO_TABLE_PROPERTY_POINTER = 22,
571 	MONO_TABLE_PROPERTY = 23,
572 	MONO_TABLE_METHODSEMANTICS = 24,
573 	MONO_TABLE_METHODIMPL = 25,
574 	MONO_TABLE_MODULEREF = 26, /** 0x1a */
575 	MONO_TABLE_TYPESPEC = 27,
576 	MONO_TABLE_IMPLMAP = 28,
577 	MONO_TABLE_FIELDRVA = 29,
578 	MONO_TABLE_UNUSED6 = 30,
579 	MONO_TABLE_UNUSED7 = 31,
580 	MONO_TABLE_ASSEMBLY = 32, /** 0x20 */
581 	MONO_TABLE_ASSEMBLYPROCESSOR = 33,
582 	MONO_TABLE_ASSEMBLYOS = 34,
583 	MONO_TABLE_ASSEMBLYREF = 35,
584 	MONO_TABLE_ASSEMBLYREFPROCESSOR = 36,
585 	MONO_TABLE_ASSEMBLYREFOS = 37,
586 	MONO_TABLE_FILE = 38,
587 	MONO_TABLE_EXPORTEDTYPE = 39,
588 	MONO_TABLE_MANIFESTRESOURCE = 40,
589 	MONO_TABLE_NESTEDCLASS = 41,
590 	MONO_TABLE_GENERICPARAM = 42, /** 0x2a */
591 	MONO_TABLE_METHODSPEC = 43,
592 	MONO_TABLE_GENERICPARAMCONSTRAINT = 44,
593 	MONO_TABLE_UNUSED8 = 45,
594 	MONO_TABLE_UNUSED9 = 46,
595 	MONO_TABLE_UNUSED10 = 47,
596 	/** Portable PDB tables */
597 	MONO_TABLE_DOCUMENT = 48, /** 0x30 */
598 	MONO_TABLE_METHODBODY = 49,
599 	MONO_TABLE_LOCALSCOPE = 50,
600 	MONO_TABLE_LOCALVARIABLE = 51,
601 	MONO_TABLE_LOCALCONSTANT = 52,
602 	MONO_TABLE_IMPORTSCOPE = 53,
603 	MONO_TABLE_STATEMACHINEMETHOD = 54,
604 	MONO_TABLE_CUSTOMDEBUGINFORMATION = 55
605 }
606 
607 enum MONO_TABLE_LAST = MONO_TABLE_CUSTOMDEBUGINFORMATION;
608 enum MONO_TABLE_NUM = MONO_TABLE_LAST + 1;
609 
610 // metadata/class.h
611 struct MonoVTable;
612 struct _MonoClassField;
613 alias MonoClassField = _MonoClassField;
614 struct _MonoProperty;
615 alias MonoProperty = _MonoProperty;
616 struct _MonoEvent;
617 alias MonoEvent = _MonoEvent;
618 
619 // metadata/debug-helpers.h
620 alias MonoDisIndenter = char* function(MonoDisHelper* dh, MonoMethod* method, uint32_t ip_offset);
621 alias MonoDisTokener = char* function(MonoDisHelper* dh, MonoMethod* method, uint32_t token);
622 struct MonoDisHelper
623 {
624 	const char* newline;
625 	const char* label_format;
626 	const char* label_target;
627 	MonoDisIndenter indenter;
628 	MonoDisTokener tokener;
629 	void* user_data;
630 }
631 
632 struct MonoMethodDesc;
633 
634 // metadata/debug-mono-symfile.h
635 struct MonoSymbolFileOffsetTable
636 {
637 	uint32_t _total_file_size;
638 	uint32_t _data_section_offset;
639 	uint32_t _data_section_size;
640 	uint32_t _compile_unit_count;
641 	uint32_t _compile_unit_table_offset;
642 	uint32_t _compile_unit_table_size;
643 	uint32_t _source_count;
644 	uint32_t _source_table_offset;
645 	uint32_t _source_table_size;
646 	uint32_t _method_count;
647 	uint32_t _method_table_offset;
648 	uint32_t _method_table_size;
649 	uint32_t _type_count;
650 	uint32_t _anonymous_scope_count;
651 	uint32_t _anonymous_scope_table_offset;
652 	uint32_t _anonymous_scope_table_size;
653 	uint32_t _line_number_table_line_base;
654 	uint32_t _line_number_table_line_range;
655 	uint32_t _line_number_table_opcode_base;
656 	uint32_t _is_aspx_source;
657 }
658 
659 struct MonoSymbolFileSourceEntry
660 {
661 	uint32_t _index;
662 	uint32_t _data_offset;
663 }
664 
665 struct MonoSymbolFileMethodEntry
666 {
667 	uint32_t _token;
668 	uint32_t _data_offset;
669 	uint32_t _line_number_table;
670 }
671 
672 struct MonoSymbolFileMethodAddress
673 {
674 	uint32_t size;
675 	const(uint8_t)* start_address;
676 	const(uint8_t)* end_address;
677 	const(uint8_t)* method_start_address;
678 	const(uint8_t)* method_end_address;
679 	const(uint8_t)* wrapper_address;
680 	uint32_t has_this;
681 	uint32_t num_params;
682 	uint32_t variable_table_offset;
683 	uint32_t type_table_offset;
684 	uint32_t num_line_numbers;
685 	uint32_t line_number_offset;
686 	uint8_t[MONO_ZERO_LEN_ARRAY] data;
687 }
688 
689 struct _MonoDebugMethodInfo
690 {
691 	MonoMethod* method;
692 	MonoDebugHandle* handle;
693 	uint32_t index;
694 	uint32_t data_offset;
695 	uint32_t lnt_offset;
696 }
697 
698 struct MonoDebugCodeBlock
699 {
700 	int parent;
701 	int type;
702 	/** IL offsets */
703 	int start_offset, end_offset;
704 };
705 
706 struct MonoDebugLocalVar
707 {
708 	char* name;
709 	int index;
710 	/** Might be null for the main scope */
711 	MonoDebugCodeBlock* block;
712 }
713 
714 /**
715  * Information about local variables retrieved from a symbol file.
716  */
717 struct _MonoDebugLocalsInfo
718 {
719 	int num_locals;
720 	MonoDebugLocalVar* locals;
721 	int num_blocks;
722 	MonoDebugCodeBlock* code_blocks;
723 }
724 
725 /**
726 * Information about method await yield and resume offsets retrieved from a symbol file.
727 */
728 struct _MonoDebugMethodAsyncInfo
729 {
730 	uint32_t catch_handler_offset;
731 	int num_awaits;
732 	uint32_t* yield_offsets;
733 	uint32_t* resume_offsets;
734 	uint32_t* move_next_method_token;
735 }
736 
737 struct _MonoDebugLineNumberEntry
738 {
739 	uint32_t il_offset;
740 	uint32_t native_offset;
741 }
742 
743 /**
744  * Information about a source file retrieved from a symbol file.
745  */
746 struct MonoDebugSourceInfo
747 {
748 	char* source_file;
749 	/** 16 byte long */
750 	ubyte* guid, hash;
751 }
752 
753 struct MonoSymSeqPoint
754 {
755 	int il_offset;
756 	int line, column;
757 	int end_line, end_column;
758 }
759 
760 enum MONO_SYMBOL_FILE_MAJOR_VERSION = 50;
761 enum MONO_SYMBOL_FILE_MINOR_VERSION = 0;
762 enum ulong MONO_SYMBOL_FILE_MAGIC = 0x45e82623fd7fa614UL;
763 
764 // metadata/environment.h
765 
766 // metadata/exception.h
767 alias MonoUnhandledExceptionFunc = void function(MonoObject* exc, void* user_data);
768 
769 // metadata/image.h
770 struct _MonoImage;
771 alias MonoImage = _MonoImage;
772 struct _MonoAssembly;
773 alias MonoAssembly = _MonoAssembly;
774 struct _MonoAssemblyName;
775 alias MonoAssemblyName = _MonoAssemblyName;
776 struct _MonoTableInfo;
777 alias MonoTableInfo = _MonoTableInfo;
778 alias MonoImageOpenStatus = int;
779 enum : MonoImageOpenStatus
780 {
781 	MONO_IMAGE_OK = 0,
782 	MONO_IMAGE_ERROR_ERRNO = 1,
783 	MONO_IMAGE_MISSING_ASSEMBLYREF = 2,
784 	MONO_IMAGE_IMAGE_INVALID = 3
785 }
786 
787 // metadata/loader.h
788 alias MonoStackWalk = int function(MonoMethod* method, int native_offset,
789 		int il_offset, mono_bool managed, void* data);
790 alias MonoStackWalkAsyncSafe = int function(MonoMethod* method,
791 		MonoDomain* domain, void* base_address, int offset, void* data);
792 
793 // metadata/metadata.h
794 
795 struct MonoClass;
796 struct MonoDomain;
797 struct MonoMethod;
798 
799 alias MonoExceptionEnum = int;
800 enum : MonoExceptionEnum
801 {
802 	MONO_EXCEPTION_CLAUSE_NONE,
803 	MONO_EXCEPTION_CLAUSE_FILTER,
804 	MONO_EXCEPTION_CLAUSE_FINALLY,
805 	MONO_EXCEPTION_CLAUSE_FAULT = 4
806 }
807 
808 alias MonoCallConvention = int;
809 enum : MonoCallConvention
810 {
811 	MONO_CALL_DEFAULT,
812 	MONO_CALL_C,
813 	MONO_CALL_STDCALL,
814 	MONO_CALL_THISCALL,
815 	MONO_CALL_FASTCALL,
816 	MONO_CALL_VARARG
817 }
818 
819 alias MonoMarshalNative = int;
820 enum : MonoMarshalNative
821 {
822 	MONO_NATIVE_BOOLEAN = 0x02, /** 4 bytes, 0 is false, != 0 is true */
823 	MONO_NATIVE_I1 = 0x03,
824 	MONO_NATIVE_U1 = 0x04,
825 	MONO_NATIVE_I2 = 0x05,
826 	MONO_NATIVE_U2 = 0x06,
827 	MONO_NATIVE_I4 = 0x07,
828 	MONO_NATIVE_U4 = 0x08,
829 	MONO_NATIVE_I8 = 0x09,
830 	MONO_NATIVE_U8 = 0x0a,
831 	MONO_NATIVE_R4 = 0x0b,
832 	MONO_NATIVE_R8 = 0x0c,
833 	MONO_NATIVE_CURRENCY = 0x0f,
834 	MONO_NATIVE_BSTR = 0x13, /** prefixed length, Unicode */
835 	MONO_NATIVE_LPSTR = 0x14, /** ANSI, null terminated */
836 	MONO_NATIVE_LPWSTR = 0x15, /** UNICODE, null terminated */
837 	MONO_NATIVE_LPTSTR = 0x16, /** plattform dep., null terminated */
838 	MONO_NATIVE_BYVALTSTR = 0x17,
839 	MONO_NATIVE_IUNKNOWN = 0x19,
840 	MONO_NATIVE_IDISPATCH = 0x1a,
841 	MONO_NATIVE_STRUCT = 0x1b,
842 	MONO_NATIVE_INTERFACE = 0x1c,
843 	MONO_NATIVE_SAFEARRAY = 0x1d,
844 	MONO_NATIVE_BYVALARRAY = 0x1e,
845 	MONO_NATIVE_INT = 0x1f,
846 	MONO_NATIVE_UINT = 0x20,
847 	MONO_NATIVE_VBBYREFSTR = 0x22,
848 	MONO_NATIVE_ANSIBSTR = 0x23, /** prefixed length, ANSI */
849 	MONO_NATIVE_TBSTR = 0x24, /** prefixed length, plattform dep. */
850 	MONO_NATIVE_VARIANTBOOL = 0x25,
851 	MONO_NATIVE_FUNC = 0x26,
852 	MONO_NATIVE_ASANY = 0x28,
853 	MONO_NATIVE_LPARRAY = 0x2a,
854 	MONO_NATIVE_LPSTRUCT = 0x2b,
855 	MONO_NATIVE_CUSTOM = 0x2c,
856 	MONO_NATIVE_ERROR = 0x2d,
857 	// TODO: MONO_NATIVE_IINSPECTABLE = 0x2e
858 	// TODO: MONO_NATIVE_HSTRING = 0x2f
859 	MONO_NATIVE_UTF8STR = 0x30,
860 	MONO_NATIVE_MAX = 0x50 /** no info */
861 }
862 
863 alias MonoMarshalVariant = int;
864 enum : MonoMarshalVariant
865 {
866 	MONO_VARIANT_EMPTY = 0x00,
867 	MONO_VARIANT_NULL = 0x01,
868 	MONO_VARIANT_I2 = 0x02,
869 	MONO_VARIANT_I4 = 0x03,
870 	MONO_VARIANT_R4 = 0x04,
871 	MONO_VARIANT_R8 = 0x05,
872 	MONO_VARIANT_CY = 0x06,
873 	MONO_VARIANT_DATE = 0x07,
874 	MONO_VARIANT_BSTR = 0x08,
875 	MONO_VARIANT_DISPATCH = 0x09,
876 	MONO_VARIANT_ERROR = 0x0a,
877 	MONO_VARIANT_BOOL = 0x0b,
878 	MONO_VARIANT_VARIANT = 0x0c,
879 	MONO_VARIANT_UNKNOWN = 0x0d,
880 	MONO_VARIANT_DECIMAL = 0x0e,
881 	MONO_VARIANT_I1 = 0x10,
882 	MONO_VARIANT_UI1 = 0x11,
883 	MONO_VARIANT_UI2 = 0x12,
884 	MONO_VARIANT_UI4 = 0x13,
885 	MONO_VARIANT_I8 = 0x14,
886 	MONO_VARIANT_UI8 = 0x15,
887 	MONO_VARIANT_INT = 0x16,
888 	MONO_VARIANT_UINT = 0x17,
889 	MONO_VARIANT_VOID = 0x18,
890 	MONO_VARIANT_HRESULT = 0x19,
891 	MONO_VARIANT_PTR = 0x1a,
892 	MONO_VARIANT_SAFEARRAY = 0x1b,
893 	MONO_VARIANT_CARRAY = 0x1c,
894 	MONO_VARIANT_USERDEFINED = 0x1d,
895 	MONO_VARIANT_LPSTR = 0x1e,
896 	MONO_VARIANT_LPWSTR = 0x1f,
897 	MONO_VARIANT_RECORD = 0x24,
898 	MONO_VARIANT_FILETIME = 0x40,
899 	MONO_VARIANT_BLOB = 0x41,
900 	MONO_VARIANT_STREAM = 0x42,
901 	MONO_VARIANT_STORAGE = 0x43,
902 	MONO_VARIANT_STREAMED_OBJECT = 0x44,
903 	MONO_VARIANT_STORED_OBJECT = 0x45,
904 	MONO_VARIANT_BLOB_OBJECT = 0x46,
905 	MONO_VARIANT_CF = 0x47,
906 	MONO_VARIANT_CLSID = 0x48,
907 	MONO_VARIANT_VECTOR = 0x1000,
908 	MONO_VARIANT_ARRAY = 0x2000,
909 	MONO_VARIANT_BYREF = 0x4000
910 }
911 
912 alias MonoMarshalConv = int;
913 enum : MonoMarshalConv
914 {
915 	MONO_MARSHAL_CONV_NONE,
916 	MONO_MARSHAL_CONV_BOOL_VARIANTBOOL,
917 	MONO_MARSHAL_CONV_BOOL_I4,
918 	MONO_MARSHAL_CONV_STR_BSTR,
919 	MONO_MARSHAL_CONV_STR_LPSTR,
920 	MONO_MARSHAL_CONV_LPSTR_STR,
921 	MONO_MARSHAL_CONV_LPTSTR_STR,
922 	MONO_MARSHAL_CONV_STR_LPWSTR,
923 	MONO_MARSHAL_CONV_LPWSTR_STR,
924 	MONO_MARSHAL_CONV_STR_LPTSTR,
925 	MONO_MARSHAL_CONV_STR_ANSIBSTR,
926 	MONO_MARSHAL_CONV_STR_TBSTR,
927 	MONO_MARSHAL_CONV_STR_BYVALSTR,
928 	MONO_MARSHAL_CONV_STR_BYVALWSTR,
929 	MONO_MARSHAL_CONV_SB_LPSTR,
930 	MONO_MARSHAL_CONV_SB_LPTSTR,
931 	MONO_MARSHAL_CONV_SB_LPWSTR,
932 	MONO_MARSHAL_CONV_LPSTR_SB,
933 	MONO_MARSHAL_CONV_LPTSTR_SB,
934 	MONO_MARSHAL_CONV_LPWSTR_SB,
935 	MONO_MARSHAL_CONV_ARRAY_BYVALARRAY,
936 	MONO_MARSHAL_CONV_ARRAY_BYVALCHARARRAY,
937 	MONO_MARSHAL_CONV_ARRAY_SAVEARRAY,
938 	MONO_MARSHAL_CONV_ARRAY_LPARRAY,
939 	MONO_MARSHAL_FREE_LPARRAY,
940 	MONO_MARSHAL_CONV_OBJECT_INTERFACE,
941 	MONO_MARSHAL_CONV_OBJECT_IDISPATCH,
942 	MONO_MARSHAL_CONV_OBJECT_IUNKNOWN,
943 	MONO_MARSHAL_CONV_OBJECT_STRUCT,
944 	MONO_MARSHAL_CONV_DEL_FTN,
945 	MONO_MARSHAL_CONV_FTN_DEL,
946 	MONO_MARSHAL_FREE_ARRAY,
947 	MONO_MARSHAL_CONV_BSTR_STR,
948 	MONO_MARSHAL_CONV_SAFEHANDLE,
949 	MONO_MARSHAL_CONV_HANDLEREF,
950 	MONO_MARSHAL_CONV_STR_UTF8STR,
951 	MONO_MARSHAL_CONV_SB_UTF8STR,
952 	MONO_MARSHAL_CONV_UTF8STR_STR,
953 	MONO_MARSHAL_CONV_UTF8STR_SB,
954 	MONO_MARSHAL_CONV_FIXED_BUFFER
955 }
956 enum MONO_MARSHAL_CONV_INVALID = cast(MonoMarshalConv)(-1);
957 
958 struct MonoMarshalSpec
959 {
960 	MonoMarshalNative native;
961 	static union data_t
962 	{
963 		static struct array_data_t
964 		{
965 			MonoMarshalNative elem_type;
966 			int32_t num_elem; /** -1 if not set */
967 			int16_t param_num; /** -1 if not set */
968 			int16_t elem_mult; /** -1 if not set */
969 		}
970 
971 		static struct custom_data_t
972 		{
973 			char* custom_name;
974 			char* cookie;
975 			MonoImage* image;
976 		}
977 
978 		static struct safearray_data_t
979 		{
980 			MonoMarshalVariant elem_type;
981 			int32_t num_elem;
982 		}
983 
984 		array_data_t array_data;
985 		custom_data_t custom_data;
986 		safearray_data_t safearray_data;
987 	}
988 
989 	data_t data;
990 }
991 
992 struct MonoExceptionClause
993 {
994 	uint32_t flags;
995 	uint32_t try_offset;
996 	uint32_t try_len;
997 	uint32_t handler_offset;
998 	uint32_t handler_len;
999 	static union data_t
1000 	{
1001 		uint32_t filter_offset;
1002 		MonoClass* catch_class;
1003 	}
1004 
1005 	data_t data;
1006 }
1007 
1008 struct MonoType;
1009 alias _MonoType = MonoType;
1010 struct MonoGenericInst;
1011 alias _MonoGenericInst = MonoGenericInst;
1012 struct MonoGenericClass;
1013 alias _MonoGenericClass = MonoGenericClass;
1014 struct MonoGenericContext;
1015 alias _MonoGenericContext = MonoGenericContext;
1016 struct MonoGenericContainer;
1017 alias _MonoGenericContainer = MonoGenericContainer;
1018 struct MonoGenericParam;
1019 alias _MonoGenericParam = MonoGenericParam;
1020 
1021 alias _MonoArrayType = MonoArrayType;
1022 struct MonoMethodSignature;
1023 alias _MonoMethodSignature = MonoMethodSignature;
1024 struct invalid_name;
1025 alias MonoGenericMethod = invalid_name;
1026 struct MonoCustomMod
1027 {
1028 	uint required_1_token_31;
1029 }
1030 
1031 struct MonoArrayType
1032 {
1033 	MonoClass* eklass;
1034 	// Number of dimensions of the array
1035 	uint8_t rank;
1036 
1037 	// Arrays recording known upper and lower index bounds for each dimension
1038 	uint8_t numsizes;
1039 	uint8_t numlobounds;
1040 	int* sizes;
1041 	int* lobounds;
1042 }
1043 
1044 struct MonoMethodHeader;
1045 alias _MonoMethodHeader = MonoMethodHeader;
1046 
1047 alias MonoParseTypeMode = int;
1048 enum : MonoParseTypeMode
1049 {
1050 	MONO_PARSE_TYPE,
1051 	MONO_PARSE_MOD_TYPE,
1052 	MONO_PARSE_LOCAL,
1053 	MONO_PARSE_PARAM,
1054 	MONO_PARSE_RET,
1055 	MONO_PARSE_FIELD
1056 }
1057 
1058 // metadata/mono-config.h
1059 
1060 // metadata/mono-debug.h
1061 alias _MonoSymbolTable = MonoSymbolTable;
1062 struct MonoDebugDataTable;
1063 alias _MonoDebugDataTable = MonoDebugDataTable;
1064 struct MonoSymbolFile;
1065 alias _MonoSymbolFile = MonoSymbolFile;
1066 struct MonoPPDBFile;
1067 alias _MonoPPDBFile = MonoPPDBFile;
1068 alias _MonoDebugHandle = MonoDebugHandle;
1069 alias MonoDebugLineNumberEntry = _MonoDebugLineNumberEntry;
1070 alias _MonoDebugVarInfo = MonoDebugVarInfo;
1071 alias _MonoDebugMethodJitInfo = MonoDebugMethodJitInfo;
1072 struct MonoDebugMethodAddress;
1073 alias _MonoDebugMethodAddress = MonoDebugMethodAddress;
1074 alias _MonoDebugMethodAddressList = MonoDebugMethodAddressList;
1075 struct MonoDebugClassEntry;
1076 alias _MonoDebugClassEntry = MonoDebugClassEntry;
1077 struct MonoDebugMethodInfo;
1078 alias MonoDebugLocalsInfo = _MonoDebugLocalsInfo;
1079 alias MonoDebugMethodAsyncInfo = _MonoDebugMethodAsyncInfo;
1080 alias _MonoDebugSourceLocation = MonoDebugSourceLocation;
1081 alias _MonoDebugList = MonoDebugList;
1082 
1083 alias MonoDebugFormat = int;
1084 enum : MonoDebugFormat
1085 {
1086 	MONO_DEBUG_FORMAT_NONE = 0,
1087 	MONO_DEBUG_FORMAT_MONO = 1,
1088 	/** Deprecated, the mdb debugger is not longer supported. */
1089 	MONO_DEBUG_FORMAT_DEBUGGER = 2
1090 }
1091 
1092 struct MonoDebugList
1093 {
1094 	MonoDebugList* next;
1095 	const(void)* data;
1096 }
1097 
1098 struct MonoSymbolTable
1099 {
1100 	uint64_t magic;
1101 	uint32_t version_;
1102 	uint32_t total_size;
1103 
1104 	/**
1105 	 * Corlib and metadata info.
1106 	 */
1107 	MonoDebugHandle* corlib;
1108 	MonoDebugDataTable* global_data_table;
1109 	MonoDebugList* data_tables;
1110 
1111 	/**
1112 	 * The symbol files.
1113 	 */
1114 	MonoDebugList* symbol_files;
1115 }
1116 
1117 struct MonoDebugHandle
1118 {
1119 	uint32_t index;
1120 	char* image_file;
1121 	MonoImage* image;
1122 	MonoDebugDataTable* type_table;
1123 	MonoSymbolFile* symfile;
1124 	MonoPPDBFile* ppdb;
1125 }
1126 
1127 struct MonoDebugMethodJitInfo
1128 {
1129 	const(mono_byte)* code_start;
1130 	uint32_t code_size;
1131 	uint32_t prologue_end;
1132 	uint32_t epilogue_begin;
1133 	const(mono_byte)* wrapper_addr;
1134 	uint32_t num_line_numbers;
1135 	MonoDebugLineNumberEntry* line_numbers;
1136 	uint32_t has_var_info;
1137 	uint32_t num_params;
1138 	MonoDebugVarInfo* this_var;
1139 	MonoDebugVarInfo* params;
1140 	uint32_t num_locals;
1141 	MonoDebugVarInfo* locals;
1142 	MonoDebugVarInfo* gsharedvt_info_var;
1143 	MonoDebugVarInfo* gsharedvt_locals_var;
1144 }
1145 
1146 struct MonoDebugMethodAddressList
1147 {
1148 	uint32_t size;
1149 	uint32_t count;
1150 	mono_byte[MONO_ZERO_LEN_ARRAY] data;
1151 }
1152 
1153 struct MonoDebugSourceLocation
1154 {
1155 	char* source_file;
1156 	uint32_t row, column;
1157 	uint32_t il_offset;
1158 }
1159 
1160 struct MonoDebugVarInfo
1161 {
1162 	uint32_t index;
1163 	uint32_t offset;
1164 	uint32_t size;
1165 	uint32_t begin_scope;
1166 	uint32_t end_scope;
1167 	MonoType* type;
1168 }
1169 
1170 /**
1171  * These bits of the MonoDebugLocalInfo's "index" field are flags specifying
1172  * where the variable is actually stored.
1173  *
1174  * See relocate_variable() in debug-symfile.c for more info.
1175  */
1176 enum MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS = 0xf0000000;
1177 
1178 /** The variable is in register "index". */
1179 enum MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER = 0;
1180 
1181 /** The variable is at offset "offset" from register "index". */
1182 enum MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET = 0x10000000;
1183 
1184 /** The variable is in the two registers "offset" and "index". */
1185 enum MONO_DEBUG_VAR_ADDRESS_MODE_TWO_REGISTERS = 0x20000000;
1186 
1187 /** The variable is dead. */
1188 enum MONO_DEBUG_VAR_ADDRESS_MODE_DEAD = 0x30000000;
1189 
1190 /** Same as REGOFFSET, but do an indirection */
1191 enum MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET_INDIR = 0x40000000;
1192 
1193 /** gsharedvt local */
1194 enum MONO_DEBUG_VAR_ADDRESS_MODE_GSHAREDVT_LOCAL = 0x50000000;
1195 
1196 /** variable is a vt address */
1197 enum MONO_DEBUG_VAR_ADDRESS_MODE_VTADDR = 0x60000000;
1198 
1199 enum MONO_DEBUGGER_MAJOR_VERSION = 81;
1200 enum MONO_DEBUGGER_MINOR_VERSION = 6;
1201 enum MONO_DEBUGGER_MAGIC = 0x7aff65af4253d427UL;
1202 
1203 // metadata/mono-gc.h
1204 alias MonoGCReferences = int function(MonoObject* obj, MonoClass* klass,
1205 		uintptr_t size, uintptr_t num, MonoObject** refs, uintptr_t* offsets, void* data);
1206 
1207 alias MonoGCRootSource = int;
1208 enum : MonoGCRootSource
1209 {
1210 	// Roots external to Mono.  Embedders may only use this value.
1211 	MONO_ROOT_SOURCE_EXTERNAL = 0,
1212 	// Thread stack.  Must not be used to register roots.
1213 	MONO_ROOT_SOURCE_STACK = 1,
1214 	// Roots in the finalizer queue.  Must not be used to register roots.
1215 	MONO_ROOT_SOURCE_FINALIZER_QUEUE = 2,
1216 	// Managed static variables.
1217 	MONO_ROOT_SOURCE_STATIC = 3,
1218 	// Static variables with ThreadStaticAttribute.
1219 	MONO_ROOT_SOURCE_THREAD_STATIC = 4,
1220 	// Static variables with ContextStaticAttribute.
1221 	MONO_ROOT_SOURCE_CONTEXT_STATIC = 5,
1222 	// GCHandle structures.
1223 	MONO_ROOT_SOURCE_GC_HANDLE = 6,
1224 	// Roots in the just-in-time compiler.
1225 	MONO_ROOT_SOURCE_JIT = 7,
1226 	// Roots in the threading subsystem.
1227 	MONO_ROOT_SOURCE_THREADING = 8,
1228 	// Roots in application domains.
1229 	MONO_ROOT_SOURCE_DOMAIN = 9,
1230 	// Roots in reflection code.
1231 	MONO_ROOT_SOURCE_REFLECTION = 10,
1232 	// Roots from P/Invoke or other marshaling.
1233 	MONO_ROOT_SOURCE_MARSHAL = 11,
1234 	// Roots in the thread pool data structures.
1235 	MONO_ROOT_SOURCE_THREAD_POOL = 12,
1236 	// Roots in the debugger agent.
1237 	MONO_ROOT_SOURCE_DEBUGGER = 13,
1238 	// Handle structures, used for object passed to internal functions
1239 	MONO_ROOT_SOURCE_HANDLE = 14,
1240 }
1241 
1242 // metadata/object.h
1243 alias MonoBoolean = mono_byte;
1244 
1245 struct _MonoString;
1246 alias MonoString = _MonoString;
1247 struct _MonoArray;
1248 alias MonoArray = _MonoArray;
1249 struct _MonoReflectionMethod;
1250 alias MonoReflectionMethod = _MonoReflectionMethod;
1251 struct _MonoReflectionAssembly;
1252 alias MonoReflectionAssembly = _MonoReflectionAssembly;
1253 struct _MonoReflectionModule;
1254 alias MonoReflectionModule = _MonoReflectionModule;
1255 struct _MonoReflectionField;
1256 alias MonoReflectionField = _MonoReflectionField;
1257 struct _MonoReflectionProperty;
1258 alias MonoReflectionProperty = _MonoReflectionProperty;
1259 struct _MonoReflectionEvent;
1260 alias MonoReflectionEvent = _MonoReflectionEvent;
1261 struct _MonoReflectionType;
1262 alias MonoReflectionType = _MonoReflectionType;
1263 struct _MonoDelegate;
1264 alias MonoDelegate = _MonoDelegate;
1265 struct _MonoException;
1266 alias MonoException = _MonoException;
1267 struct _MonoThreadsSync;
1268 alias MonoThreadsSync = _MonoThreadsSync;
1269 struct _MonoThread;
1270 alias MonoThread = _MonoThread;
1271 struct _MonoDynamicAssembly;
1272 alias MonoDynamicAssembly = _MonoDynamicAssembly;
1273 struct _MonoDynamicImage;
1274 alias MonoDynamicImage = _MonoDynamicImage;
1275 struct _MonoReflectionMethodBody;
1276 alias MonoReflectionMethodBody = _MonoReflectionMethodBody;
1277 struct _MonoAppContext;
1278 alias MonoAppContext = _MonoAppContext;
1279 
1280 struct _MonoObject
1281 {
1282 	MonoVTable* vtable;
1283 	MonoThreadsSync* synchronisation;
1284 }
1285 
1286 alias MonoObject = _MonoObject;
1287 
1288 alias MonoInvokeFunc = _MonoObject* function(MonoMethod* method, void* obj,
1289 		void** params, MonoObject** exc, MonoError* error);
1290 alias MonoCompileFunc = void* function(MonoMethod* method);
1291 alias MonoMainThreadFunc = void function(void* user_data);
1292 alias mono_reference_queue_callback = void function(void* user_data);
1293 struct _MonoReferenceQueue;
1294 alias MonoReferenceQueue = _MonoReferenceQueue;
1295 
1296 // metadata/opcodes.h
1297 enum MONO_CUSTOM_PREFIX = 0xf0;
1298 
1299 alias MonoOpcodeEnum = int;
1300 enum : MonoOpcodeEnum
1301 {
1302 	MONO_CEE_NOP = 0,
1303 	MONO_CEE_BREAK = 1,
1304 	MONO_CEE_LDARG_0 = 2,
1305 	MONO_CEE_LDARG_1 = 3,
1306 	MONO_CEE_LDARG_2 = 4,
1307 	MONO_CEE_LDARG_3 = 5,
1308 	MONO_CEE_LDLOC_0 = 6,
1309 	MONO_CEE_LDLOC_1 = 7,
1310 	MONO_CEE_LDLOC_2 = 8,
1311 	MONO_CEE_LDLOC_3 = 9,
1312 	MONO_CEE_STLOC_0 = 10,
1313 	MONO_CEE_STLOC_1 = 11,
1314 	MONO_CEE_STLOC_2 = 12,
1315 	MONO_CEE_STLOC_3 = 13,
1316 	MONO_CEE_LDARG_S = 14,
1317 
1318 	/** __MONO_METADATA_OPCODES_H__ */
1319 	MONO_CEE_LDARGA_S = 15,
1320 	MONO_CEE_STARG_S = 16,
1321 	MONO_CEE_LDLOC_S = 17,
1322 	MONO_CEE_LDLOCA_S = 18,
1323 	MONO_CEE_STLOC_S = 19,
1324 	MONO_CEE_LDNULL = 20,
1325 	MONO_CEE_LDC_I4_M1 = 21,
1326 	MONO_CEE_LDC_I4_0 = 22,
1327 	MONO_CEE_LDC_I4_1 = 23,
1328 	MONO_CEE_LDC_I4_2 = 24,
1329 	MONO_CEE_LDC_I4_3 = 25,
1330 	MONO_CEE_LDC_I4_4 = 26,
1331 	MONO_CEE_LDC_I4_5 = 27,
1332 	MONO_CEE_LDC_I4_6 = 28,
1333 	MONO_CEE_LDC_I4_7 = 29,
1334 	MONO_CEE_LDC_I4_8 = 30,
1335 	MONO_CEE_LDC_I4_S = 31,
1336 	MONO_CEE_LDC_I4 = 32,
1337 	MONO_CEE_LDC_I8 = 33,
1338 	MONO_CEE_LDC_R4 = 34,
1339 	MONO_CEE_LDC_R8 = 35,
1340 	MONO_CEE_UNUSED99 = 36,
1341 	MONO_CEE_DUP = 37,
1342 	MONO_CEE_POP = 38,
1343 	MONO_CEE_JMP = 39,
1344 	MONO_CEE_CALL = 40,
1345 	MONO_CEE_CALLI = 41,
1346 	MONO_CEE_RET = 42,
1347 	MONO_CEE_BR_S = 43,
1348 	MONO_CEE_BRFALSE_S = 44,
1349 	MONO_CEE_BRTRUE_S = 45,
1350 	MONO_CEE_BEQ_S = 46,
1351 	MONO_CEE_BGE_S = 47,
1352 	MONO_CEE_BGT_S = 48,
1353 	MONO_CEE_BLE_S = 49,
1354 	MONO_CEE_BLT_S = 50,
1355 	MONO_CEE_BNE_UN_S = 51,
1356 	MONO_CEE_BGE_UN_S = 52,
1357 	MONO_CEE_BGT_UN_S = 53,
1358 	MONO_CEE_BLE_UN_S = 54,
1359 	MONO_CEE_BLT_UN_S = 55,
1360 	MONO_CEE_BR = 56,
1361 	MONO_CEE_BRFALSE = 57,
1362 	MONO_CEE_BRTRUE = 58,
1363 	MONO_CEE_BEQ = 59,
1364 	MONO_CEE_BGE = 60,
1365 	MONO_CEE_BGT = 61,
1366 	MONO_CEE_BLE = 62,
1367 	MONO_CEE_BLT = 63,
1368 	MONO_CEE_BNE_UN = 64,
1369 	MONO_CEE_BGE_UN = 65,
1370 	MONO_CEE_BGT_UN = 66,
1371 	MONO_CEE_BLE_UN = 67,
1372 	MONO_CEE_BLT_UN = 68,
1373 	MONO_CEE_SWITCH = 69,
1374 	MONO_CEE_LDIND_I1 = 70,
1375 	MONO_CEE_LDIND_U1 = 71,
1376 	MONO_CEE_LDIND_I2 = 72,
1377 	MONO_CEE_LDIND_U2 = 73,
1378 	MONO_CEE_LDIND_I4 = 74,
1379 	MONO_CEE_LDIND_U4 = 75,
1380 	MONO_CEE_LDIND_I8 = 76,
1381 	MONO_CEE_LDIND_I = 77,
1382 	MONO_CEE_LDIND_R4 = 78,
1383 	MONO_CEE_LDIND_R8 = 79,
1384 	MONO_CEE_LDIND_REF = 80,
1385 	MONO_CEE_STIND_REF = 81,
1386 	MONO_CEE_STIND_I1 = 82,
1387 	MONO_CEE_STIND_I2 = 83,
1388 	MONO_CEE_STIND_I4 = 84,
1389 	MONO_CEE_STIND_I8 = 85,
1390 	MONO_CEE_STIND_R4 = 86,
1391 	MONO_CEE_STIND_R8 = 87,
1392 	MONO_CEE_ADD = 88,
1393 	MONO_CEE_SUB = 89,
1394 	MONO_CEE_MUL = 90,
1395 	MONO_CEE_DIV = 91,
1396 	MONO_CEE_DIV_UN = 92,
1397 	MONO_CEE_REM = 93,
1398 	MONO_CEE_REM_UN = 94,
1399 	MONO_CEE_AND = 95,
1400 	MONO_CEE_OR = 96,
1401 	MONO_CEE_XOR = 97,
1402 	MONO_CEE_SHL = 98,
1403 	MONO_CEE_SHR = 99,
1404 	MONO_CEE_SHR_UN = 100,
1405 	MONO_CEE_NEG = 101,
1406 	MONO_CEE_NOT = 102,
1407 	MONO_CEE_CONV_I1 = 103,
1408 	MONO_CEE_CONV_I2 = 104,
1409 	MONO_CEE_CONV_I4 = 105,
1410 	MONO_CEE_CONV_I8 = 106,
1411 	MONO_CEE_CONV_R4 = 107,
1412 	MONO_CEE_CONV_R8 = 108,
1413 	MONO_CEE_CONV_U4 = 109,
1414 	MONO_CEE_CONV_U8 = 110,
1415 	MONO_CEE_CALLVIRT = 111,
1416 	MONO_CEE_CPOBJ = 112,
1417 	MONO_CEE_LDOBJ = 113,
1418 	MONO_CEE_LDSTR = 114,
1419 	MONO_CEE_NEWOBJ = 115,
1420 	MONO_CEE_CASTCLASS = 116,
1421 	MONO_CEE_ISINST = 117,
1422 	MONO_CEE_CONV_R_UN = 118,
1423 	MONO_CEE_UNUSED58 = 119,
1424 	MONO_CEE_UNUSED1 = 120,
1425 	MONO_CEE_UNBOX = 121,
1426 	MONO_CEE_THROW = 122,
1427 	MONO_CEE_LDFLD = 123,
1428 	MONO_CEE_LDFLDA = 124,
1429 	MONO_CEE_STFLD = 125,
1430 	MONO_CEE_LDSFLD = 126,
1431 	MONO_CEE_LDSFLDA = 127,
1432 	MONO_CEE_STSFLD = 128,
1433 	MONO_CEE_STOBJ = 129,
1434 	MONO_CEE_CONV_OVF_I1_UN = 130,
1435 	MONO_CEE_CONV_OVF_I2_UN = 131,
1436 	MONO_CEE_CONV_OVF_I4_UN = 132,
1437 	MONO_CEE_CONV_OVF_I8_UN = 133,
1438 	MONO_CEE_CONV_OVF_U1_UN = 134,
1439 	MONO_CEE_CONV_OVF_U2_UN = 135,
1440 	MONO_CEE_CONV_OVF_U4_UN = 136,
1441 	MONO_CEE_CONV_OVF_U8_UN = 137,
1442 	MONO_CEE_CONV_OVF_I_UN = 138,
1443 	MONO_CEE_CONV_OVF_U_UN = 139,
1444 	MONO_CEE_BOX = 140,
1445 	MONO_CEE_NEWARR = 141,
1446 	MONO_CEE_LDLEN = 142,
1447 	MONO_CEE_LDELEMA = 143,
1448 	MONO_CEE_LDELEM_I1 = 144,
1449 	MONO_CEE_LDELEM_U1 = 145,
1450 	MONO_CEE_LDELEM_I2 = 146,
1451 	MONO_CEE_LDELEM_U2 = 147,
1452 	MONO_CEE_LDELEM_I4 = 148,
1453 	MONO_CEE_LDELEM_U4 = 149,
1454 	MONO_CEE_LDELEM_I8 = 150,
1455 	MONO_CEE_LDELEM_I = 151,
1456 	MONO_CEE_LDELEM_R4 = 152,
1457 	MONO_CEE_LDELEM_R8 = 153,
1458 	MONO_CEE_LDELEM_REF = 154,
1459 	MONO_CEE_STELEM_I = 155,
1460 	MONO_CEE_STELEM_I1 = 156,
1461 	MONO_CEE_STELEM_I2 = 157,
1462 	MONO_CEE_STELEM_I4 = 158,
1463 	MONO_CEE_STELEM_I8 = 159,
1464 	MONO_CEE_STELEM_R4 = 160,
1465 	MONO_CEE_STELEM_R8 = 161,
1466 	MONO_CEE_STELEM_REF = 162,
1467 	MONO_CEE_LDELEM = 163,
1468 	MONO_CEE_STELEM = 164,
1469 	MONO_CEE_UNBOX_ANY = 165,
1470 	MONO_CEE_UNUSED5 = 166,
1471 	MONO_CEE_UNUSED6 = 167,
1472 	MONO_CEE_UNUSED7 = 168,
1473 	MONO_CEE_UNUSED8 = 169,
1474 	MONO_CEE_UNUSED9 = 170,
1475 	MONO_CEE_UNUSED10 = 171,
1476 	MONO_CEE_UNUSED11 = 172,
1477 	MONO_CEE_UNUSED12 = 173,
1478 	MONO_CEE_UNUSED13 = 174,
1479 	MONO_CEE_UNUSED14 = 175,
1480 	MONO_CEE_UNUSED15 = 176,
1481 	MONO_CEE_UNUSED16 = 177,
1482 	MONO_CEE_UNUSED17 = 178,
1483 	MONO_CEE_CONV_OVF_I1 = 179,
1484 	MONO_CEE_CONV_OVF_U1 = 180,
1485 	MONO_CEE_CONV_OVF_I2 = 181,
1486 	MONO_CEE_CONV_OVF_U2 = 182,
1487 	MONO_CEE_CONV_OVF_I4 = 183,
1488 	MONO_CEE_CONV_OVF_U4 = 184,
1489 	MONO_CEE_CONV_OVF_I8 = 185,
1490 	MONO_CEE_CONV_OVF_U8 = 186,
1491 	MONO_CEE_UNUSED50 = 187,
1492 	MONO_CEE_UNUSED18 = 188,
1493 	MONO_CEE_UNUSED19 = 189,
1494 	MONO_CEE_UNUSED20 = 190,
1495 	MONO_CEE_UNUSED21 = 191,
1496 	MONO_CEE_UNUSED22 = 192,
1497 	MONO_CEE_UNUSED23 = 193,
1498 	MONO_CEE_REFANYVAL = 194,
1499 	MONO_CEE_CKFINITE = 195,
1500 	MONO_CEE_UNUSED24 = 196,
1501 	MONO_CEE_UNUSED25 = 197,
1502 	MONO_CEE_MKREFANY = 198,
1503 	MONO_CEE_UNUSED59 = 199,
1504 	MONO_CEE_UNUSED60 = 200,
1505 	MONO_CEE_UNUSED61 = 201,
1506 	MONO_CEE_UNUSED62 = 202,
1507 	MONO_CEE_UNUSED63 = 203,
1508 	MONO_CEE_UNUSED64 = 204,
1509 	MONO_CEE_UNUSED65 = 205,
1510 	MONO_CEE_UNUSED66 = 206,
1511 	MONO_CEE_UNUSED67 = 207,
1512 	MONO_CEE_LDTOKEN = 208,
1513 	MONO_CEE_CONV_U2 = 209,
1514 	MONO_CEE_CONV_U1 = 210,
1515 	MONO_CEE_CONV_I = 211,
1516 	MONO_CEE_CONV_OVF_I = 212,
1517 	MONO_CEE_CONV_OVF_U = 213,
1518 	MONO_CEE_ADD_OVF = 214,
1519 	MONO_CEE_ADD_OVF_UN = 215,
1520 	MONO_CEE_MUL_OVF = 216,
1521 	MONO_CEE_MUL_OVF_UN = 217,
1522 	MONO_CEE_SUB_OVF = 218,
1523 	MONO_CEE_SUB_OVF_UN = 219,
1524 	MONO_CEE_ENDFINALLY = 220,
1525 	MONO_CEE_LEAVE = 221,
1526 	MONO_CEE_LEAVE_S = 222,
1527 	MONO_CEE_STIND_I = 223,
1528 	MONO_CEE_CONV_U = 224,
1529 	MONO_CEE_UNUSED26 = 225,
1530 	MONO_CEE_UNUSED27 = 226,
1531 	MONO_CEE_UNUSED28 = 227,
1532 	MONO_CEE_UNUSED29 = 228,
1533 	MONO_CEE_UNUSED30 = 229,
1534 	MONO_CEE_UNUSED31 = 230,
1535 	MONO_CEE_UNUSED32 = 231,
1536 	MONO_CEE_UNUSED33 = 232,
1537 	MONO_CEE_UNUSED34 = 233,
1538 	MONO_CEE_UNUSED35 = 234,
1539 	MONO_CEE_UNUSED36 = 235,
1540 	MONO_CEE_UNUSED37 = 236,
1541 	MONO_CEE_UNUSED38 = 237,
1542 	MONO_CEE_UNUSED39 = 238,
1543 	MONO_CEE_UNUSED40 = 239,
1544 	MONO_CEE_UNUSED41 = 240,
1545 	MONO_CEE_UNUSED42 = 241,
1546 	MONO_CEE_UNUSED43 = 242,
1547 	MONO_CEE_UNUSED44 = 243,
1548 	MONO_CEE_UNUSED45 = 244,
1549 	MONO_CEE_UNUSED46 = 245,
1550 	MONO_CEE_UNUSED47 = 246,
1551 	MONO_CEE_UNUSED48 = 247,
1552 	MONO_CEE_PREFIX7 = 248,
1553 	MONO_CEE_PREFIX6 = 249,
1554 	MONO_CEE_PREFIX5 = 250,
1555 	MONO_CEE_PREFIX4 = 251,
1556 	MONO_CEE_PREFIX3 = 252,
1557 	MONO_CEE_PREFIX2 = 253,
1558 	MONO_CEE_PREFIX1 = 254,
1559 	MONO_CEE_PREFIXREF = 255,
1560 	MONO_CEE_ARGLIST = 256,
1561 	MONO_CEE_CEQ = 257,
1562 	MONO_CEE_CGT = 258,
1563 	MONO_CEE_CGT_UN = 259,
1564 	MONO_CEE_CLT = 260,
1565 	MONO_CEE_CLT_UN = 261,
1566 	MONO_CEE_LDFTN = 262,
1567 	MONO_CEE_LDVIRTFTN = 263,
1568 	MONO_CEE_UNUSED56 = 264,
1569 	MONO_CEE_LDARG = 265,
1570 	MONO_CEE_LDARGA = 266,
1571 	MONO_CEE_STARG = 267,
1572 	MONO_CEE_LDLOC = 268,
1573 	MONO_CEE_LDLOCA = 269,
1574 	MONO_CEE_STLOC = 270,
1575 	MONO_CEE_LOCALLOC = 271,
1576 	MONO_CEE_UNUSED57 = 272,
1577 	MONO_CEE_ENDFILTER = 273,
1578 	MONO_CEE_UNALIGNED_ = 274,
1579 	MONO_CEE_VOLATILE_ = 275,
1580 	MONO_CEE_TAIL_ = 276,
1581 	MONO_CEE_INITOBJ = 277,
1582 	MONO_CEE_CONSTRAINED_ = 278,
1583 	MONO_CEE_CPBLK = 279,
1584 	MONO_CEE_INITBLK = 280,
1585 	MONO_CEE_NO_ = 281,
1586 	MONO_CEE_RETHROW = 282,
1587 	MONO_CEE_UNUSED = 283,
1588 	MONO_CEE_SIZEOF = 284,
1589 	MONO_CEE_REFANYTYPE = 285,
1590 	MONO_CEE_READONLY_ = 286,
1591 	MONO_CEE_UNUSED53 = 287,
1592 	MONO_CEE_UNUSED54 = 288,
1593 	MONO_CEE_UNUSED55 = 289,
1594 	MONO_CEE_UNUSED70 = 290,
1595 	MONO_CEE_ILLEGAL = 291,
1596 	MONO_CEE_ENDMAC = 292,
1597 	MONO_CEE_MONO_ICALL = 293,
1598 	MONO_CEE_MONO_OBJADDR = 294,
1599 	MONO_CEE_MONO_LDPTR = 295,
1600 	MONO_CEE_MONO_VTADDR = 296,
1601 	MONO_CEE_MONO_NEWOBJ = 297,
1602 	MONO_CEE_MONO_RETOBJ = 298,
1603 	MONO_CEE_MONO_LDNATIVEOBJ = 299,
1604 	MONO_CEE_MONO_CISINST = 300,
1605 	MONO_CEE_MONO_CCASTCLASS = 301,
1606 	MONO_CEE_MONO_SAVE_LMF = 302,
1607 	MONO_CEE_MONO_RESTORE_LMF = 303,
1608 	MONO_CEE_MONO_CLASSCONST = 304,
1609 	MONO_CEE_MONO_NOT_TAKEN = 305,
1610 	MONO_CEE_MONO_TLS = 306,
1611 	MONO_CEE_MONO_ICALL_ADDR = 307,
1612 	MONO_CEE_MONO_DYN_CALL = 308,
1613 	MONO_CEE_MONO_MEMORY_BARRIER = 309,
1614 	MONO_CEE_MONO_JIT_ATTACH = 310,
1615 	MONO_CEE_MONO_JIT_DETACH = 311,
1616 	MONO_CEE_MONO_JIT_ICALL_ADDR = 312,
1617 	MONO_CEE_MONO_LDPTR_INT_REQ_FLAG = 313,
1618 	MONO_CEE_MONO_LDPTR_CARD_TABLE = 314,
1619 	MONO_CEE_MONO_LDPTR_NURSERY_START = 315,
1620 	MONO_CEE_MONO_LDPTR_NURSERY_BITS = 316,
1621 	MONO_CEE_MONO_CALLI_EXTRA_ARG = 317,
1622 	MONO_CEE_MONO_LDDOMAIN = 318,
1623 	MONO_CEE_MONO_ATOMIC_STORE_I4 = 319,
1624 	MONO_CEE_MONO_GET_LAST_ERROR = 320,
1625 	MONO_CEE_LAST = 321
1626 }
1627 
1628 enum
1629 {
1630 	MONO_FLOW_NEXT = 0,
1631 	MONO_FLOW_BRANCH = 1,
1632 	MONO_FLOW_COND_BRANCH = 2,
1633 	MONO_FLOW_ERROR = 3,
1634 	MONO_FLOW_CALL = 4,
1635 	MONO_FLOW_RETURN = 5,
1636 	MONO_FLOW_META = 6
1637 }
1638 
1639 enum
1640 {
1641 	MonoInlineNone = 0,
1642 	MonoInlineType = 1,
1643 	MonoInlineField = 2,
1644 	MonoInlineMethod = 3,
1645 	MonoInlineTok = 4,
1646 	MonoInlineString = 5,
1647 	MonoInlineSig = 6,
1648 	MonoInlineVar = 7,
1649 	MonoShortInlineVar = 8,
1650 	MonoInlineBrTarget = 9,
1651 	MonoShortInlineBrTarget = 10,
1652 	MonoInlineSwitch = 11,
1653 	MonoInlineR = 12,
1654 	MonoShortInlineR = 13,
1655 	MonoInlineI = 14,
1656 	MonoShortInlineI = 15,
1657 	MonoInlineI8 = 16
1658 }
1659 
1660 struct MonoOpcode
1661 {
1662 	ubyte argument;
1663 	ubyte flow_type;
1664 	ushort opval;
1665 }
1666 
1667 // metadata/profiler.h
1668 
1669 enum MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH = 128;
1670 
1671 alias MonoProfileFlags = int;
1672 enum : MonoProfileFlags
1673 {
1674 	MONO_PROFILE_NONE = 0,
1675 	MONO_PROFILE_APPDOMAIN_EVENTS = 1,
1676 	MONO_PROFILE_ASSEMBLY_EVENTS = 2,
1677 	MONO_PROFILE_MODULE_EVENTS = 4,
1678 	MONO_PROFILE_CLASS_EVENTS = 8,
1679 	MONO_PROFILE_JIT_COMPILATION = 16,
1680 	MONO_PROFILE_INLINING = 32,
1681 	MONO_PROFILE_EXCEPTIONS = 64,
1682 	MONO_PROFILE_ALLOCATIONS = 128,
1683 	MONO_PROFILE_GC = 256,
1684 	MONO_PROFILE_THREADS = 512,
1685 	MONO_PROFILE_REMOTING = 1024,
1686 	MONO_PROFILE_TRANSITIONS = 2048,
1687 	MONO_PROFILE_ENTER_LEAVE = 4096,
1688 	MONO_PROFILE_COVERAGE = 8192,
1689 	MONO_PROFILE_INS_COVERAGE = 16384,
1690 	MONO_PROFILE_STATISTICAL = 32768,
1691 	MONO_PROFILE_METHOD_EVENTS = 65536,
1692 	MONO_PROFILE_MONITOR_EVENTS = 131072,
1693 	MONO_PROFILE_IOMAP_EVENTS = 262144, /** this should likely be removed, too */
1694 	MONO_PROFILE_GC_MOVES = 524288,
1695 	MONO_PROFILE_GC_ROOTS = 1048576,
1696 	MONO_PROFILE_CONTEXT_EVENTS = 2097152,
1697 	MONO_PROFILE_GC_FINALIZATION = 4194304
1698 }
1699 
1700 alias MonoProfileResult = int;
1701 enum : MonoProfileResult
1702 {
1703 	MONO_PROFILE_OK = 0,
1704 	MONO_PROFILE_FAILED = 1
1705 }
1706 
1707 alias MonoGCEvent = int;
1708 enum : MonoGCEvent
1709 {
1710 	MONO_GC_EVENT_START = 0,
1711 	MONO_GC_EVENT_MARK_START = 1,
1712 	MONO_GC_EVENT_MARK_END = 2,
1713 	MONO_GC_EVENT_RECLAIM_START = 3,
1714 	MONO_GC_EVENT_RECLAIM_END = 4,
1715 	MONO_GC_EVENT_END = 5,
1716 	/**
1717     	 * This is the actual arrival order of the following events:
1718     	 *
1719     	 * MONO_GC_EVENT_PRE_STOP_WORLD
1720     	 * MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED
1721     	 * MONO_GC_EVENT_POST_STOP_WORLD
1722     	 * MONO_GC_EVENT_PRE_START_WORLD
1723     	 * MONO_GC_EVENT_POST_START_WORLD_UNLOCKED
1724     	 * MONO_GC_EVENT_POST_START_WORLD
1725     	 *
1726     	 * The LOCKED and UNLOCKED events guarantee that, by the time they arrive,
1727     	 * the GC and suspend locks will both have been acquired and released,
1728     	 * respectively.
1729     	 */
1730 	MONO_GC_EVENT_PRE_STOP_WORLD = 6,
1731 	MONO_GC_EVENT_POST_STOP_WORLD = 7,
1732 	MONO_GC_EVENT_PRE_START_WORLD = 8,
1733 	MONO_GC_EVENT_POST_START_WORLD = 9,
1734 	MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED = 10,
1735 	MONO_GC_EVENT_POST_START_WORLD_UNLOCKED = 11
1736 }
1737 
1738 /** coverage info */
1739 struct MonoProfileCoverageEntry
1740 {
1741 	MonoMethod* method;
1742 	int iloffset;
1743 	int counter;
1744 	const(char)* filename;
1745 	int line;
1746 	int col;
1747 }
1748 
1749 /** executable code buffer info */
1750 alias MonoProfilerCodeBufferType = int;
1751 enum : MonoProfilerCodeBufferType
1752 {
1753 	MONO_PROFILER_CODE_BUFFER_UNKNOWN = 0,
1754 	MONO_PROFILER_CODE_BUFFER_METHOD = 1,
1755 	MONO_PROFILER_CODE_BUFFER_METHOD_TRAMPOLINE = 2,
1756 	MONO_PROFILER_CODE_BUFFER_UNBOX_TRAMPOLINE = 3,
1757 	MONO_PROFILER_CODE_BUFFER_IMT_TRAMPOLINE = 4,
1758 	MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE = 5,
1759 	MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE = 6,
1760 	MONO_PROFILER_CODE_BUFFER_HELPER = 7,
1761 	MONO_PROFILER_CODE_BUFFER_MONITOR = 8,
1762 	MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE = 9,
1763 	MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING = 10,
1764 	MONO_PROFILER_CODE_BUFFER_LAST = 11
1765 }
1766 
1767 struct _MonoProfiler;
1768 alias MonoProfiler = _MonoProfiler;
1769 
1770 alias MonoProfilerMonitorEvent = int;
1771 enum : MonoProfilerMonitorEvent
1772 {
1773 	MONO_PROFILER_MONITOR_CONTENTION = 1,
1774 	MONO_PROFILER_MONITOR_DONE = 2,
1775 	MONO_PROFILER_MONITOR_FAIL = 3
1776 }
1777 
1778 alias MonoProfilerCallChainStrategy = int;
1779 enum : MonoProfilerCallChainStrategy
1780 {
1781 	MONO_PROFILER_CALL_CHAIN_NONE = 0,
1782 	MONO_PROFILER_CALL_CHAIN_NATIVE = 1,
1783 	MONO_PROFILER_CALL_CHAIN_GLIBC = 2,
1784 	MONO_PROFILER_CALL_CHAIN_MANAGED = 3,
1785 	MONO_PROFILER_CALL_CHAIN_INVALID = 4
1786 }
1787 
1788 alias MonoProfileGCHandleEvent = int;
1789 enum : MonoProfileGCHandleEvent
1790 {
1791 	MONO_PROFILER_GC_HANDLE_CREATED = 0,
1792 	MONO_PROFILER_GC_HANDLE_DESTROYED = 1
1793 }
1794 
1795 alias MonoProfileGCRootType = int;
1796 enum : MonoProfileGCRootType
1797 {
1798 	MONO_PROFILE_GC_ROOT_PINNING = 256,
1799 	MONO_PROFILE_GC_ROOT_WEAKREF = 512,
1800 	MONO_PROFILE_GC_ROOT_INTERIOR = 1024,
1801 	/** the above are flags, the type is in the low 2 bytes */
1802 	MONO_PROFILE_GC_ROOT_STACK = 0,
1803 	MONO_PROFILE_GC_ROOT_FINALIZER = 1,
1804 	MONO_PROFILE_GC_ROOT_HANDLE = 2,
1805 	MONO_PROFILE_GC_ROOT_OTHER = 3,
1806 	MONO_PROFILE_GC_ROOT_MISC = 4, /** could be stack, handle, etc. */
1807 	MONO_PROFILE_GC_ROOT_TYPEMASK = 255
1808 }
1809 
1810 /**
1811  * Functions that the runtime will call on the profiler.
1812  */
1813 
1814 alias MonoProfileFunc = void function(MonoProfiler* prof);
1815 
1816 alias MonoProfileAppDomainFunc = void function(MonoProfiler* prof, MonoDomain* domain);
1817 alias MonoProfileContextFunc = void function(MonoProfiler* prof, MonoAppContext* context);
1818 alias MonoProfileMethodFunc = void function(MonoProfiler* prof, MonoMethod* method);
1819 alias MonoProfileClassFunc = void function(MonoProfiler* prof, MonoClass* klass);
1820 alias MonoProfileModuleFunc = void function(MonoProfiler* prof, MonoImage* module_);
1821 alias MonoProfileAssemblyFunc = void function(MonoProfiler* prof, MonoAssembly* assembly);
1822 alias MonoProfileMonitorFunc = void function(MonoProfiler* prof,
1823 		MonoObject* obj, MonoProfilerMonitorEvent event);
1824 
1825 alias MonoProfileExceptionFunc = void function(MonoProfiler* prof, MonoObject* object);
1826 alias MonoProfileExceptionClauseFunc = void function(MonoProfiler* prof,
1827 		MonoMethod* method, int clause_type, int clause_num);
1828 
1829 alias MonoProfileAppDomainResult = void function(MonoProfiler* prof, MonoDomain* domain, int result);
1830 alias MonoProfileAppDomainFriendlyNameFunc = void function(MonoProfiler* prof,
1831 		MonoDomain* domain, const(char)* name);
1832 alias MonoProfileMethodResult = void function(MonoProfiler* prof, MonoMethod* method, int result);
1833 alias MonoProfileJitResult = void function(MonoProfiler* prof,
1834 		MonoMethod* method, MonoJitInfo* jinfo, int result);
1835 alias MonoProfileClassResult = void function(MonoProfiler* prof, MonoClass* klass, int result);
1836 alias MonoProfileModuleResult = void function(MonoProfiler* prof, MonoImage* module_, int result);
1837 alias MonoProfileAssemblyResult = void function(MonoProfiler* prof,
1838 		MonoAssembly* assembly, int result);
1839 
1840 alias MonoProfileMethodInline = void function(MonoProfiler* prof,
1841 		MonoMethod* parent, MonoMethod* child, int* ok);
1842 
1843 alias MonoProfileThreadFunc = void function(MonoProfiler* prof, uintptr_t tid);
1844 alias MonoProfileThreadNameFunc = void function(MonoProfiler* prof, uintptr_t tid,
1845 		const(char)* name);
1846 alias MonoProfileAllocFunc = void function(MonoProfiler* prof, MonoObject* obj, MonoClass* klass);
1847 alias MonoProfileStatFunc = void function(MonoProfiler* prof, mono_byte* ip, void* context);
1848 alias MonoProfileStatCallChainFunc = void function(MonoProfiler* prof,
1849 		int call_chain_depth, mono_byte** ip, void* context);
1850 alias MonoProfileGCFunc = void function(MonoProfiler* prof, MonoGCEvent event, int generation);
1851 alias MonoProfileGCMoveFunc = void function(MonoProfiler* prof, void** objects, int num);
1852 alias MonoProfileGCResizeFunc = void function(MonoProfiler* prof, long new_size);
1853 alias MonoProfileGCHandleFunc = void function(MonoProfiler* prof, int op,
1854 		int type, uintptr_t handle, MonoObject* obj);
1855 alias MonoProfileGCRootFunc = void function(MonoProfiler* prof, int num_roots,
1856 		void** objects, int* root_types, uintptr_t* extra_info);
1857 
1858 alias MonoProfileGCFinalizeFunc = void function(MonoProfiler* prof);
1859 alias MonoProfileGCFinalizeObjectFunc = void function(MonoProfiler* prof, MonoObject* obj);
1860 
1861 alias MonoProfileIomapFunc = void function(MonoProfiler* prof,
1862 		const(char)* report, const(char)* pathname, const(char)* new_pathname);
1863 
1864 alias MonoProfileCoverageFilterFunc = int function(MonoProfiler* prof, MonoMethod* method);
1865 
1866 alias MonoProfileCoverageFunc = void function(MonoProfiler* prof,
1867 		const(MonoProfileCoverageEntry)* entry);
1868 
1869 alias MonoProfilerCodeChunkNew = void function(MonoProfiler* prof, void* chunk, int size);
1870 alias MonoProfilerCodeChunkDestroy = void function(MonoProfiler* prof, void* chunk);
1871 alias MonoProfilerCodeBufferNew = void function(MonoProfiler* prof,
1872 		void* buffer, int size, MonoProfilerCodeBufferType type, void* data);
1873 
1874 alias MonoProfileSamplingMode = int;
1875 enum : MonoProfileSamplingMode
1876 {
1877 	/** Elapsed time is tracked by user+kernel time of the process - this is the default*/
1878 	MONO_PROFILER_STAT_MODE_PROCESS = 0,
1879 	/** Elapsed time is tracked by wallclock time */
1880 	MONO_PROFILER_STAT_MODE_REAL = 1
1881 }
1882 
1883 // metadata/reflection.h
1884 
1885 struct MonoTypeNameParse;
1886 
1887 struct MonoCustomAttrEntry
1888 {
1889 	MonoMethod* ctor;
1890 	uint data_size;
1891 	const(mono_byte)* data;
1892 }
1893 
1894 struct MonoCustomAttrInfo
1895 {
1896 	int num_attrs;
1897 	int cached;
1898 	MonoImage* image;
1899 	MonoCustomAttrEntry[MONO_ZERO_LEN_ARRAY] attrs;
1900 }
1901 
1902 enum MONO_SIZEOF_CUSTOM_ATTR_INFO = MonoCustomAttrInfo.attrs.offsetof;
1903 
1904 /**
1905  * Information which isn't in the MonoMethod structure is stored here for
1906  * dynamic methods.
1907  */
1908 struct MonoReflectionMethodAux
1909 {
1910 	char** param_names;
1911 	MonoMarshalSpec** param_marshall;
1912 	MonoCustomAttrInfo** param_cattr;
1913 	ubyte** param_defaults;
1914 	uint* param_default_types;
1915 	char* dllentry;
1916 	char* dll;
1917 }
1918 
1919 alias MonoResolveTokenError = int;
1920 enum : MonoResolveTokenError
1921 {
1922 	ResolveTokenError_OutOfRange = 0,
1923 	ResolveTokenError_BadTable = 1,
1924 	ResolveTokenError_Other = 2
1925 }
1926 
1927 enum MONO_DECLSEC_ACTION_MIN = 0x1;
1928 enum MONO_DECLSEC_ACTION_MAX = 0x12;
1929 
1930 enum
1931 {
1932 	MONO_DECLSEC_FLAG_REQUEST = 1,
1933 	MONO_DECLSEC_FLAG_DEMAND = 2,
1934 	MONO_DECLSEC_FLAG_ASSERT = 4,
1935 	MONO_DECLSEC_FLAG_DENY = 8,
1936 	MONO_DECLSEC_FLAG_PERMITONLY = 16,
1937 	MONO_DECLSEC_FLAG_LINKDEMAND = 32,
1938 	MONO_DECLSEC_FLAG_INHERITANCEDEMAND = 64,
1939 	MONO_DECLSEC_FLAG_REQUEST_MINIMUM = 128,
1940 	MONO_DECLSEC_FLAG_REQUEST_OPTIONAL = 256,
1941 	MONO_DECLSEC_FLAG_REQUEST_REFUSE = 512,
1942 	MONO_DECLSEC_FLAG_PREJIT_GRANT = 1024,
1943 	MONO_DECLSEC_FLAG_PREJIT_DENY = 2048,
1944 	MONO_DECLSEC_FLAG_NONCAS_DEMAND = 4096,
1945 	MONO_DECLSEC_FLAG_NONCAS_LINKDEMAND = 8192,
1946 	MONO_DECLSEC_FLAG_NONCAS_INHERITANCEDEMAND = 16384,
1947 	MONO_DECLSEC_FLAG_LINKDEMAND_CHOICE = 32768,
1948 	MONO_DECLSEC_FLAG_INHERITANCEDEMAND_CHOICE = 65536,
1949 	MONO_DECLSEC_FLAG_DEMAND_CHOICE = 131072
1950 }
1951 
1952 /** this structure MUST be kept in synch with RuntimeDeclSecurityEntry
1953  * located in /mcs/class/corlib/System.Security/SecurityFrame.cs */
1954 struct MonoDeclSecurityEntry
1955 {
1956 	char* blob; /** pointer to metadata blob */
1957 	uint size; /** size of the metadata blob */
1958 	uint index;
1959 }
1960 
1961 struct MonoDeclSecurityActions
1962 {
1963 	MonoDeclSecurityEntry demand;
1964 	MonoDeclSecurityEntry noncasdemand;
1965 	MonoDeclSecurityEntry demandchoice;
1966 }
1967 
1968 // metadata/row-indexes.h
1969 
1970 /**
1971  * The last entry in the enum is used to give the number
1972  * of columns in the row.
1973  */
1974 
1975 enum
1976 {
1977 	MONO_ASSEMBLY_HASH_ALG = 0,
1978 	MONO_ASSEMBLY_MAJOR_VERSION = 1,
1979 	MONO_ASSEMBLY_MINOR_VERSION = 2,
1980 	MONO_ASSEMBLY_BUILD_NUMBER = 3,
1981 	MONO_ASSEMBLY_REV_NUMBER = 4,
1982 	MONO_ASSEMBLY_FLAGS = 5,
1983 	MONO_ASSEMBLY_PUBLIC_KEY = 6,
1984 	MONO_ASSEMBLY_NAME = 7,
1985 	MONO_ASSEMBLY_CULTURE = 8,
1986 	MONO_ASSEMBLY_SIZE = 9
1987 }
1988 
1989 enum
1990 {
1991 	MONO_ASSEMBLYOS_PLATFORM = 0,
1992 	MONO_ASSEMBLYOS_MAJOR_VERSION = 1,
1993 	MONO_ASSEMBLYOS_MINOR_VERSION = 2,
1994 	MONO_ASSEMBLYOS_SIZE = 3
1995 }
1996 
1997 enum
1998 {
1999 	MONO_ASSEMBLY_PROCESSOR = 0,
2000 	MONO_ASSEMBLY_PROCESSOR_SIZE = 1
2001 }
2002 
2003 enum
2004 {
2005 	MONO_ASSEMBLYREF_MAJOR_VERSION = 0,
2006 	MONO_ASSEMBLYREF_MINOR_VERSION = 1,
2007 	MONO_ASSEMBLYREF_BUILD_NUMBER = 2,
2008 	MONO_ASSEMBLYREF_REV_NUMBER = 3,
2009 	MONO_ASSEMBLYREF_FLAGS = 4,
2010 	MONO_ASSEMBLYREF_PUBLIC_KEY = 5,
2011 	MONO_ASSEMBLYREF_NAME = 6,
2012 	MONO_ASSEMBLYREF_CULTURE = 7,
2013 	MONO_ASSEMBLYREF_HASH_VALUE = 8,
2014 	MONO_ASSEMBLYREF_SIZE = 9
2015 }
2016 
2017 enum
2018 {
2019 	MONO_ASSEMBLYREFOS_PLATFORM = 0,
2020 	MONO_ASSEMBLYREFOS_MAJOR_VERSION = 1,
2021 	MONO_ASSEMBLYREFOS_MINOR_VERSION = 2,
2022 	MONO_ASSEMBLYREFOS_ASSEMBLYREF = 3,
2023 	MONO_ASSEMBLYREFOS_SIZE = 4
2024 }
2025 
2026 enum
2027 {
2028 	MONO_ASSEMBLYREFPROC_PROCESSOR = 0,
2029 	MONO_ASSEMBLYREFPROC_ASSEMBLYREF = 1,
2030 	MONO_ASSEMBLYREFPROC_SIZE = 2
2031 }
2032 
2033 enum
2034 {
2035 	MONO_CLASS_LAYOUT_PACKING_SIZE = 0,
2036 	MONO_CLASS_LAYOUT_CLASS_SIZE = 1,
2037 	MONO_CLASS_LAYOUT_PARENT = 2,
2038 	MONO_CLASS_LAYOUT_SIZE = 3
2039 }
2040 
2041 enum
2042 {
2043 	MONO_CONSTANT_TYPE = 0,
2044 	MONO_CONSTANT_PADDING = 1,
2045 	MONO_CONSTANT_PARENT = 2,
2046 	MONO_CONSTANT_VALUE = 3,
2047 	MONO_CONSTANT_SIZE = 4
2048 }
2049 
2050 enum
2051 {
2052 	MONO_CUSTOM_ATTR_PARENT = 0,
2053 	MONO_CUSTOM_ATTR_TYPE = 1,
2054 	MONO_CUSTOM_ATTR_VALUE = 2,
2055 	MONO_CUSTOM_ATTR_SIZE = 3
2056 }
2057 
2058 enum
2059 {
2060 	MONO_DECL_SECURITY_ACTION = 0,
2061 	MONO_DECL_SECURITY_PARENT = 1,
2062 	MONO_DECL_SECURITY_PERMISSIONSET = 2,
2063 	MONO_DECL_SECURITY_SIZE = 3
2064 }
2065 
2066 enum
2067 {
2068 	MONO_EVENT_MAP_PARENT = 0,
2069 	MONO_EVENT_MAP_EVENTLIST = 1,
2070 	MONO_EVENT_MAP_SIZE = 2
2071 }
2072 
2073 enum
2074 {
2075 	MONO_EVENT_FLAGS = 0,
2076 	MONO_EVENT_NAME = 1,
2077 	MONO_EVENT_TYPE = 2,
2078 	MONO_EVENT_SIZE = 3
2079 }
2080 
2081 enum
2082 {
2083 	MONO_EVENT_POINTER_EVENT = 0,
2084 	MONO_EVENT_POINTER_SIZE = 1
2085 }
2086 
2087 enum
2088 {
2089 	MONO_EXP_TYPE_FLAGS = 0,
2090 	MONO_EXP_TYPE_TYPEDEF = 1,
2091 	MONO_EXP_TYPE_NAME = 2,
2092 	MONO_EXP_TYPE_NAMESPACE = 3,
2093 	MONO_EXP_TYPE_IMPLEMENTATION = 4,
2094 	MONO_EXP_TYPE_SIZE = 5
2095 }
2096 
2097 enum
2098 {
2099 	MONO_FIELD_FLAGS = 0,
2100 	MONO_FIELD_NAME = 1,
2101 	MONO_FIELD_SIGNATURE = 2,
2102 	MONO_FIELD_SIZE = 3
2103 }
2104 
2105 enum
2106 {
2107 	MONO_FIELD_LAYOUT_OFFSET = 0,
2108 	MONO_FIELD_LAYOUT_FIELD = 1,
2109 	MONO_FIELD_LAYOUT_SIZE = 2
2110 }
2111 
2112 enum
2113 {
2114 	MONO_FIELD_MARSHAL_PARENT = 0,
2115 	MONO_FIELD_MARSHAL_NATIVE_TYPE = 1,
2116 	MONO_FIELD_MARSHAL_SIZE = 2
2117 }
2118 
2119 enum
2120 {
2121 	MONO_FIELD_POINTER_FIELD = 0,
2122 	MONO_FIELD_POINTER_SIZE = 1
2123 }
2124 
2125 enum
2126 {
2127 	MONO_FIELD_RVA_RVA = 0,
2128 	MONO_FIELD_RVA_FIELD = 1,
2129 	MONO_FIELD_RVA_SIZE = 2
2130 }
2131 
2132 enum
2133 {
2134 	MONO_FILE_FLAGS = 0,
2135 	MONO_FILE_NAME = 1,
2136 	MONO_FILE_HASH_VALUE = 2,
2137 	MONO_FILE_SIZE = 3
2138 }
2139 
2140 enum
2141 {
2142 	MONO_IMPLMAP_FLAGS = 0,
2143 	MONO_IMPLMAP_MEMBER = 1,
2144 	MONO_IMPLMAP_NAME = 2,
2145 	MONO_IMPLMAP_SCOPE = 3,
2146 	MONO_IMPLMAP_SIZE = 4
2147 }
2148 
2149 enum
2150 {
2151 	MONO_INTERFACEIMPL_CLASS = 0,
2152 	MONO_INTERFACEIMPL_INTERFACE = 1,
2153 	MONO_INTERFACEIMPL_SIZE = 2
2154 }
2155 
2156 enum
2157 {
2158 	MONO_MANIFEST_OFFSET = 0,
2159 	MONO_MANIFEST_FLAGS = 1,
2160 	MONO_MANIFEST_NAME = 2,
2161 	MONO_MANIFEST_IMPLEMENTATION = 3,
2162 	MONO_MANIFEST_SIZE = 4
2163 }
2164 
2165 enum
2166 {
2167 	MONO_MEMBERREF_CLASS = 0,
2168 	MONO_MEMBERREF_NAME = 1,
2169 	MONO_MEMBERREF_SIGNATURE = 2,
2170 	MONO_MEMBERREF_SIZE = 3
2171 }
2172 
2173 enum
2174 {
2175 	MONO_METHOD_RVA = 0,
2176 	MONO_METHOD_IMPLFLAGS = 1,
2177 	MONO_METHOD_FLAGS = 2,
2178 	MONO_METHOD_NAME = 3,
2179 	MONO_METHOD_SIGNATURE = 4,
2180 	MONO_METHOD_PARAMLIST = 5,
2181 	MONO_METHOD_SIZE = 6
2182 }
2183 
2184 enum
2185 {
2186 	MONO_METHODIMPL_CLASS = 0,
2187 	MONO_METHODIMPL_BODY = 1,
2188 	MONO_METHODIMPL_DECLARATION = 2,
2189 	MONO_METHODIMPL_SIZE = 3
2190 }
2191 
2192 enum
2193 {
2194 	MONO_METHOD_POINTER_METHOD = 0,
2195 	MONO_METHOD_POINTER_SIZE = 1
2196 }
2197 
2198 enum
2199 {
2200 	MONO_METHOD_SEMA_SEMANTICS = 0,
2201 	MONO_METHOD_SEMA_METHOD = 1,
2202 	MONO_METHOD_SEMA_ASSOCIATION = 2,
2203 	MONO_METHOD_SEMA_SIZE = 3
2204 }
2205 
2206 enum
2207 {
2208 	MONO_MODULE_GENERATION = 0,
2209 	MONO_MODULE_NAME = 1,
2210 	MONO_MODULE_MVID = 2,
2211 	MONO_MODULE_ENC = 3,
2212 	MONO_MODULE_ENCBASE = 4,
2213 	MONO_MODULE_SIZE = 5
2214 }
2215 
2216 enum
2217 {
2218 	MONO_MODULEREF_NAME = 0,
2219 	MONO_MODULEREF_SIZE = 1
2220 }
2221 
2222 enum
2223 {
2224 	MONO_NESTED_CLASS_NESTED = 0,
2225 	MONO_NESTED_CLASS_ENCLOSING = 1,
2226 	MONO_NESTED_CLASS_SIZE = 2
2227 }
2228 
2229 enum
2230 {
2231 	MONO_PARAM_FLAGS = 0,
2232 	MONO_PARAM_SEQUENCE = 1,
2233 	MONO_PARAM_NAME = 2,
2234 	MONO_PARAM_SIZE = 3
2235 }
2236 
2237 enum
2238 {
2239 	MONO_PARAM_POINTER_PARAM = 0,
2240 	MONO_PARAM_POINTER_SIZE = 1
2241 }
2242 
2243 enum
2244 {
2245 	MONO_PROPERTY_FLAGS = 0,
2246 	MONO_PROPERTY_NAME = 1,
2247 	MONO_PROPERTY_TYPE = 2,
2248 	MONO_PROPERTY_SIZE = 3
2249 }
2250 
2251 enum
2252 {
2253 	MONO_PROPERTY_POINTER_PROPERTY = 0,
2254 	MONO_PROPERTY_POINTER_SIZE = 1
2255 }
2256 
2257 enum
2258 {
2259 	MONO_PROPERTY_MAP_PARENT = 0,
2260 	MONO_PROPERTY_MAP_PROPERTY_LIST = 1,
2261 	MONO_PROPERTY_MAP_SIZE = 2
2262 }
2263 
2264 enum
2265 {
2266 	MONO_STAND_ALONE_SIGNATURE = 0,
2267 	MONO_STAND_ALONE_SIGNATURE_SIZE = 1
2268 }
2269 
2270 enum
2271 {
2272 	MONO_TYPEDEF_FLAGS = 0,
2273 	MONO_TYPEDEF_NAME = 1,
2274 	MONO_TYPEDEF_NAMESPACE = 2,
2275 	MONO_TYPEDEF_EXTENDS = 3,
2276 	MONO_TYPEDEF_FIELD_LIST = 4,
2277 	MONO_TYPEDEF_METHOD_LIST = 5,
2278 	MONO_TYPEDEF_SIZE = 6
2279 }
2280 
2281 enum
2282 {
2283 	MONO_TYPEREF_SCOPE = 0,
2284 	MONO_TYPEREF_NAME = 1,
2285 	MONO_TYPEREF_NAMESPACE = 2,
2286 	MONO_TYPEREF_SIZE = 3
2287 }
2288 
2289 enum
2290 {
2291 	MONO_TYPESPEC_SIGNATURE = 0,
2292 	MONO_TYPESPEC_SIZE = 1
2293 }
2294 
2295 enum
2296 {
2297 	MONO_GENERICPARAM_NUMBER = 0,
2298 	MONO_GENERICPARAM_FLAGS = 1,
2299 	MONO_GENERICPARAM_OWNER = 2,
2300 	MONO_GENERICPARAM_NAME = 3,
2301 
2302 	MONO_GENERICPARAM_SIZE = 4
2303 }
2304 
2305 enum
2306 {
2307 	MONO_METHODSPEC_METHOD = 0,
2308 	MONO_METHODSPEC_SIGNATURE = 1,
2309 	MONO_METHODSPEC_SIZE = 2
2310 }
2311 
2312 enum
2313 {
2314 	MONO_GENPARCONSTRAINT_GENERICPAR = 0,
2315 	MONO_GENPARCONSTRAINT_CONSTRAINT = 1,
2316 	MONO_GENPARCONSTRAINT_SIZE = 2
2317 }
2318 
2319 enum
2320 {
2321 	MONO_DOCUMENT_NAME = 0,
2322 	MONO_DOCUMENT_HASHALG = 1,
2323 	MONO_DOCUMENT_HASH = 2,
2324 	MONO_DOCUMENT_LANGUAGE = 3,
2325 	MONO_DOCUMENT_SIZE = 4
2326 }
2327 
2328 enum
2329 {
2330 	MONO_METHODBODY_DOCUMENT = 0,
2331 	MONO_METHODBODY_SEQ_POINTS = 1,
2332 	MONO_METHODBODY_SIZE = 2
2333 }
2334 
2335 enum
2336 {
2337 	MONO_LOCALSCOPE_METHOD = 0,
2338 	MONO_LOCALSCOPE_IMPORTSCOPE = 1,
2339 	MONO_LOCALSCOPE_VARIABLELIST = 2,
2340 	MONO_LOCALSCOPE_CONSTANTLIST = 3,
2341 	MONO_LOCALSCOPE_STARTOFFSET = 4,
2342 	MONO_LOCALSCOPE_LENGTH = 5,
2343 	MONO_LOCALSCOPE_SIZE = 6
2344 }
2345 
2346 enum
2347 {
2348 	MONO_LOCALVARIABLE_ATTRIBUTES = 0,
2349 	MONO_LOCALVARIABLE_INDEX = 1,
2350 	MONO_LOCALVARIABLE_NAME = 2,
2351 	MONO_LOCALVARIABLE_SIZE = 3
2352 }
2353 
2354 enum
2355 {
2356 	MONO_CUSTOMDEBUGINFORMATION_PARENT = 0,
2357 	MONO_CUSTOMDEBUGINFORMATION_KIND = 1,
2358 	MONO_CUSTOMDEBUGINFORMATION_VALUE = 2,
2359 	MONO_CUSTOMDEBUGINFORMATION_SIZE = 3
2360 }
2361 
2362 /**
2363  * Coded Tokens
2364  * The _BITS entry is for the bits used in the token.
2365  * The _MASK entry is for mask the index out.
2366  */
2367 
2368 enum
2369 {
2370 	MONO_TYPEDEFORREF_TYPEDEF = 0,
2371 	MONO_TYPEDEFORREF_TYPEREF = 1,
2372 	MONO_TYPEDEFORREF_TYPESPEC = 2,
2373 	MONO_TYPEDEFORREF_BITS = 2,
2374 	MONO_TYPEDEFORREF_MASK = 3
2375 }
2376 
2377 enum
2378 {
2379 	MONO_HASCONSTANT_FIEDDEF = 0,
2380 	MONO_HASCONSTANT_PARAM = 1,
2381 	MONO_HASCONSTANT_PROPERTY = 2,
2382 	MONO_HASCONSTANT_BITS = 2,
2383 	MONO_HASCONSTANT_MASK = 3
2384 }
2385 
2386 enum
2387 {
2388 	MONO_CUSTOM_ATTR_METHODDEF = 0,
2389 	MONO_CUSTOM_ATTR_FIELDDEF = 1,
2390 	MONO_CUSTOM_ATTR_TYPEREF = 2,
2391 	MONO_CUSTOM_ATTR_TYPEDEF = 3,
2392 	MONO_CUSTOM_ATTR_PARAMDEF = 4,
2393 	MONO_CUSTOM_ATTR_INTERFACE = 5,
2394 	MONO_CUSTOM_ATTR_MEMBERREF = 6,
2395 	MONO_CUSTOM_ATTR_MODULE = 7,
2396 	MONO_CUSTOM_ATTR_PERMISSION = 8,
2397 	MONO_CUSTOM_ATTR_PROPERTY = 9,
2398 	MONO_CUSTOM_ATTR_EVENT = 10,
2399 	MONO_CUSTOM_ATTR_SIGNATURE = 11,
2400 	MONO_CUSTOM_ATTR_MODULEREF = 12,
2401 	MONO_CUSTOM_ATTR_TYPESPEC = 13,
2402 	MONO_CUSTOM_ATTR_ASSEMBLY = 14,
2403 	MONO_CUSTOM_ATTR_ASSEMBLYREF = 15,
2404 	MONO_CUSTOM_ATTR_FILE = 16,
2405 	MONO_CUSTOM_ATTR_EXP_TYPE = 17,
2406 	MONO_CUSTOM_ATTR_MANIFEST = 18,
2407 	MONO_CUSTOM_ATTR_GENERICPAR = 19,
2408 	MONO_CUSTOM_ATTR_BITS = 5,
2409 	MONO_CUSTOM_ATTR_MASK = 31
2410 }
2411 
2412 enum
2413 {
2414 	MONO_HAS_FIELD_MARSHAL_FIELDSREF = 0,
2415 	MONO_HAS_FIELD_MARSHAL_PARAMDEF = 1,
2416 	MONO_HAS_FIELD_MARSHAL_BITS = 1,
2417 	MONO_HAS_FIELD_MARSHAL_MASK = 1
2418 }
2419 
2420 enum
2421 {
2422 	MONO_HAS_DECL_SECURITY_TYPEDEF = 0,
2423 	MONO_HAS_DECL_SECURITY_METHODDEF = 1,
2424 	MONO_HAS_DECL_SECURITY_ASSEMBLY = 2,
2425 	MONO_HAS_DECL_SECURITY_BITS = 2,
2426 	MONO_HAS_DECL_SECURITY_MASK = 3
2427 }
2428 
2429 enum
2430 {
2431 	MONO_MEMBERREF_PARENT_TYPEDEF = 0, /** not used */
2432 	MONO_MEMBERREF_PARENT_TYPEREF = 1,
2433 	MONO_MEMBERREF_PARENT_MODULEREF = 2,
2434 	MONO_MEMBERREF_PARENT_METHODDEF = 3,
2435 	MONO_MEMBERREF_PARENT_TYPESPEC = 4,
2436 	MONO_MEMBERREF_PARENT_BITS = 3,
2437 	MONO_MEMBERREF_PARENT_MASK = 7
2438 }
2439 
2440 enum
2441 {
2442 	MONO_HAS_SEMANTICS_EVENT = 0,
2443 	MONO_HAS_SEMANTICS_PROPERTY = 1,
2444 	MONO_HAS_SEMANTICS_BITS = 1,
2445 	MONO_HAS_SEMANTICS_MASK = 1
2446 }
2447 
2448 enum
2449 {
2450 	MONO_METHODDEFORREF_METHODDEF = 0,
2451 	MONO_METHODDEFORREF_METHODREF = 1,
2452 	MONO_METHODDEFORREF_BITS = 1,
2453 	MONO_METHODDEFORREF_MASK = 1
2454 }
2455 
2456 enum
2457 {
2458 	MONO_MEMBERFORWD_FIELDDEF = 0,
2459 	MONO_MEMBERFORWD_METHODDEF = 1,
2460 	MONO_MEMBERFORWD_BITS = 1,
2461 	MONO_MEMBERFORWD_MASK = 1
2462 }
2463 
2464 enum
2465 {
2466 	MONO_IMPLEMENTATION_FILE = 0,
2467 	MONO_IMPLEMENTATION_ASSEMBLYREF = 1,
2468 	MONO_IMPLEMENTATION_EXP_TYPE = 2,
2469 	MONO_IMPLEMENTATION_BITS = 2,
2470 	MONO_IMPLEMENTATION_MASK = 3
2471 }
2472 
2473 enum
2474 {
2475 	MONO_CUSTOM_ATTR_TYPE_TYPEREF = 0, /** not used */
2476 	MONO_CUSTOM_ATTR_TYPE_TYPEDEF = 1, /** not used */
2477 	MONO_CUSTOM_ATTR_TYPE_METHODDEF = 2,
2478 	MONO_CUSTOM_ATTR_TYPE_MEMBERREF = 3,
2479 	MONO_CUSTOM_ATTR_TYPE_STRING = 4, /** not used */
2480 	MONO_CUSTOM_ATTR_TYPE_BITS = 3,
2481 	MONO_CUSTOM_ATTR_TYPE_MASK = 7
2482 }
2483 
2484 enum
2485 {
2486 	MONO_RESOLUTION_SCOPE_MODULE = 0,
2487 	MONO_RESOLUTION_SCOPE_MODULEREF = 1,
2488 	MONO_RESOLUTION_SCOPE_ASSEMBLYREF = 2,
2489 	MONO_RESOLUTION_SCOPE_TYPEREF = 3,
2490 	MONO_RESOLUTION_SCOPE_BITS = 2,
2491 	MONO_RESOLUTION_SCOPE_MASK = 3
2492 }
2493 
2494 /** Kept for compatibility since this is a public header file */
2495 enum
2496 {
2497 	MONO_RESOLTION_SCOPE_MODULE = 0,
2498 	MONO_RESOLTION_SCOPE_MODULEREF = 1,
2499 	MONO_RESOLTION_SCOPE_ASSEMBLYREF = 2,
2500 	MONO_RESOLTION_SCOPE_TYPEREF = 3,
2501 	MONO_RESOLTION_SCOPE_BITS = 2,
2502 	MONO_RESOLTION_SCOPE_MASK = 3
2503 }
2504 
2505 enum
2506 {
2507 	MONO_TYPEORMETHOD_TYPE = 0,
2508 	MONO_TYPEORMETHOD_METHOD = 1,
2509 	MONO_TYPEORMETHOD_BITS = 1,
2510 	MONO_TYPEORMETHOD_MASK = 1
2511 }
2512 
2513 // metadata/sgen-bridge.h
2514 /**
2515  * The bridge is a mechanism for SGen to let clients override the death of some
2516  * unreachable objects.  We use it in monodroid to do garbage collection across
2517  * the Mono and Java heaps.
2518  *
2519  * The client (Monodroid) can designate some objects as "bridged", which means
2520  * that they participate in the bridge processing step once SGen considers them
2521  * unreachable, i.e., dead.  Bridged objects must be registered for
2522  * finalization.
2523  *
2524  * When SGen is done marking, it puts together a list of all dead bridged
2525  * objects.  This is passed to the bridge processor, which does an analysis to
2526  * simplify the graph: It replaces strongly-connected components with single
2527  * nodes, and may remove nodes corresponding to components which do not contain
2528  * bridged objects.
2529  *
2530  * The output of the SCC analysis is passed to the client's `cross_references()`
2531  * callback.  This consists of 2 arrays, an array of SCCs (MonoGCBridgeSCC),
2532  * and an array of "xrefs" (edges between SCCs, MonoGCBridgeXRef).  Edges are
2533  * encoded as pairs of "API indices", ie indexes in the SCC array.  The client
2534  * is expected to set the `is_alive` flag on those strongly connected components
2535  * that it wishes to be kept alive.
2536  *
2537  * In monodroid each bridged object has a corresponding Java mirror object.  In
2538  * the bridge callback it reifies the Mono object graph in the Java heap so that
2539  * the full, combined object graph is now instantiated on the Java side.  Then
2540  * it triggers a Java GC, waits for it to finish, and checks which of the Java
2541  * mirror objects are still alive.  For those it sets the `is_alive` flag and
2542  * returns from the callback.
2543  *
2544  * The SCC analysis is done while the world is stopped, but the callback is made
2545  * with the world running again.  Weak links to bridged objects and other
2546  * objects reachable from them are kept until the callback returns, at which
2547  * point all links to bridged objects that don't have `is_alive` set are nulled.
2548  * Note that weak links to non-bridged objects reachable from bridged objects
2549  * are not nulled.  This might be considered a bug.
2550  *
2551  * There are three different implementations of the bridge processor, each of
2552  * which implements 8 callbacks (see SgenBridgeProcessor).  The implementations
2553  * differ in the algorithm they use to compute the "simplified" SCC graph.
2554  */
2555 enum
2556 {
2557 	SGEN_BRIDGE_VERSION = 5
2558 }
2559 
2560 alias MonoGCBridgeObjectKind = int;
2561 enum : MonoGCBridgeObjectKind
2562 {
2563 	/** Instances of this class should be scanned when computing the transitive dependency among bridges. E.g. List<object>*/
2564 	GC_BRIDGE_TRANSPARENT_CLASS,
2565 	/** Instances of this class should not be scanned when computing the transitive dependency among bridges. E.g. String*/
2566 	GC_BRIDGE_OPAQUE_CLASS,
2567 	/** Instances of this class should be bridged and have their dependency computed. */
2568 	GC_BRIDGE_TRANSPARENT_BRIDGE_CLASS,
2569 	/** Instances of this class should be bridged but no dependencies should not be calculated. */
2570 	GC_BRIDGE_OPAQUE_BRIDGE_CLASS,
2571 }
2572 
2573 struct MonoGCBridgeSCC
2574 {
2575 	mono_bool is_alive; /** to be set by the cross reference callback */
2576 	int num_objs;
2577 	MonoObject*[MONO_ZERO_LEN_ARRAY] objs;
2578 }
2579 
2580 struct MonoGCBridgeXRef
2581 {
2582 	int src_scc_index;
2583 	int dst_scc_index;
2584 }
2585 
2586 struct MonoGCBridgeCallbacks
2587 {
2588 	int bridge_version;
2589 extern (C):
2590 nothrow:
2591 	/**
2592 	 * Tells the runtime which classes to even consider when looking for
2593 	 * bridged objects.  If subclasses are to be considered as well, the
2594 	 * subclass check must be done in the callback.
2595 	 */
2596 	MonoGCBridgeObjectKind function(MonoClass* klass) bridge_class_kind;
2597 	/**
2598 	 * This is only called on objects for whose classes
2599 	 * `bridge_class_kind()` returned `XXX_BRIDGE_CLASS`.
2600 	 */
2601 	mono_bool function(MonoObject* object) is_bridge_object;
2602 	void function(int num_sccs, MonoGCBridgeSCC** sccs, int num_xrefs, MonoGCBridgeXRef* xrefs) cross_references;
2603 }
2604 
2605 // metadata/threads.h
2606 alias MonoThreadManageCallback = int function(MonoThread* thread);
2607 
2608 // metadata/tokentype.h
2609 /**
2610  * These tokens match the table ID except for the last
2611  * three (string, name and base type which are special)
2612  */
2613 
2614 alias MonoTokenType = int;
2615 enum : MonoTokenType
2616 {
2617 	MONO_TOKEN_MODULE = 0,
2618 	MONO_TOKEN_TYPE_REF = 16777216,
2619 	MONO_TOKEN_TYPE_DEF = 33554432,
2620 	MONO_TOKEN_FIELD_DEF = 67108864,
2621 	MONO_TOKEN_METHOD_DEF = 100663296,
2622 	MONO_TOKEN_PARAM_DEF = 134217728,
2623 	MONO_TOKEN_INTERFACE_IMPL = 150994944,
2624 	MONO_TOKEN_MEMBER_REF = 167772160,
2625 	MONO_TOKEN_CUSTOM_ATTRIBUTE = 201326592,
2626 	MONO_TOKEN_PERMISSION = 234881024,
2627 	MONO_TOKEN_SIGNATURE = 285212672,
2628 	MONO_TOKEN_EVENT = 335544320,
2629 	MONO_TOKEN_PROPERTY = 385875968,
2630 	MONO_TOKEN_MODULE_REF = 436207616,
2631 	MONO_TOKEN_TYPE_SPEC = 452984832,
2632 	MONO_TOKEN_ASSEMBLY = 536870912,
2633 	MONO_TOKEN_ASSEMBLY_REF = 587202560,
2634 	MONO_TOKEN_FILE = 637534208,
2635 	MONO_TOKEN_EXPORTED_TYPE = 654311424,
2636 	MONO_TOKEN_MANIFEST_RESOURCE = 671088640,
2637 	MONO_TOKEN_GENERIC_PARAM = 704643072,
2638 	MONO_TOKEN_METHOD_SPEC = 721420288,
2639 
2640 	/**
2641     	 * These do not match metadata tables directly
2642     	 */
2643 	MONO_TOKEN_STRING = 1879048192,
2644 	MONO_TOKEN_NAME = 1895825408,
2645 	MONO_TOKEN_BASE_TYPE = 1912602624
2646 }
2647 
2648 // metadata/verify.h
2649 alias MonoVerifyStatus = int;
2650 enum : MonoVerifyStatus
2651 {
2652 	MONO_VERIFY_OK,
2653 	MONO_VERIFY_ERROR,
2654 	MONO_VERIFY_WARNING,
2655 	MONO_VERIFY_CLS = 4,
2656 	MONO_VERIFY_ALL = 7,
2657 
2658 	/** Status signaling code that is not verifiable.*/
2659 	MONO_VERIFY_NOT_VERIFIABLE = 8,
2660 
2661 	/**OR it with other flags*/
2662 
2663 	/** Abort the verification if the code is not verifiable.
2664 	 * The standard behavior is to abort if the code is not valid.
2665 	 * */
2666 	MONO_VERIFY_FAIL_FAST = 16,
2667 
2668 	/** Perform less verification of the code. This flag should be used
2669 	 * if one wants the verifier to be more compatible to the MS runtime.
2670 	 * Mind that this is not to be more compatible with MS peverify, but
2671 	 * with the runtime itself, that has a less strict verifier.
2672 	 */
2673 	MONO_VERIFY_NON_STRICT = 32,
2674 
2675 	/**Skip all visibility related checks*/
2676 	MONO_VERIFY_SKIP_VISIBILITY = 64,
2677 
2678 	/**Skip all visibility related checks*/
2679 	MONO_VERIFY_REPORT_ALL_ERRORS = 128
2680 }
2681 
2682 struct MonoVerifyInfo
2683 {
2684 	char* message;
2685 	MonoVerifyStatus status;
2686 }
2687 
2688 struct MonoVerifyInfoExtended
2689 {
2690 	MonoVerifyInfo info;
2691 	ubyte /+MonoExceptionType+/ exception_type; /**should be one of MONO_EXCEPTION_* */
2692 }
2693 
2694 // jit/jit.h
2695 alias MonoAotMode = int;
2696 enum : MonoAotMode
2697 {
2698 	/** Disables AOT mode */
2699 	MONO_AOT_MODE_NONE,
2700 	/** Enables normal AOT mode, equivalent to mono_jit_set_aot_only (false) */
2701 	MONO_AOT_MODE_NORMAL,
2702 	/** Enables hybrid AOT mode, JIT can still be used for wrappers */
2703 	MONO_AOT_MODE_HYBRID,
2704 	/** Enables full AOT mode, JIT is disabled and not allowed,
2705 	 * equivalent to mono_jit_set_aot_only (true) */
2706 	MONO_AOT_MODE_FULL,
2707 	/** Same as full, but use only llvm compiled code */
2708 	MONO_AOT_MODE_LLVMONLY
2709 }
2710 
2711 alias MonoBreakPolicy = int;
2712 enum : MonoBreakPolicy
2713 {
2714 	/** the default is to always obey the breakpoint */
2715 	MONO_BREAK_POLICY_ALWAYS,
2716 	/** a nop is inserted instead of a breakpoint */
2717 	MONO_BREAK_POLICY_NEVER,
2718 	/** the breakpoint is executed only if the program has ben started under
2719 	 * the debugger (that is if a debugger was attached at the time the method
2720 	 * was compiled).
2721 	 */
2722 	MONO_BREAK_POLICY_ON_DBG
2723 }
2724 
2725 alias MonoBreakPolicyFunc = MonoBreakPolicy function(MonoMethod*);