From ba8b5ed47bbbfa8348d9ae3c422d7710933025e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Wed, 21 Oct 2026 13:55:07 +0200 Subject: [PATCH] Removed Mono Runtime stuff --- .../src/EditWindows/ComponentEditWindow.bf | 1 - .../Scripting/{MonoDecimal.bf => Decimal.bf} | 64 +- .../src/Scripting/EntityEditorWrapper.bf | 1 - .../src/Scripting/EntitySerializerWrapper.bf | 11 - GlitchyEngine/src/Scripting/ScriptEngine.bf | 1 - GlitchyEngine/src/Scripting/ScriptGlue.bf | 3 +- .../src/Serialization/SerializedObject.bf | 5 +- .../src/World/Components/Components.bf | 1 - GlitchyEngineHelper/src/Mono/Jit/Jit.bf | 5 - .../src/Mono/Metadata/Assembly.bf | 9 - GlitchyEngineHelper/src/Mono/Mono.bf | 601 ------------------ 11 files changed, 60 insertions(+), 642 deletions(-) rename GlitchyEngine/src/Scripting/{MonoDecimal.bf => Decimal.bf} (64%) delete mode 100644 GlitchyEngineHelper/src/Mono/Jit/Jit.bf delete mode 100644 GlitchyEngineHelper/src/Mono/Metadata/Assembly.bf delete mode 100644 GlitchyEngineHelper/src/Mono/Mono.bf diff --git a/GlitchyEditor/src/EditWindows/ComponentEditWindow.bf b/GlitchyEditor/src/EditWindows/ComponentEditWindow.bf index 10bca6e..e8b249e 100644 --- a/GlitchyEditor/src/EditWindows/ComponentEditWindow.bf +++ b/GlitchyEditor/src/EditWindows/ComponentEditWindow.bf @@ -8,7 +8,6 @@ using GlitchyEngine; using GlitchyEngine.Content; using GlitchyEngine.Scripting; using GlitchyEngine.Core; -using Mono; using GlitchyEngine.World.Components; namespace GlitchyEditor.EditWindows diff --git a/GlitchyEngine/src/Scripting/MonoDecimal.bf b/GlitchyEngine/src/Scripting/Decimal.bf similarity index 64% rename from GlitchyEngine/src/Scripting/MonoDecimal.bf rename to GlitchyEngine/src/Scripting/Decimal.bf index 8cdcf54..65ba400 100644 --- a/GlitchyEngine/src/Scripting/MonoDecimal.bf +++ b/GlitchyEngine/src/Scripting/Decimal.bf @@ -1,11 +1,28 @@ +// Based on the Decimal implementation from the Mono Runtime: https://github.com/mono/mono/blob/0f53e9e151d92944cacab3e24ac359410c606df6/mcs/class/referencesource/mscorlib/system/decimal.cs +// Originally licensed under the MIT license. + using System; -using Bon.Integrated; using Bon; +using Bon.Integrated; + namespace GlitchyEngine.Scripting; -/// A struct providing access to the components of a mono decimal. -struct MonoDecimal +/// A struct compatible with the Decimal type form the .Net Runtime. +struct Decimal { + // Sign mask for the flags field. A value of zero in this bit indicates a + // positive Decimal value, and a value of one in this bit indicates a + // negative Decimal value. + // + // Look at OleAut's DECIMAL_NEG constant to check for negative values + // in native code. + private const uint32 SignMask = 0x80000000u; + + // Scale mask for the flags field. This byte in the flags field contains + // the power of 10 to divide the Decimal value by. The scale byte must + // contain a value between 0 and 28 inclusive. + private const uint32 ScaleMask = 0x00FF0000u; + [Bitfield(.Private, .BitsAt(16, 0), "_dontUse", .Read)] [Bitfield(.Public, .BitsAt(8, 16), "Exponent")] [Bitfield(.Private, .BitsAt(7, 24), "_dontUse2")] @@ -20,15 +37,48 @@ struct MonoDecimal static this { - gBonEnv.typeHandlers.Add(typeof(MonoDecimal), + gBonEnv.typeHandlers.Add(typeof(Decimal), ((.)new => AssetSerialize, new => AssetDeserialize)); } + public this() + { + _high = 0; + _low = 0; + _mid = 0; + _flags = 0; + } + + public this(int value) + { + var value; + if (value >= 0) + { + _flags = 0; + } + else + { + _flags = SignMask; + value = -value; + } + _low = (uint32)value; + _mid = (uint32)(value >> 32); + _high = 0; + } + + public this(uint value) + { + _flags = 0; + _low = (uint32)value; + _mid = (uint32)(value >> 32); + _high = 0; + } + static void AssetSerialize(BonWriter writer, ValueView value, BonEnvironment environment, SerializeValueState state) { Log.EngineLogger.Assert(value.type == typeof(Self)); - MonoDecimal decimal = value.Get(); + Decimal decimal = value.Get(); decimal.ToString(writer.outStr); } @@ -86,11 +136,11 @@ struct MonoDecimal strBuffer.Append('m'); } - public static Result Parse(StringView strBuffer) + public static Result Parse(StringView strBuffer) { var strBuffer; - MonoDecimal result = .(); + Decimal result = .(); if (strBuffer.StartsWith('-')) { diff --git a/GlitchyEngine/src/Scripting/EntityEditorWrapper.bf b/GlitchyEngine/src/Scripting/EntityEditorWrapper.bf index e134c0e..c77272a 100644 --- a/GlitchyEngine/src/Scripting/EntityEditorWrapper.bf +++ b/GlitchyEngine/src/Scripting/EntityEditorWrapper.bf @@ -1,5 +1,4 @@ using System; -using Mono; using GlitchyEngine.Core; using System.Diagnostics; diff --git a/GlitchyEngine/src/Scripting/EntitySerializerWrapper.bf b/GlitchyEngine/src/Scripting/EntitySerializerWrapper.bf index 2489d9b..0657cab 100644 --- a/GlitchyEngine/src/Scripting/EntitySerializerWrapper.bf +++ b/GlitchyEngine/src/Scripting/EntitySerializerWrapper.bf @@ -48,17 +48,6 @@ class EntitySerializerWrapper : NewScriptClass _createSerializationContextMethod(serializerPtr); } - /*public void ClearSerializationContext(ScriptInstanceSerializer serializer) - { - void* serializerPtr = Internal.UnsafeCastToPtr(serializer); - - MonoException* exception = null; - _clearSerializationContextMethod(serializerPtr, &exception); - - if (exception != null) - ScriptEngine.[Friend]HandleMonoException(exception, null); - }*/ - public void DestroySerializationContext(ScriptInstanceSerializer serializer) { void* serializerPtr = Internal.UnsafeCastToPtr(serializer); diff --git a/GlitchyEngine/src/Scripting/ScriptEngine.bf b/GlitchyEngine/src/Scripting/ScriptEngine.bf index e6289f3..5a192a6 100644 --- a/GlitchyEngine/src/Scripting/ScriptEngine.bf +++ b/GlitchyEngine/src/Scripting/ScriptEngine.bf @@ -186,7 +186,6 @@ static class ScriptEngine public static void Init() { InitRuntime(); - //InitMono(); LoadScriptAssemblies(); } diff --git a/GlitchyEngine/src/Scripting/ScriptGlue.bf b/GlitchyEngine/src/Scripting/ScriptGlue.bf index 1166e56..fdd0e03 100644 --- a/GlitchyEngine/src/Scripting/ScriptGlue.bf +++ b/GlitchyEngine/src/Scripting/ScriptGlue.bf @@ -344,7 +344,7 @@ static class ScriptGlue }); } - /// Gets the entity with the given id. Throws a mono exception, if the entity doesn't exist. + /// Gets the entity with the given id. Returns an .Err if it doesn't exist. static Result GetEntitySafe(UUID entityId) { if (ScriptEngine.Context.GetEntityByID(entityId) case .Ok(let entity)) @@ -625,7 +625,6 @@ static class ScriptGlue return .ArgumentError; } - //return scriptComponent.Instance.MonoInstance; return .Ok; } diff --git a/GlitchyEngine/src/Serialization/SerializedObject.bf b/GlitchyEngine/src/Serialization/SerializedObject.bf index d174c89..7935922 100644 --- a/GlitchyEngine/src/Serialization/SerializedObject.bf +++ b/GlitchyEngine/src/Serialization/SerializedObject.bf @@ -1,6 +1,5 @@ using GlitchyEngine.Core; using GlitchyEngine.Scripting; -using Mono; using System; using System.Collections; using Bon.Integrated; @@ -315,7 +314,7 @@ class SerializedObject Serialize.Value(writer, GetFieldDataAs(field.Data), environment); case .Decimal: writer.Type("decimal"); - Serialize.Value(writer, GetFieldDataAs(field.Data), environment); + Serialize.Value(writer, GetFieldDataAs(field.Data), environment); case .Enum: writer.Type("Enum"); @@ -499,7 +498,7 @@ class SerializedObject if (reader.inStr.StartsWith('m')) reader.inStr.RemoveFromStart(1); - MonoDecimal decimalValue = Try!(MonoDecimal.Parse(numberView)); + Decimal decimalValue = Try!(Decimal.Parse(numberView)); fieldType = .Decimal; object.SetRawData(fieldType, decimalValue, ref fieldData); diff --git a/GlitchyEngine/src/World/Components/Components.bf b/GlitchyEngine/src/World/Components/Components.bf index 81e780b..388af6e 100644 --- a/GlitchyEngine/src/World/Components/Components.bf +++ b/GlitchyEngine/src/World/Components/Components.bf @@ -5,7 +5,6 @@ using GlitchyEngine.Core; using Box2D; using GlitchyEngine.Content; using GlitchyEngine.Scripting; -using Mono; namespace GlitchyEngine.World { diff --git a/GlitchyEngineHelper/src/Mono/Jit/Jit.bf b/GlitchyEngineHelper/src/Mono/Jit/Jit.bf deleted file mode 100644 index 4ad53cb..0000000 --- a/GlitchyEngineHelper/src/Mono/Jit/Jit.bf +++ /dev/null @@ -1,5 +0,0 @@ -namespace Mono; - -class Jit -{ -} \ No newline at end of file diff --git a/GlitchyEngineHelper/src/Mono/Metadata/Assembly.bf b/GlitchyEngineHelper/src/Mono/Metadata/Assembly.bf deleted file mode 100644 index ba379d7..0000000 --- a/GlitchyEngineHelper/src/Mono/Metadata/Assembly.bf +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace Mono.Metadata; - -class Assembly -{ - [LinkName(.C)] - public static extern void mono_set_assemblies_path(char8* path); -} \ No newline at end of file diff --git a/GlitchyEngineHelper/src/Mono/Mono.bf b/GlitchyEngineHelper/src/Mono/Mono.bf deleted file mode 100644 index 12f6bee..0000000 --- a/GlitchyEngineHelper/src/Mono/Mono.bf +++ /dev/null @@ -1,601 +0,0 @@ -using System; - -namespace Mono; - -static class Mono -{ - typealias mono_bool = System.Windows.IntBool; - - [LinkName(.C)] - public static extern void mono_set_assemblies_path(char8* path); - - [LinkName(.C)] - public static extern MonoDomain* mono_jit_init(char8* file); - - [LinkName(.C)] - public static extern void mono_jit_parse_options(int32 argc, char8** argv); - - [LinkName(.C)] - public static extern void mono_jit_cleanup(MonoDomain* domain); - - [LinkName(.C)] - public static extern MonoDomain* mono_domain_create_appdomain(char8* friendly_name, char8* configuration_file); - - [LinkName(.C)] - public static extern mono_bool mono_domain_set(MonoDomain* domain, mono_bool force); - - [LinkName(.C)] - public static extern MonoImage* mono_image_open_from_data_full(uint8* data, uint32 data_len, - mono_bool need_copy, MonoImageOpenStatus* status, mono_bool refonly); - - [LinkName(.C)] - public static extern MonoImage* mono_assembly_get_image(MonoAssembly* assembly); - - [LinkName(.C)] - public static extern void mono_assembly_close(MonoAssembly* assembly); - - [LinkName(.C)] - public static extern void mono_image_close(MonoImage* image); - - [LinkName(.C)] - public static extern char8* mono_image_strerror(MonoImageOpenStatus status); - - [LinkName(.C)] - public static extern MonoAssembly* mono_assembly_load_from_full(MonoImage* image, char8* fileName, - MonoImageOpenStatus* status, mono_bool refonly); - - - [LinkName(.C)] - public static extern MonoTableInfo* mono_image_get_table_info(MonoImage* image, MonoMetaTableEnum table_id); - - [LinkName(.C)] - public static extern int32 mono_image_get_table_rows(MonoImage *image, MonoMetaTableEnum table_id); - - [LinkName(.C)] - public static extern int32 mono_table_info_get_rows(MonoTableInfo* table); - - [LinkName(.C)] - public static extern void mono_metadata_decode_row (MonoTableInfo* t, - int32 idx, - uint32* res, - int32 res_size); - - [LinkName(.C)] - public static extern char8* mono_metadata_string_heap(MonoImage* meta, uint32 table_index); - [LinkName(.C)] - public static extern uint8* mono_metadata_blob_heap(MonoImage* meta, uint32 index); - [LinkName(.C)] - public static extern uint32 mono_metadata_decode_blob_size(uint8* xptr, out uint8* newPosition); - - typealias gconstpointer = void*; - typealias gpointer = void*; - - [LinkName(.C)] - public static extern void mono_add_internal_call(char8* name, gconstpointer method); - - [LinkName(.C)] - public static extern MonoString* mono_string_new(MonoDomain* domain, char8* text); - - [LinkName(.C)] - public static extern MonoString* mono_string_new_len(MonoDomain* domain, char8* text, uint32 length); - - [LinkName(.C)] - public static extern MonoDomain* mono_domain_get(); - - [LinkName(.C)] - public static extern MonoClass* mono_class_from_name(MonoImage* image, char8* name_space, - char8* name); - - [LinkName(.C)] - public static extern MonoClass* mono_class_from_mono_type(MonoType* type); - - [LinkName(.C)] - public static extern char8* mono_class_get_name(MonoClass* monoClass); - - [LinkName(.C)] - public static extern MonoType* mono_class_get_type(MonoClass* monoClass); - - [LinkName(.C)] - public static extern int32 mono_class_instance_size(MonoClass* @class); - - [LinkName(.C)] - public static extern char8* mono_class_get_namespace(MonoClass* monoClass); - - [LinkName(.C)] - public static extern MonoImage* mono_class_get_image(MonoClass* monoClass); - - [LinkName(.C)] - public static extern MonoClass* mono_class_load_from_name(MonoImage* image, char8* name_space, - char8* name); - - [LinkName(.C)] - public static extern MonoObject* mono_object_new(MonoDomain* domain, MonoClass* klass); - - [LinkName(.C)] - public static extern void mono_runtime_object_init(MonoObject* this_obj); - - [LinkName(.C)] - public static extern MonoMethod* mono_class_get_methods(MonoClass* klass, gpointer* iter); - - [LinkName(.C)] - public static extern MonoMethod* mono_class_get_method_from_name(MonoClass* klass, char8* name, int param_count); - - [LinkName(.C)] - public static extern MonoObject* mono_runtime_invoke(MonoMethod* method, void* obj, void** param, MonoObject** exc); - - [LinkName(.C)] - public static extern MonoMethod* mono_object_get_virtual_method(MonoObject* obj, MonoMethod* method); - - [LinkName(.C)] - public static extern void* mono_object_unbox(MonoObject* obj); - - [LinkName(.C)] - public static extern void* mono_domain_unload(MonoDomain* domain); - - - [LinkName(.C)] - public static extern gpointer mono_method_get_unmanaged_thunk(MonoMethod *method); - - [LinkName(.C)] - public static extern char8* mono_method_get_name(MonoMethod *method); - - [LinkName(.C)] - public static extern MonoMethodSignature* mono_method_signature(MonoMethod *method); - - [LinkName(.C)] - public static extern uint32 mono_signature_get_param_count(MonoMethodSignature *sig); - - [LinkName(.C)] - public static extern MonoType* mono_signature_get_params(MonoMethodSignature *sig, gpointer *iter); - - [LinkName(.C)] - public static extern mono_bool mono_class_is_subclass_of(MonoClass *monoClass, MonoClass *parentClass, - mono_bool check_interfaces); - - [LinkName(.C)] - public static extern uint32 mono_gchandle_new(MonoObject* obj, mono_bool pinned); - - [LinkName(.C)] - public static extern void mono_gchandle_free(uint32 gchandle); - - [LinkName(.C)] - public static extern char8* mono_string_to_utf8(MonoString *s); - - [LinkName(.C)] - public static extern char8* mono_string_to_utf8_checked(MonoString *s, MonoError* error); - - [LinkName(.C)] - public static extern void mono_free(void* ptr); - - [LinkName(.C)] - public static extern MonoClassField* mono_class_get_field_from_name(MonoClass* monoClass, char8* name); - - [LinkName(.C)] - public static extern void mono_field_set_value(MonoObject* obj, MonoClassField* field, void* value); - - [LinkName(.C)] - public static extern MonoType* mono_reflection_type_from_name(char8* name, MonoImage* image); - - [LinkName(.C)] - public static extern MonoType* mono_reflection_type_get_type(MonoReflectionType* reflectionType); - - [LinkName(.C)] - public static extern MonoReflectionType* mono_type_get_object(MonoDomain *domain, MonoType *type); - - [LinkName(.C)] - public static extern MonoClassField* mono_class_get_fields(MonoClass* klass, gpointer* iter); - - [LinkName(.C)] - public static extern MonoClass* mono_class_get_parent(MonoClass* klass); - - [LinkName(.C)] - public static extern char8* mono_field_get_name(MonoClassField* field); - - [LinkName(.C)] - public static extern MonoType* mono_field_get_type(MonoClassField* field); - - [LinkName(.C)] - public static extern MonoClass* mono_field_get_parent(MonoClassField* field); - - [LinkName(.C)] - public static extern uint32 mono_field_get_flags(MonoClassField* field); - - [LinkName(.C)] - public static extern uint8* mono_field_get_data(MonoClassField* field); - - [LinkName(.C)] - public static extern void mono_field_get_value(MonoObject* object, MonoClassField* field, void* value); - - [LinkName(.C)] - public static extern void mono_field_static_get_value(MonoVTable* vt, MonoClassField* field, void* value); - - /// Gets the field as object, boxes the value if it is a valuetype. - [LinkName(.C)] - public static extern MonoObject* mono_field_get_value_object(MonoDomain* domain, MonoClassField* field, MonoObject* obj); - - [LinkName(.C)] - public static extern MonoCustomAttrInfo* mono_custom_attrs_from_class(MonoClass *klass); - - [LinkName(.C)] - public static extern MonoCustomAttrInfo* mono_custom_attrs_from_field(MonoClass* monoClass, MonoClassField* field); - - [LinkName(.C)] - public static extern mono_bool mono_custom_attrs_has_attr(MonoCustomAttrInfo* attributeInfo, MonoClass* attributeClass); - - [LinkName(.C)] - public static extern MonoObject* mono_custom_attrs_get_attr(MonoCustomAttrInfo* attributeInfo, MonoClass* attributeClass); - - [LinkName(.C)] - public static extern Mono.MonoTypeEnum mono_type_get_type(MonoType* type); - - [LinkName(.C)] - public static extern char8* mono_type_get_name(MonoType* type); - - [LinkName(.C)] - public static extern char8* mono_type_full_name(MonoType* type); - - [LinkName(.C)] - public static extern MonoClass* mono_type_get_class(MonoType* type); - - /// MonoError - - [LinkName(.C)] - public static extern void mono_error_cleanup(MonoError* error); - - [LinkName(.C)] - public static extern mono_bool mono_error_ok(MonoError* error); - - [LinkName(.C)] - public static extern char8* mono_error_get_message(MonoError* error); - - [LinkName(.C)] - public static extern void mono_debug_init(DebugFormat debugFormat); - - [LinkName(.C)] - public static extern void mono_debug_domain_create(MonoDomain* domain); - - [LinkName(.C)] - public static extern void mono_debug_domain_unload(MonoDomain* domain); - - [LinkName(.C)] - public static extern void mono_debug_open_image_from_memory(MonoImage *image, uint8* raw_contents, int32 size); - - [LinkName(.C)] - public static extern void mono_thread_set_main(MonoThread* thread); - - [LinkName(.C)] - public static extern MonoThread* mono_thread_current(); - -#region Property - - [LinkName(.C)] - public static extern MonoProperty* mono_class_get_property_from_name(MonoClass *klass, char8* name); - - [LinkName(.C)] - public static extern void mono_property_set_value(MonoProperty *prop, void *obj, void **@params, MonoObject **exc); - - [LinkName(.C)] - public static extern MonoObject* mono_property_get_value(MonoProperty *prop, void *obj, void** @params, MonoObject** exc); - -#endregion - -#region Exception - - [LinkName(.C), NoReturn] - public static extern void mono_raise_exception(MonoException *ex); - - [LinkName(.C)] - public static extern char8* mono_exception_get_managed_backtrace(MonoException* exc); - - [LinkName(.C)] - public static extern MonoException* mono_exception_from_name_msg(MonoImage *image, char8* name_space, char8* name, char8* msg); - - [LinkName(.C)] - public static extern MonoException* mono_get_exception_argument(char8* arg, char8* msg); - - [LinkName(.C)] - public static extern MonoException* mono_get_exception_invalid_operation(char8* msg); - - [LinkName(.C)] - public static extern MonoException* mono_get_exception_not_implemented(char8* msg); - -#endregion - - [LinkName(.C)] - public static extern MonoClass* mono_object_get_class(MonoObject* obj); - - - [LinkName(.C)] - public static extern mono_bool mono_class_is_enum(MonoClass* @class); - - - [LinkName(.C)] - public static extern MonoVTable* mono_class_vtable(MonoDomain* domain, MonoClass* @class); - - - [LinkName(.C)] - public static extern MonoObject* mono_value_box(MonoDomain* domain, MonoClass* klass, gpointer value); - -#region MonoArray - - typealias uintptr_t = uint; - typealias intptr_t = int; - - [LinkName(.C)] - public static extern MonoArray* mono_array_new(MonoDomain *domain, MonoClass *eclass, uintptr_t length); - - [LinkName(.C)] - public static extern MonoArray* mono_array_new_checked(MonoDomain *domain, MonoClass *eclass, uintptr_t length, MonoError *error); - - [LinkName(.C)] - public static extern MonoArray* mono_array_new_full(MonoDomain *domain, MonoClass *array_class, uintptr_t* lengths, uintptr_t* lower_bounds); - - [LinkName(.C)] - public static extern MonoArray* mono_array_new_full_checked(MonoDomain *domain, MonoClass *array_class, uintptr_t* lengths, uintptr_t* lower_bounds, MonoError *error); - - [LinkName(.C)] - public static extern void mono_array_full_copy(MonoArray* src, MonoArray* dest); - - [LinkName(.C)] - public static extern MonoArray* mono_array_clone(MonoArray* array); - - [LinkName(.C)] - public static extern MonoArray* mono_array_clone_checked(MonoArray* array, MonoError* error); - - [LinkName(.C)] - public static extern void* mono_array_addr_with_size(MonoArray *array, int32 size, uintptr_t idx); - - [LinkName(.C)] - public static extern uintptr_t mono_array_length(MonoArray *array); - - [Inline] - public static T* mono_array_addr(MonoArray* array, uintptr_t index) - { - return (T*)mono_array_addr_with_size(array, sizeof(T), index); - } - - [Inline] - public static T mono_array_get(MonoArray* array, uintptr_t index) - { - return *mono_array_addr(array, index); - } - - [Inline] - public static void mono_array_set(MonoArray* array, uintptr_t index, T value) - { - T* entryPtr = mono_array_addr(array, index); - *entryPtr = value; - } - -#endregion - -#region DebugHelpers - - [LinkName(.C)] - public static extern MonoMethod* mono_method_desc_search_in_class(MonoMethodDesc* desc, MonoClass* klass); - - [LinkName(.C)] - public static extern MonoMethodDesc* mono_method_desc_new(char8* name, mono_bool include_namespace); - - [LinkName(.C)] - public static extern void mono_method_desc_free(MonoMethodDesc* decs); - -#endregion -} - -struct MonoMethodDesc; - -struct MonoDomain; - -struct MonoAssembly; - -struct MonoImage; - -struct MonoTableInfo; - -struct MonoString; - -struct MonoClass; - -struct MonoObject; - -struct MonoMethod; - -struct MonoMethodSignature; - -struct MonoProperty; - -struct MonoThread; - -struct MonoVTable; - -struct MonoArray; - -struct MonoException -{ - void* _bla; - void* _bla2; - void* _bla3; - public MonoString* Message; -} - -struct MonoClassField; - -struct MonoType; - -struct MonoError -{ - private uint32 bla; - private void*[12] bla2; -} - -struct MonoReflectionType; - -struct MonoCustomAttrInfo; - -enum MonoImageOpenStatus -{ - Ok, - Error_Errno, - MissingAssemblyRef, - ImageInvalid -} - -enum SOME_RANDOM_ENUM{ - MONO_TYPEDEF_FLAGS, - MONO_TYPEDEF_NAME, - MONO_TYPEDEF_NAMESPACE, - MONO_TYPEDEF_EXTENDS, - MONO_TYPEDEF_FIELD_LIST, - MONO_TYPEDEF_METHOD_LIST, - MONO_TYPEDEF_SIZE -} - -enum FIELD_TABLE_FLAGS : uint32 -{ - MONO_FIELD_FLAGS, - MONO_FIELD_NAME, - MONO_FIELD_SIGNATURE, - MONO_FIELD_SIZE -} - -enum MonoMetaTableEnum : int32 -{ - MONO_TABLE_MODULE, - MONO_TABLE_TYPEREF, - MONO_TABLE_TYPEDEF, - MONO_TABLE_FIELD_POINTER, - MONO_TABLE_FIELD, - MONO_TABLE_METHOD_POINTER, - MONO_TABLE_METHOD, - MONO_TABLE_PARAM_POINTER, - MONO_TABLE_PARAM, - MONO_TABLE_INTERFACEIMPL, - MONO_TABLE_MEMBERREF, /* 0xa */ - MONO_TABLE_CONSTANT, - MONO_TABLE_CUSTOMATTRIBUTE, - MONO_TABLE_FIELDMARSHAL, - MONO_TABLE_DECLSECURITY, - MONO_TABLE_CLASSLAYOUT, - MONO_TABLE_FIELDLAYOUT, /* 0x10 */ - MONO_TABLE_STANDALONESIG, - MONO_TABLE_EVENTMAP, - MONO_TABLE_EVENT_POINTER, - MONO_TABLE_EVENT, - MONO_TABLE_PROPERTYMAP, - MONO_TABLE_PROPERTY_POINTER, - MONO_TABLE_PROPERTY, - MONO_TABLE_METHODSEMANTICS, - MONO_TABLE_METHODIMPL, - MONO_TABLE_MODULEREF, /* 0x1a */ - MONO_TABLE_TYPESPEC, - MONO_TABLE_IMPLMAP, - MONO_TABLE_FIELDRVA, - MONO_TABLE_ENCLOG, - MONO_TABLE_ENCMAP, - MONO_TABLE_ASSEMBLY, /* 0x20 */ - MONO_TABLE_ASSEMBLYPROCESSOR, - MONO_TABLE_ASSEMBLYOS, - MONO_TABLE_ASSEMBLYREF, - MONO_TABLE_ASSEMBLYREFPROCESSOR, - MONO_TABLE_ASSEMBLYREFOS, - MONO_TABLE_FILE, - MONO_TABLE_EXPORTEDTYPE, - MONO_TABLE_MANIFESTRESOURCE, - MONO_TABLE_NESTEDCLASS, - MONO_TABLE_GENERICPARAM, /* 0x2a */ - MONO_TABLE_METHODSPEC, - MONO_TABLE_GENERICPARAMCONSTRAINT, - MONO_TABLE_UNUSED8, - MONO_TABLE_UNUSED9, - MONO_TABLE_UNUSED10, - /* Portable PDB tables */ - MONO_TABLE_DOCUMENT, /* 0x30 */ - MONO_TABLE_METHODBODY, - MONO_TABLE_LOCALSCOPE, - MONO_TABLE_LOCALVARIABLE, - MONO_TABLE_LOCALCONSTANT, - MONO_TABLE_IMPORTSCOPE, - MONO_TABLE_STATEMACHINEMETHOD, - MONO_TABLE_CUSTOMDEBUGINFORMATION - -//#define MONO_TABLE_LAST MONO_TABLE_CUSTOMDEBUGINFORMATION -//#define MONO_TABLE_NUM (MONO_TABLE_LAST + 1) - -} - -enum DebugFormat : uint32 -{ - None, - Mono, - /** Deprecated, the mdb debugger is not longer supported. */ - Debugger -} - -enum FieldAttribute -{ - FieldAccessMask = 0x0007, - CompilerControlled = 0x0000, - Private = 0x0001, - FamAndAssem = 0x0002, - Assembly = 0x0003, - Family = 0x0004, - FamOrAssem = 0x0005, - Public = 0x0006, - Static = 0x0010, - InitOnly = 0x0020, - Literal = 0x0040, - NotSerialized = 0x0080, - SpecialName = 0x0200, - PinvokeImpl = 0x2000, - /** For runtime use only */ - ReservedMask = 0x9500, - /** For runtime use only */ - RtSpecialName = 0x0400, - /** For runtime use only */ - HasFieldMarshal = 0x1000, - /** For runtime use only */ - HasDefault = 0x8000, - /** For runtime use only */ - HasFieldRva = 0x0100 -} - -enum MonoTypeEnum : int32 -{ - End = 0x00, /* End of List */ - Void = 0x01, - Boolean = 0x02, - Char = 0x03, - I1 = 0x04, - U1 = 0x05, - I2 = 0x06, - U2 = 0x07, - I4 = 0x08, - U4 = 0x09, - I8 = 0x0a, - U8 = 0x0b, - R4 = 0x0c, - R8 = 0x0d, - String = 0x0e, - Ptr = 0x0f, /* arg: token */ - Byref = 0x10, /* arg: token */ - Valuetype = 0x11, /* arg: token */ - Class = 0x12, /* arg: token */ - Var = 0x13, /* number */ - Array = 0x14, /* type, rank, boundsCount, bound1, loCount, lo1 */ - Genericinst = 0x15, /* \x{2026} */ - Typedbyref = 0x16, - I = 0x18, - U = 0x19, - Fnptr = 0x1b, /* arg: full method signature */ - Object = 0x1c, - SzArray = 0x1d, /* 0-based one-dim-array */ - Mvar = 0x1e, /* number */ - CmodReqd = 0x1f, /* arg: typedef or typeref token */ - CmodOpt = 0x20, /* optional arg: typedef or typref token */ - Internal = 0x21, /* CLR internal type */ - Modifier = 0x40, /* Or with the following types */ - Sentinel = 0x41, /* Sentinel for varargs method signature */ - Pinned = 0x45, /* Local var that points to pinned object */ - Enum = 0x55 /* an enumeration */ -}