New tests.
[mono.git] / mono / metadata / metadata-internals.h
index 7571b1171985a4279b2b655fa5d58b2493809482..9fa06f0446ca323c5198aec79510381af9866f3d 100644 (file)
 #include "mono/utils/mono-value-hash.h"
 #include <mono/utils/mono-error.h>
 
+struct _MonoType {
+       union {
+               MonoClass *klass; /* for VALUETYPE and CLASS */
+               MonoType *type;   /* for PTR */
+               MonoArrayType *array; /* for ARRAY */
+               MonoMethodSignature *method;
+               MonoGenericParam *generic_param; /* for VAR and MVAR */
+               MonoGenericClass *generic_class; /* for GENERICINST */
+       } data;
+       unsigned int attrs    : 16; /* param attributes or field flags */
+       MonoTypeEnum type     : 8;
+       unsigned int num_mods : 6;  /* max 64 modifiers follow at the end */
+       unsigned int byref    : 1;
+       unsigned int pinned   : 1;  /* valid when included in a local var signature */
+       MonoCustomMod modifiers [MONO_ZERO_LEN_ARRAY]; /* this may grow */
+};
+
+#define MONO_SIZEOF_TYPE (offsetof (struct _MonoType, modifiers))
+
 #define MONO_SECMAN_FLAG_INIT(x)               (x & 0x2)
 #define MONO_SECMAN_FLAG_GET_VALUE(x)          (x & 0x1)
 #define MONO_SECMAN_FLAG_SET_VALUE(x,y)                do { x = ((y) ? 0x3 : 0x2); } while (0)
@@ -413,9 +432,14 @@ typedef struct _MonoAssemblyBindingInfo {
 } MonoAssemblyBindingInfo;
 
 struct _MonoMethodHeader {
-       guint32      code_size;
        const unsigned char  *code;
-       guint16      max_stack;
+#ifdef MONO_SMALL_CONFIG
+       guint16      code_size;
+#else
+       guint32      code_size;
+#endif
+       guint16      max_stack   : 15;
+       unsigned int is_transient: 1; /* mono_metadata_free_mh () will actually free this header */
        unsigned int num_clauses : 15;
        /* if num_locals != 0, then the following apply: */
        unsigned int init_locals : 1;
@@ -432,17 +456,22 @@ typedef struct {
 #define MONO_SIZEOF_METHOD_HEADER (sizeof (struct _MonoMethodHeader) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
 
 struct _MonoMethodSignature {
-       unsigned int  hasthis : 1;
-       unsigned int  explicit_this   : 1;
-       unsigned int  call_convention : 6;
-       unsigned int  pinvoke   : 1;
-       unsigned int  ref_count : 23;
+       MonoType     *ret;
+#ifdef MONO_SMALL_CONFIG
+       guint8        param_count;
+       gint8         sentinelpos;
+       unsigned int  generic_param_count : 5;
+#else
        guint16       param_count;
        gint16        sentinelpos;
-       unsigned int  generic_param_count : 30;
+       unsigned int  generic_param_count : 16;
+#endif
+       unsigned int  call_convention     : 6;
+       unsigned int  hasthis             : 1;
+       unsigned int  explicit_this       : 1;
+       unsigned int  pinvoke             : 1;
        unsigned int  is_inflated         : 1;
        unsigned int  has_type_parameters : 1;
-       MonoType     *ret;
        MonoType     *params [MONO_ZERO_LEN_ARRAY];
 };
 
@@ -490,6 +519,10 @@ mono_image_close_except_pools (MonoImage *image) MONO_INTERNAL;
 void
 mono_image_close_finish (MonoImage *image) MONO_INTERNAL;
 
+typedef void  (*MonoImageUnloadFunc) (MonoImage *image, gpointer user_data);
+
+void
+mono_install_image_unload_hook (MonoImageUnloadFunc func, gpointer user_data) MONO_INTERNAL;
 
 MonoType*
 mono_metadata_get_shared_type (MonoType *type) MONO_INTERNAL;
@@ -588,6 +621,8 @@ void mono_assembly_close_finish (MonoAssembly *assembly) MONO_INTERNAL;
 gboolean mono_public_tokens_are_equal (const unsigned char *pubt1, const unsigned char *pubt2) MONO_INTERNAL;
 
 void mono_config_parse_publisher_policy (const char *filename, MonoAssemblyBindingInfo *binding_info) MONO_INTERNAL;
+void mono_config_parse_assembly_bindings (const char *filename, int major, int minor, void *user_data,
+                                         void (*infocb)(MonoAssemblyBindingInfo *info, void *user_data)) MONO_INTERNAL;
 
 gboolean
 mono_assembly_name_parse_full               (const char           *name,
@@ -652,5 +687,9 @@ void mono_image_load_names (MonoImage *image) MONO_INTERNAL;
 
 MonoImage *mono_image_open_raw (const char *fname, MonoImageOpenStatus *status) MONO_INTERNAL;
 
+MonoException *mono_get_exception_field_access_msg (const char *msg) MONO_INTERNAL;
+
+MonoException *mono_get_exception_method_access_msg (const char *msg) MONO_INTERNAL;
+
 #endif /* __MONO_METADATA_INTERNALS_H__ */