2004-05-26 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mono / metadata / image.h
index fd7e3966fc61975c45c9afae0bb950e03b33a9cf..dd6923f2e40320dfc65224d741e12346e90e3070 100644 (file)
@@ -12,6 +12,7 @@ typedef struct {
        const char *culture;
        const char *hash_value;
        const guint8* public_key;
+       const char *public_tok_value;
        guint32 hash_alg;
        guint32 hash_len;
        guint32 flags;
@@ -21,11 +22,12 @@ typedef struct {
 typedef struct {
        int   ref_count;
        char *basedir;
+       gboolean in_gac;
        MonoAssemblyName aname;
        GModule *aot_module;
        MonoImage *image;
        /* Load files here */
-       void *dynamic;
+       gboolean dynamic;
 } MonoAssembly;
 
 typedef struct {
@@ -88,6 +90,8 @@ struct _MonoImage {
 
        MonoImage **modules;
 
+       MonoImage **files;
+
        /*
         * The Assembly this image was loaded from.
         */
@@ -98,11 +102,19 @@ struct _MonoImage {
         */
        GHashTable *method_cache;
        GHashTable *class_cache;
+       /*
+        * Indexed by fielddef and memberref tokens
+        */
+       GHashTable *field_cache;
 
-       /* indexed by a generic type instantiation */
-       GHashTable *generics_cache;
        /* indexed by typespec tokens. */
        GHashTable *typespec_cache;
+
+       /*
+        * Indexed by MonoGenericInst.
+        */
+       GHashTable *generic_inst_cache;
+
        /*
         * Indexes namespaces to hash tables that map class name to typedef token.
         */
@@ -137,6 +149,12 @@ struct _MonoImage {
         * metadata engine
         */
        void *user_info;
+
+       /* dll map entries */
+       GHashTable *dll_map;
+
+       /* Whenever this is a dynamically emitted module */
+       gboolean dynamic;
 };
 
 typedef enum {
@@ -156,6 +174,7 @@ MonoImage    *mono_image_loaded   (const char *name);
 MonoImage    *mono_image_loaded_by_guid (const char *guid);
 void          mono_image_init     (MonoImage *image);
 void          mono_image_close    (MonoImage *image);
+void          mono_image_addref   (MonoImage *image);
 const char   *mono_image_strerror (MonoImageOpenStatus status);
 
 int           mono_image_ensure_section     (MonoImage *image,
@@ -165,6 +184,7 @@ int           mono_image_ensure_section_idx (MonoImage *image,
 
 guint32       mono_image_get_entry_point    (MonoImage *image);
 const char   *mono_image_get_resource       (MonoImage *image, guint32 offset, guint32 *size);
+MonoImage*    mono_image_load_file_for_image (MonoImage *image, int fileidx);
 
 /* This actually returns a MonoPEResourceDataEntry *, but declaring it
  * causes an include file loop.