#include <mono/metadata/metadata.h>
#include <mono/metadata/class.h>
#include <mono/metadata/object.h>
+#include <mono/utils/mono-hash.h>
typedef struct {
- char *name;
+ GHashTable *hash;
char *data;
guint32 alloc_size; /* malloced bytes */
guint32 index;
guint32 next_idx;
} MonoDynamicTable;
-typedef struct {
- GHashTable *hash;
- char *data;
- guint32 index;
- guint32 alloc_size;
- guint32 offset; /* from start of metadata */
-} MonoStringHeap;
-
/*
* The followinbg structure must match the C# implementation in our corlib.
*/
-typedef struct {
+struct _MonoReflectionMethod {
MonoObject object;
- MonoType *type;
-} MonoReflectionType;
+ MonoMethod *method;
+};
typedef struct {
MonoObject object;
- MonoMethod *method;
-} MonoReflectionMethod;
+ MonoObject *target_type;
+ MonoObject *target;
+ MonoString *method_name;
+ gpointer method_ptr;
+ gpointer delegate_trampoline;
+ MonoReflectionMethod *method_info;
+} MonoDelegate;
+
+typedef struct _MonoMulticastDelegate MonoMulticastDelegate;
+struct _MonoMulticastDelegate {
+ MonoDelegate delegate;
+ MonoMulticastDelegate *prev;
+};
typedef struct {
MonoObject object;
MonoProperty *property;
} MonoReflectionProperty;
+typedef struct {
+ MonoObject object;
+ MonoClass *klass;
+ MonoEvent *event;
+} MonoReflectionEvent;
+
typedef struct {
MonoObject object;
MonoReflectionType *ClassImpl;
guint32 AttrsImpl;
} MonoReflectionParameter;
+typedef struct {
+ MonoObject object;
+ MonoAssembly *assembly;
+} MonoReflectionAssembly;
+
typedef struct {
MonoReflectionType *utype;
MonoArray *values;
MonoString *name_space;
MonoReflectionType *parent;
MonoReflectionType *etype;
- MonoArray *interfaces;
- MonoAssembly *assembly;
+ MonoReflectionAssembly *assembly;
guint32 attrs;
guint32 rank;
+ MonoBoolean isbyref, ispointer, isprimitive;
} MonoTypeInfo;
+typedef struct {
+ MonoObject *member;
+ gint32 code_pos;
+} MonoReflectionILTokenInfo;
+
typedef struct {
MonoObject object;
MonoArray *code;
gint32 cur_stack;
MonoArray *locals;
MonoArray *ex_handlers;
+ gint32 num_token_fixups;
+ MonoArray *token_fixups;
} MonoReflectionILGen;
typedef struct {
MonoArray *handlers;
gint32 start;
gint32 len;
+ gint32 label;
} MonoILExceptionInfo;
typedef struct {
MonoObject object;
MonoObject* methodb;
MonoString *name;
+ MonoArray *cattrs;
guint32 attrs;
int position;
guint32 table_idx;
guint32 call_conv;
MonoObject *type;
MonoArray *pinfo;
+ MonoArray *cattrs;
} MonoReflectionCtorBuilder;
typedef struct {
MonoReflectionILGen *ilgen;
MonoObject *type;
MonoArray *pinfo;
+ MonoArray *cattrs;
MonoReflectionMethod *override_method;
MonoString *dll;
MonoString *dllentry;
guint32 text_rva;
guint32 metadata_rva;
GHashTable *typeref;
- MonoStringHeap sheap;
+ GHashTable *handleref;
+ MonoGHashTable *token_fixups;
+ MonoDynamicStream sheap;
MonoDynamicStream code; /* used to store method headers and bytecode */
MonoDynamicStream us;
MonoDynamicStream blob;
MonoDynamicTable tables [64];
} MonoDynamicAssembly;
-typedef struct {
- MonoObject object;
- MonoAssembly *assembly;
-} MonoReflectionAssembly;
-
typedef struct {
MonoReflectionAssembly assembly;
MonoDynamicAssembly *dynamic_assembly;
MonoReflectionMethodBuilder *entry_point;
MonoArray *modules;
MonoString *name;
+ MonoString *dir;
+ MonoArray *cattrs;
} MonoReflectionAssemblyBuilder;
typedef struct {
gint32 table_idx;
MonoReflectionType *typeb;
MonoArray *rva_data;
+ MonoArray *cattrs;
} MonoReflectionFieldBuilder;
typedef struct {
MonoString *name;
MonoReflectionType *type;
MonoArray *parameters;
+ MonoArray *cattrs;
MonoObject *def_value;
MonoReflectionMethodBuilder *set_method;
MonoReflectionMethodBuilder *get_method;
typedef struct {
MonoReflectionModule module;
MonoArray *types;
+ MonoArray *cattrs;
+ MonoArray *guid;
guint32 table_idx;
+ MonoReflectionAssemblyBuilder *assemblyb;
} MonoReflectionModuleBuilder;
typedef struct {
MonoArray *ctors;
MonoArray *properties;
MonoArray *fields;
+ MonoArray *events;
+ MonoArray *cattrs;
MonoArray *subtypes;
guint32 attrs;
guint32 table_idx;
MonoObject *version;
} MonoReflectionAssemblyName;
+typedef struct {
+ MonoObject obj;
+ MonoString *name;
+ MonoReflectionType *type;
+ MonoReflectionTypeBuilder *typeb;
+ MonoArray *cattrs;
+ MonoReflectionMethodBuilder *add_method;
+ MonoReflectionMethodBuilder *remove_method;
+ MonoReflectionMethodBuilder *raise_method;
+ MonoArray *other_methods;
+ guint32 attrs;
+ guint32 table_idx;
+} MonoReflectionEventBuilder;
+
+typedef struct {
+ MonoObject obj;
+ MonoReflectionMethod *ctor;
+ MonoArray *data;
+} MonoReflectionCustomAttr;
+
typedef struct {
char *nest_name_space;
char *nest_name;
char *name_space;
char *name;
char *assembly;
- int rank; /* we may need more info than this */
- int isbyref;
- int ispointer;
+ GList *modifiers; /* 0 -> byref, -1 -> pointer, > 0 -> array rank */
} MonoTypeNameParse;
+typedef struct {
+ MonoObject object;
+ MonoReflectionModuleBuilder *module;
+ MonoArray *arguments;
+ guint32 type;
+} MonoReflectionSigHelper;
+
+
+
+char* mono_type_get_name (MonoType *type);
int mono_reflection_parse_type (char *name, MonoTypeNameParse *info);
+MonoType* mono_reflection_get_type (MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase);
int mono_image_get_header (MonoReflectionAssemblyBuilder *assembly, char *buffer, int maxsize);
void mono_image_basic_init (MonoReflectionAssemblyBuilder *assembly);
guint32 mono_image_insert_string (MonoReflectionAssemblyBuilder *assembly, MonoString *str);
-guint32 mono_image_create_token (MonoReflectionAssemblyBuilder *assembly, MonoObject *obj);
+guint32 mono_image_create_token (MonoDynamicAssembly *assembly, MonoObject *obj);
MonoReflectionAssembly* mono_assembly_get_object (MonoDomain *domain, MonoAssembly *assembly);
MonoReflectionType* mono_type_get_object (MonoDomain *domain, MonoType *type);
MonoReflectionMethod* mono_method_get_object (MonoDomain *domain, MonoMethod *method);
MonoReflectionField* mono_field_get_object (MonoDomain *domain, MonoClass *klass, MonoClassField *field);
MonoReflectionProperty* mono_property_get_object (MonoDomain *domain, MonoClass *klass, MonoProperty *property);
+MonoReflectionEvent* mono_event_get_object (MonoDomain *domain, MonoClass *klass, MonoEvent *event);
/* note: this one is slightly different: we keep the whole array of params in the cache */
MonoReflectionParameter** mono_param_get_objects (MonoDomain *domain, MonoMethod *method);
+MonoArray* mono_reflection_get_custom_attrs (MonoObject *obj);
+MonoArray* mono_reflection_get_custom_attrs_blob (MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *porpValues, MonoArray *fields, MonoArray* fieldValues);
+
+void mono_reflection_setup_internal_class (MonoReflectionTypeBuilder *tb);
+
+MonoArray *mono_reflection_sighelper_get_signature_local (MonoReflectionSigHelper *sig);
+
+MonoArray *mono_reflection_sighelper_get_signature_field (MonoReflectionSigHelper *sig);
+
#endif /* __METADATA_REFLECTION_H__ */