Thu Feb 28 12:34:21 CET 2002 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / metadata / image.h
index 1819a20fefd6e4d1dfb3711039bbe576c6744fa6..95c443349e2eea8331cbcf529a2fe456feb39c1d 100644 (file)
@@ -5,15 +5,17 @@
 #include <glib.h>
 
 typedef struct _MonoImage MonoImage;
-typedef struct _MonoImage MonoMetadata;
 
 typedef struct {
+       int   ref_count;
+       char *name;
+       
        MonoImage *image;
        /* Load files here */
 } MonoAssembly;
 
 typedef struct {
-       guint32  offset;
+       const char* data;
        guint32  size;
 } MonoStreamHeader;
 
@@ -22,7 +24,7 @@ typedef struct {
        char     *base;
 
        /*
-        * Tables contain up to 9 rows and the possible sizes of the
+        * Tables contain up to 9 columns and the possible sizes of the
         * fields in the documentation are 1, 2 and 4 bytes.  So we
         * can encode in 2 bits the size.
         *
@@ -38,6 +40,7 @@ struct _MonoImage {
        int   ref_count;
        FILE *f;
        char *name;
+       const char *assembly_name;
        void *image_info;
 
        char                *raw_metadata;
@@ -67,6 +70,10 @@ struct _MonoImage {
         */
        GHashTable *method_cache;
        GHashTable *class_cache;
+       /*
+        * Indexes namespaces to hash tables that map class name to typedef token.
+        */
+       GHashTable *name_cache;
 
        /*
         * Indexed by ((rank << 24) | (typedef & 0xffffff)), which limits us to a
@@ -90,10 +97,10 @@ enum MonoImageOpenStatus {
 
 MonoImage    *mono_image_open     (const char *fname,
                                   enum MonoImageOpenStatus *status);
+MonoImage    *mono_image_loaded   (const char *name);
 void          mono_image_close    (MonoImage *image);
 const char   *mono_image_strerror (enum MonoImageOpenStatus status);
 
-
 int           mono_image_ensure_section     (MonoImage *image,
                                             const char *section);
 int           mono_image_ensure_section_idx (MonoImage *image,