ndle static methods with bound first arg.
[mono.git] / mono / metadata / metadata-internals.h
1
2 #ifndef __MONO_METADATA_INTERNALS_H__
3 #define __MONO_METADATA_INTERNALS_H__
4
5 #include "mono/metadata/image.h"
6 #include "mono/metadata/blob.h"
7 #include "mono/metadata/mempool.h"
8 #include "mono/metadata/domain-internals.h"
9 #include "mono/metadata/mono-hash.h"
10 #include "mono/utils/mono-compiler.h"
11 #include "mono/utils/mono-dl.h"
12 #include "mono/utils/monobitset.h"
13 #include "mono/utils/mono-property-hash.h"
14 #include "mono/utils/mono-value-hash.h"
15 #include <mono/utils/mono-error.h>
16
17 struct _MonoType {
18         union {
19                 MonoClass *klass; /* for VALUETYPE and CLASS */
20                 MonoType *type;   /* for PTR */
21                 MonoArrayType *array; /* for ARRAY */
22                 MonoMethodSignature *method;
23                 MonoGenericParam *generic_param; /* for VAR and MVAR */
24                 MonoGenericClass *generic_class; /* for GENERICINST */
25         } data;
26         unsigned int attrs    : 16; /* param attributes or field flags */
27         MonoTypeEnum type     : 8;
28         unsigned int num_mods : 6;  /* max 64 modifiers follow at the end */
29         unsigned int byref    : 1;
30         unsigned int pinned   : 1;  /* valid when included in a local var signature */
31         MonoCustomMod modifiers [MONO_ZERO_LEN_ARRAY]; /* this may grow */
32 };
33
34 #define MONO_SIZEOF_TYPE (offsetof (struct _MonoType, modifiers))
35
36 #define MONO_SECMAN_FLAG_INIT(x)                (x & 0x2)
37 #define MONO_SECMAN_FLAG_GET_VALUE(x)           (x & 0x1)
38 #define MONO_SECMAN_FLAG_SET_VALUE(x,y)         do { x = ((y) ? 0x3 : 0x2); } while (0)
39
40 #define MONO_PUBLIC_KEY_TOKEN_LENGTH    17
41
42 struct _MonoAssemblyName {
43         const char *name;
44         const char *culture;
45         const char *hash_value;
46         const mono_byte* public_key;
47         // string of 16 hex chars + 1 NULL
48         mono_byte public_key_token [MONO_PUBLIC_KEY_TOKEN_LENGTH];
49         uint32_t hash_alg;
50         uint32_t hash_len;
51         uint32_t flags;
52         uint16_t major, minor, build, revision;
53 };
54
55 struct MonoTypeNameParse {
56         char *name_space;
57         char *name;
58         MonoAssemblyName assembly;
59         GList *modifiers; /* 0 -> byref, -1 -> pointer, > 0 -> array rank */
60         GPtrArray *type_arguments;
61         GList *nested;
62 };
63
64 struct _MonoAssembly {
65         /* 
66          * The number of appdomains which have this assembly loaded plus the number of 
67          * assemblies referencing this assembly through an entry in their image->references
68          * arrays. The later is needed because entries in the image->references array
69          * might point to assemblies which are only loaded in some appdomains, and without
70          * the additional reference, they can be freed at any time.
71          * The ref_count is initially 0.
72          */
73         int ref_count; /* use atomic operations only */
74         char *basedir;
75         MonoAssemblyName aname;
76         MonoImage *image;
77         GSList *friend_assembly_names; /* Computed by mono_assembly_load_friends () */
78         guint8 friend_assembly_names_inited;
79         guint8 in_gac;
80         guint8 dynamic;
81         guint8 corlib_internal;
82         gboolean ref_only;
83         guint8 wrap_non_exception_throws;
84         guint8 wrap_non_exception_throws_inited;
85         /* security manager flags (one bit is for lazy initialization) */
86         guint32 ecma:2;         /* Has the ECMA key */
87         guint32 aptc:2;         /* Has the [AllowPartiallyTrustedCallers] attributes */
88         guint32 fulltrust:2;    /* Has FullTrust permission */
89         guint32 unmanaged:2;    /* Has SecurityPermissionFlag.UnmanagedCode permission */
90         guint32 skipverification:2;     /* Has SecurityPermissionFlag.SkipVerification permission */
91 };
92
93 typedef struct {
94         const char* data;
95         guint32  size;
96 } MonoStreamHeader;
97
98 struct _MonoTableInfo {
99         const char *base;
100         guint       rows     : 24;
101         guint       row_size : 8;
102
103         /*
104          * Tables contain up to 9 columns and the possible sizes of the
105          * fields in the documentation are 1, 2 and 4 bytes.  So we
106          * can encode in 2 bits the size.
107          *
108          * A 32 bit value can encode the resulting size
109          *
110          * The top eight bits encode the number of columns in the table.
111          * we only need 4, but 8 is aligned no shift required. 
112          */
113         guint32   size_bitfield;
114 };
115
116 #define REFERENCE_MISSING ((gpointer) -1)
117
118 typedef struct _MonoDllMap MonoDllMap;
119
120 struct _MonoImage {
121         /*
122          * The number of assemblies which reference this MonoImage though their 'image'
123          * field plus the number of images which reference this MonoImage through their 
124          * 'modules' field, plus the number of threads holding temporary references to
125          * this image between calls of mono_image_open () and mono_image_close ().
126          */
127         int   ref_count;
128         void *raw_data_handle;
129         char *raw_data;
130         guint32 raw_data_len;
131         guint8 raw_buffer_used    : 1;
132         guint8 raw_data_allocated : 1;
133
134 #ifdef HOST_WIN32
135         /* Module was loaded using LoadLibrary. */
136         guint8 is_module_handle : 1;
137
138         /* Module entry point is _CorDllMain. */
139         guint8 has_entry_point : 1;
140 #endif
141
142         /* Whenever this is a dynamically emitted module */
143         guint8 dynamic : 1;
144
145         /* Whenever this is a reflection only image */
146         guint8 ref_only : 1;
147
148         /* Whenever this image contains uncompressed metadata */
149         guint8 uncompressed_metadata : 1;
150
151         guint8 checked_module_cctor : 1;
152         guint8 has_module_cctor : 1;
153
154         guint8 idx_string_wide : 1;
155         guint8 idx_guid_wide : 1;
156         guint8 idx_blob_wide : 1;
157
158         /* Whenever this image is considered as platform code for the CoreCLR security model */
159         guint8 core_clr_platform_code : 1;
160                             
161         char *name;
162         const char *assembly_name;
163         const char *module_name;
164         char *version;
165         gint16 md_version_major, md_version_minor;
166         char *guid;
167         void *image_info;
168         MonoMemPool         *mempool; /*protected by the image lock*/
169
170         char                *raw_metadata;
171                             
172         MonoStreamHeader     heap_strings;
173         MonoStreamHeader     heap_us;
174         MonoStreamHeader     heap_blob;
175         MonoStreamHeader     heap_guid;
176         MonoStreamHeader     heap_tables;
177                             
178         const char          *tables_base;
179
180         /**/
181         MonoTableInfo        tables [MONO_TABLE_NUM];
182
183         /*
184          * references is initialized only by using the mono_assembly_open
185          * function, and not by using the lowlevel mono_image_open.
186          *
187          * It is NULL terminated.
188          */
189         MonoAssembly **references;
190
191         MonoImage **modules;
192         guint32 module_count;
193         gboolean *modules_loaded;
194
195         MonoImage **files;
196
197         gpointer aot_module;
198
199         /*
200          * The Assembly this image was loaded from.
201          */
202         MonoAssembly *assembly;
203
204         /*
205          * Indexed by method tokens and typedef tokens.
206          */
207         GHashTable *method_cache; /*protected by the image lock*/
208         MonoInternalHashTable class_cache;
209
210         /* Indexed by memberref + methodspec tokens */
211         GHashTable *methodref_cache; /*protected by the image lock*/
212
213         /*
214          * Indexed by fielddef and memberref tokens
215          */
216         GHashTable *field_cache;
217
218         /* indexed by typespec tokens. */
219         GHashTable *typespec_cache;
220         /* indexed by token */
221         GHashTable *memberref_signatures;
222         GHashTable *helper_signatures;
223
224         /* Indexed by blob heap indexes */
225         GHashTable *method_signatures;
226
227         /*
228          * Indexes namespaces to hash tables that map class name to typedef token.
229          */
230         GHashTable *name_cache;  /*protected by the image lock*/
231
232         /*
233          * Indexed by MonoClass
234          */
235         GHashTable *array_cache;
236         GHashTable *ptr_cache;
237
238         GHashTable *szarray_cache;
239         /* This has a separate lock to improve scalability */
240         CRITICAL_SECTION szarray_cache_lock;
241
242         /*
243          * indexed by MonoMethodSignature 
244          */
245         GHashTable *delegate_begin_invoke_cache;
246         GHashTable *delegate_end_invoke_cache;
247         GHashTable *delegate_invoke_cache;
248         GHashTable *runtime_invoke_cache;
249
250         /*
251          * indexed by SignatureMethodPair
252          */
253         GHashTable *delegate_abstract_invoke_cache;
254
255         /*
256          * indexed by SignatureMethodPair
257          */
258         GHashTable *delegate_bound_static_invoke_cache;
259         /*
260          * indexed by MonoMethod pointers 
261          */
262         GHashTable *runtime_invoke_direct_cache;
263         GHashTable *runtime_invoke_vcall_cache;
264         GHashTable *managed_wrapper_cache;
265         GHashTable *native_wrapper_cache;
266         GHashTable *native_wrapper_aot_cache;
267         GHashTable *remoting_invoke_cache;
268         GHashTable *synchronized_cache;
269         GHashTable *unbox_wrapper_cache;
270         GHashTable *cominterop_invoke_cache;
271         GHashTable *cominterop_wrapper_cache; /* LOCKING: marshal lock */
272         GHashTable *thunk_invoke_cache;
273
274         /*
275          * indexed by MonoClass pointers
276          */
277         GHashTable *ldfld_wrapper_cache;
278         GHashTable *ldflda_wrapper_cache;
279         GHashTable *stfld_wrapper_cache;
280         GHashTable *isinst_cache;
281         GHashTable *castclass_cache;
282         GHashTable *proxy_isinst_cache;
283         GHashTable *rgctx_template_hash; /* LOCKING: templates lock */
284
285         /* Contains rarely used fields of runtime structures belonging to this image */
286         MonoPropertyHash *property_hash;
287
288         void *reflection_info;
289
290         /*
291          * user_info is a public field and is not touched by the
292          * metadata engine
293          */
294         void *user_info;
295
296         /* dll map entries */
297         MonoDllMap *dll_map;
298
299         /* interfaces IDs from this image */
300         MonoBitSet *interface_bitset;
301
302         /* when the image is being closed, this is abused as a list of
303            malloc'ed regions to be freed. */
304         GSList *reflection_info_unregister_classes;
305
306         /* List of image sets containing this image */
307         GSList *image_sets;
308
309         /*
310          * No other runtime locks must be taken while holding this lock.
311          * It's meant to be used only to mutate and query structures part of this image.
312          */
313         CRITICAL_SECTION    lock;
314 };
315
316 /*
317  * Generic instances depend on many images, and they need to be deleted if one
318  * of the images they depend on is unloaded. For example,
319  * List<Foo> depends on both List's image and Foo's image.
320  * A MonoImageSet is the owner of all generic instances depending on the same set of
321  * images.
322  */
323 typedef struct {
324         int nimages;
325         MonoImage **images;
326
327         GHashTable *gclass_cache, *ginst_cache, *gmethod_cache, *gsignature_cache;
328
329         CRITICAL_SECTION    lock;
330
331         /*
332          * Memory for generic instances owned by this image set should be allocated from
333          * this mempool, using the mono_image_set_alloc family of functions.
334          */
335         MonoMemPool         *mempool;
336 } MonoImageSet;
337
338 enum {
339         MONO_SECTION_TEXT,
340         MONO_SECTION_RSRC,
341         MONO_SECTION_RELOC,
342         MONO_SECTION_MAX
343 };
344
345 typedef struct {
346         GHashTable *hash;
347         char *data;
348         guint32 alloc_size; /* malloced bytes */
349         guint32 index;
350         guint32 offset; /* from start of metadata */
351 } MonoDynamicStream;
352
353 typedef struct {
354         guint32 alloc_rows;
355         guint32 rows;
356         guint8  row_size; /*  calculated later with column_sizes */
357         guint8  columns;
358         guint32 next_idx;
359         guint32 *values; /* rows * columns */
360 } MonoDynamicTable;
361
362 struct _MonoDynamicAssembly {
363         MonoAssembly assembly;
364         char *strong_name;
365         guint32 strong_name_size;
366         guint8 run;
367         guint8 save;
368         MonoDomain *domain;
369 };
370
371 struct _MonoDynamicImage {
372         MonoImage image;
373         guint32 meta_size;
374         guint32 text_rva;
375         guint32 metadata_rva;
376         guint32 image_base;
377         guint32 cli_header_offset;
378         guint32 iat_offset;
379         guint32 idt_offset;
380         guint32 ilt_offset;
381         guint32 imp_names_offset;
382         struct {
383                 guint32 rva;
384                 guint32 size;
385                 guint32 offset;
386                 guint32 attrs;
387         } sections [MONO_SECTION_MAX];
388         GHashTable *typespec;
389         GHashTable *typeref;
390         GHashTable *handleref;
391         MonoGHashTable *handleref_managed;
392         MonoGHashTable *tokens;
393         GHashTable *blob_cache;
394         GHashTable *standalonesig_cache;
395         GList *array_methods;
396         GPtrArray *gen_params;
397         MonoGHashTable *token_fixups;
398         GHashTable *method_to_table_idx;
399         GHashTable *field_to_table_idx;
400         GHashTable *method_aux_hash;
401         GHashTable *vararg_aux_hash;
402         MonoGHashTable *generic_def_objects;
403         MonoGHashTable *methodspec;
404         gboolean run;
405         gboolean save;
406         gboolean initial_image;
407         guint32 pe_kind, machine;
408         char *strong_name;
409         guint32 strong_name_size;
410         char *win32_res;
411         guint32 win32_res_size;
412         guint8 *public_key;
413         int public_key_len;
414         MonoDynamicStream sheap;
415         MonoDynamicStream code; /* used to store method headers and bytecode */
416         MonoDynamicStream resources; /* managed embedded resources */
417         MonoDynamicStream us;
418         MonoDynamicStream blob;
419         MonoDynamicStream tstream;
420         MonoDynamicStream guid;
421         MonoDynamicTable tables [MONO_TABLE_NUM];
422         MonoClass *wrappers_type; /*wrappers are bound to this type instead of <Module>*/
423 };
424
425 /* Contains information about assembly binding */
426 typedef struct _MonoAssemblyBindingInfo {
427         char *name;
428         char *culture;
429         guchar public_key_token [MONO_PUBLIC_KEY_TOKEN_LENGTH];
430         int major;
431         int minor;
432         AssemblyVersionSet old_version_bottom;
433         AssemblyVersionSet old_version_top;
434         AssemblyVersionSet new_version;
435         guint has_old_version_bottom : 1;
436         guint has_old_version_top : 1;
437         guint has_new_version : 1;
438         guint is_valid : 1;
439 } MonoAssemblyBindingInfo;
440
441 struct _MonoMethodHeader {
442         const unsigned char  *code;
443 #ifdef MONO_SMALL_CONFIG
444         guint16      code_size;
445 #else
446         guint32      code_size;
447 #endif
448         guint16      max_stack   : 15;
449         unsigned int is_transient: 1; /* mono_metadata_free_mh () will actually free this header */
450         unsigned int num_clauses : 15;
451         /* if num_locals != 0, then the following apply: */
452         unsigned int init_locals : 1;
453         guint16      num_locals;
454         MonoExceptionClause *clauses;
455         MonoType    *locals [MONO_ZERO_LEN_ARRAY];
456 };
457
458 typedef struct {
459         guint32      code_size;
460         gboolean     has_clauses;
461 } MonoMethodHeaderSummary;
462
463 #define MONO_SIZEOF_METHOD_HEADER (sizeof (struct _MonoMethodHeader) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
464
465 struct _MonoMethodSignature {
466         MonoType     *ret;
467 #ifdef MONO_SMALL_CONFIG
468         guint8        param_count;
469         gint8         sentinelpos;
470         unsigned int  generic_param_count : 5;
471 #else
472         guint16       param_count;
473         gint16        sentinelpos;
474         unsigned int  generic_param_count : 16;
475 #endif
476         unsigned int  call_convention     : 6;
477         unsigned int  hasthis             : 1;
478         unsigned int  explicit_this       : 1;
479         unsigned int  pinvoke             : 1;
480         unsigned int  is_inflated         : 1;
481         unsigned int  has_type_parameters : 1;
482         MonoType     *params [MONO_ZERO_LEN_ARRAY];
483 };
484
485 #define MONO_SIZEOF_METHOD_SIGNATURE (sizeof (struct _MonoMethodSignature) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P)
486
487 /* for use with allocated memory blocks (assumes alignment is to 8 bytes) */
488 guint mono_aligned_addr_hash (gconstpointer ptr) MONO_INTERNAL;
489
490 void
491 mono_image_check_for_module_cctor (MonoImage *image) MONO_INTERNAL;
492
493 gpointer
494 mono_image_alloc  (MonoImage *image, guint size) MONO_INTERNAL;
495
496 gpointer
497 mono_image_alloc0 (MonoImage *image, guint size) MONO_INTERNAL;
498
499 char*
500 mono_image_strdup (MonoImage *image, const char *s) MONO_INTERNAL;
501
502 GList*
503 g_list_prepend_image (MonoImage *image, GList *list, gpointer data) MONO_INTERNAL;
504
505 GSList*
506 g_slist_append_image (MonoImage *image, GSList *list, gpointer data) MONO_INTERNAL;
507
508 void
509 mono_image_lock (MonoImage *image) MONO_INTERNAL;
510
511 void
512 mono_image_unlock (MonoImage *image) MONO_INTERNAL;
513
514 gpointer
515 mono_image_property_lookup (MonoImage *image, gpointer subject, guint32 property) MONO_INTERNAL;
516
517 void
518 mono_image_property_insert (MonoImage *image, gpointer subject, guint32 property, gpointer value) MONO_INTERNAL;
519
520 void
521 mono_image_property_remove (MonoImage *image, gpointer subject) MONO_INTERNAL;
522
523 gboolean
524 mono_image_close_except_pools (MonoImage *image) MONO_INTERNAL;
525
526 void
527 mono_image_close_finish (MonoImage *image) MONO_INTERNAL;
528
529 typedef void  (*MonoImageUnloadFunc) (MonoImage *image, gpointer user_data);
530
531 void
532 mono_install_image_unload_hook (MonoImageUnloadFunc func, gpointer user_data) MONO_INTERNAL;
533
534 void
535 mono_remove_image_unload_hook (MonoImageUnloadFunc func, gpointer user_data) MONO_INTERNAL;
536
537 MonoType*
538 mono_metadata_get_shared_type (MonoType *type) MONO_INTERNAL;
539
540 GSList*
541 mono_metadata_clean_for_image (MonoImage *image) MONO_INTERNAL;
542
543 void
544 mono_metadata_clean_generic_classes_for_image (MonoImage *image) MONO_INTERNAL;
545
546 void
547 mono_metadata_cleanup (void);
548
549 const char *   mono_meta_table_name              (int table) MONO_INTERNAL;
550 void           mono_metadata_compute_table_bases (MonoImage *meta) MONO_INTERNAL;
551
552 gboolean
553 mono_metadata_interfaces_from_typedef_full  (MonoImage             *image,
554                                                                                          guint32                table_index,
555                                                                                          MonoClass           ***interfaces,
556                                                                                          guint                 *count,
557                                                                                          gboolean               heap_alloc_result,
558                                                                                          MonoGenericContext    *context) MONO_INTERNAL;
559
560 MonoArrayType *
561 mono_metadata_parse_array_full              (MonoImage             *image,
562                                              MonoGenericContainer  *container,
563                                              const char            *ptr,
564                                              const char           **rptr) MONO_INTERNAL;
565
566 MonoType *
567 mono_metadata_parse_type_full               (MonoImage             *image,
568                                              MonoGenericContainer  *container,
569                                              MonoParseTypeMode      mode,
570                                              short                  opt_attrs,
571                                              const char            *ptr,
572                                              const char           **rptr);
573
574 MonoMethodSignature *
575 mono_metadata_parse_signature_full          (MonoImage             *image,
576                                              MonoGenericContainer  *generic_container,
577                                              guint32                token) MONO_INTERNAL;
578
579 MonoMethodSignature *
580 mono_metadata_parse_method_signature_full   (MonoImage             *image,
581                                              MonoGenericContainer  *generic_container,
582                                              int                     def,
583                                              const char             *ptr,
584                                              const char            **rptr);
585
586 MonoMethodHeader *
587 mono_metadata_parse_mh_full                 (MonoImage             *image,
588                                              MonoGenericContainer  *container,
589                                              const char            *ptr);
590
591 gboolean
592 mono_method_get_header_summary (MonoMethod *method, MonoMethodHeaderSummary *summary) MONO_INTERNAL;
593
594 int* mono_metadata_get_param_attrs          (MonoImage *m, int def, int param_count) MONO_INTERNAL;
595 gboolean mono_metadata_method_has_param_attrs (MonoImage *m, int def) MONO_INTERNAL;
596
597 guint
598 mono_metadata_generic_context_hash          (const MonoGenericContext *context) MONO_INTERNAL;
599
600 gboolean
601 mono_metadata_generic_context_equal         (const MonoGenericContext *g1,
602                                              const MonoGenericContext *g2) MONO_INTERNAL;
603
604 MonoGenericInst *
605 mono_metadata_parse_generic_inst            (MonoImage             *image,
606                                              MonoGenericContainer  *container,
607                                              int                    count,
608                                              const char            *ptr,
609                                              const char           **rptr) MONO_INTERNAL;
610
611 MonoGenericInst *
612 mono_metadata_get_generic_inst              (int                    type_argc,
613                                              MonoType             **type_argv) MONO_INTERNAL;
614
615 MonoGenericClass *
616 mono_metadata_lookup_generic_class          (MonoClass             *gclass,
617                                              MonoGenericInst       *inst,
618                                              gboolean               is_dynamic) MONO_INTERNAL;
619
620 MonoGenericInst * mono_metadata_inflate_generic_inst  (MonoGenericInst *ginst, MonoGenericContext *context, MonoError *error) MONO_INTERNAL;
621
622 void mono_dynamic_stream_reset  (MonoDynamicStream* stream) MONO_INTERNAL;
623 void mono_assembly_addref       (MonoAssembly *assembly) MONO_INTERNAL;
624 void mono_assembly_load_friends (MonoAssembly* ass) MONO_INTERNAL;
625 gboolean mono_assembly_has_skip_verification (MonoAssembly* ass) MONO_INTERNAL;
626
627 gboolean mono_assembly_close_except_image_pools (MonoAssembly *assembly) MONO_INTERNAL;
628 void mono_assembly_close_finish (MonoAssembly *assembly) MONO_INTERNAL;
629
630
631 gboolean mono_public_tokens_are_equal (const unsigned char *pubt1, const unsigned char *pubt2) MONO_INTERNAL;
632
633 void mono_config_parse_publisher_policy (const char *filename, MonoAssemblyBindingInfo *binding_info) MONO_INTERNAL;
634 void mono_config_parse_assembly_bindings (const char *filename, int major, int minor, void *user_data,
635                                           void (*infocb)(MonoAssemblyBindingInfo *info, void *user_data)) MONO_INTERNAL;
636
637 gboolean
638 mono_assembly_name_parse_full                (const char           *name,
639                                               MonoAssemblyName     *aname,
640                                               gboolean save_public_key,
641                                               gboolean *is_version_defined,
642                                                   gboolean *is_token_defined) MONO_INTERNAL;
643
644 guint32 mono_metadata_get_generic_param_row (MonoImage *image, guint32 token, guint32 *owner);
645
646 void mono_unload_interface_ids (MonoBitSet *bitset) MONO_INTERNAL;
647
648
649 MonoType *mono_metadata_type_dup (MonoImage *image, const MonoType *original) MONO_INTERNAL;
650 MonoMethodSignature  *mono_metadata_signature_dup_full (MonoImage *image,MonoMethodSignature *sig) MONO_INTERNAL;
651 MonoMethodSignature  *mono_metadata_signature_dup_mempool (MonoMemPool *mp, MonoMethodSignature *sig) MONO_INTERNAL;
652
653 MonoGenericInst *
654 mono_get_shared_generic_inst (MonoGenericContainer *container) MONO_INTERNAL;
655
656 int
657 mono_type_stack_size_internal (MonoType *t, int *align, gboolean allow_open) MONO_INTERNAL;
658
659 void            mono_type_get_desc (GString *res, MonoType *type, mono_bool include_namespace);
660
661 gboolean
662 mono_metadata_type_equal_full (MonoType *t1, MonoType *t2, gboolean signature_only) MONO_INTERNAL;
663
664 MonoMarshalSpec *
665 mono_metadata_parse_marshal_spec_full (MonoImage *image, const char *ptr) MONO_INTERNAL;
666
667 guint          mono_metadata_generic_inst_hash (gconstpointer data) MONO_INTERNAL;
668 gboolean       mono_metadata_generic_inst_equal (gconstpointer ka, gconstpointer kb) MONO_INTERNAL;
669
670 void
671 mono_metadata_field_info_with_mempool (
672                                           MonoImage *meta, 
673                                       guint32       table_index,
674                                       guint32      *offset,
675                                       guint32      *rva,
676                                       MonoMarshalSpec **marshal_spec);
677
678 MonoClassField*
679 mono_metadata_get_corresponding_field_from_generic_type_definition (MonoClassField *field) MONO_INTERNAL;
680
681 MonoEvent*
682 mono_metadata_get_corresponding_event_from_generic_type_definition (MonoEvent *event) MONO_INTERNAL;
683
684 MonoProperty*
685 mono_metadata_get_corresponding_property_from_generic_type_definition (MonoProperty *property) MONO_INTERNAL;
686
687 guint32
688 mono_metadata_signature_size (MonoMethodSignature *sig) MONO_INTERNAL;
689
690 guint mono_metadata_str_hash (gconstpointer v1) MONO_INTERNAL;
691
692 gboolean mono_image_load_pe_data (MonoImage *image) MONO_INTERNAL;
693
694 gboolean mono_image_load_cli_data (MonoImage *image) MONO_INTERNAL;
695
696 void mono_image_load_names (MonoImage *image) MONO_INTERNAL;
697
698 MonoImage *mono_image_open_raw (const char *fname, MonoImageOpenStatus *status) MONO_INTERNAL;
699
700 MonoException *mono_get_exception_field_access_msg (const char *msg) MONO_INTERNAL;
701
702 MonoException *mono_get_exception_method_access_msg (const char *msg) MONO_INTERNAL;
703
704 #endif /* __MONO_METADATA_INTERNALS_H__ */
705