2009-09-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
[mono.git] / mono / metadata / reflection.h
index 6d835ebe721813fa515d97ce7bdde73767aca562..801c6a07ab978355c54a2edd887294a7ed83e8a3 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <mono/metadata/object.h>
 
+G_BEGIN_DECLS
+
 typedef struct MonoTypeNameParse MonoTypeNameParse;
 
 struct MonoTypeNameParse {
@@ -10,6 +12,7 @@ struct MonoTypeNameParse {
        char *name;
        MonoAssemblyName assembly;
        GList *modifiers; /* 0 -> byref, -1 -> pointer, > 0 -> array rank */
+       GPtrArray *type_arguments;
        GList *nested;
 };
 
@@ -26,6 +29,8 @@ typedef struct {
        MonoCustomAttrEntry attrs [MONO_ZERO_LEN_ARRAY];
 } MonoCustomAttrInfo;
 
+#define MONO_SIZEOF_CUSTOM_ATTR_INFO (offsetof (MonoCustomAttrInfo, attrs))
+
 /* 
  * Information which isn't in the MonoMethod structure is stored here for
  * dynamic methods.
@@ -35,6 +40,7 @@ typedef struct {
        MonoMarshalSpec **param_marshall;
        MonoCustomAttrInfo **param_cattr;
        guint8** param_defaults;
+       guint32 *param_default_types;
        char *dllentry, *dll;
 } MonoReflectionMethodAux;
 
@@ -46,6 +52,7 @@ typedef enum {
 
 int           mono_reflection_parse_type (char *name, MonoTypeNameParse *info);
 MonoType*     mono_reflection_get_type   (MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve);
+void          mono_reflection_free_type_info (MonoTypeNameParse *info);
 MonoType*     mono_reflection_type_from_name (char *name, MonoImage *image);
 guint32       mono_reflection_get_token (MonoObject *obj);
 
@@ -60,9 +67,12 @@ MonoReflectionEvent*    mono_event_get_object    (MonoDomain *domain, MonoClass
 /* note: this one is slightly different: we keep the whole array of params in the cache */
 MonoArray* mono_param_get_objects  (MonoDomain *domain, MonoMethod *method);
 MonoReflectionMethodBody* mono_method_body_get_object (MonoDomain *domain, MonoMethod *method);
-MonoObject* mono_get_dbnull_object (MonoDomain *domain);
 
+MonoObject *mono_get_dbnull_object (MonoDomain *domain);
+
+MonoArray*  mono_reflection_get_custom_attrs_by_type (MonoObject *obj, MonoClass *attr_klass);
 MonoArray*  mono_reflection_get_custom_attrs (MonoObject *obj);
+MonoArray*  mono_reflection_get_custom_attrs_data (MonoObject *obj);
 MonoArray*  mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *porpValues, MonoArray *fields, MonoArray* fieldValues);
 
 MonoCustomAttrInfo* mono_reflection_get_custom_attrs_info (MonoObject *obj);
@@ -123,12 +133,14 @@ typedef struct {
 } MonoDeclSecurityActions;
 
 MonoBoolean mono_declsec_get_demands (MonoMethod *callee, MonoDeclSecurityActions* demands);
-MonoBoolean mono_declsec_get_linkdemands (MonoMethod *callee, MonoDeclSecurityActions* klass, MonoDeclSecurityActions* method);
-MonoBoolean mono_declsec_get_inheritdemands_class (MonoMethod *callee, MonoDeclSecurityActions* klass);
-MonoBoolean mono_declsec_get_inheritdemands_method (MonoMethod *callee, MonoDeclSecurityActions* cmethod);
+MonoBoolean mono_declsec_get_linkdemands (MonoMethod *callee, MonoDeclSecurityActions* klass, MonoDeclSecurityActions* cmethod);
+MonoBoolean mono_declsec_get_inheritdemands_class (MonoClass *klass, MonoDeclSecurityActions* demands);
+MonoBoolean mono_declsec_get_inheritdemands_method (MonoMethod *callee, MonoDeclSecurityActions* demands);
 
 MonoBoolean mono_declsec_get_method_action (MonoMethod *method, guint32 action, MonoDeclSecurityEntry *entry);
 MonoBoolean mono_declsec_get_class_action (MonoClass *klass, guint32 action, MonoDeclSecurityEntry *entry);
 MonoBoolean mono_declsec_get_assembly_action (MonoAssembly *assembly, guint32 action, MonoDeclSecurityEntry *entry);
 
+G_END_DECLS
+
 #endif /* __METADATA_REFLECTION_H__ */