Just one extra bit
[mono.git] / mono / metadata / image.h
1 #ifndef _MONONET_METADATA_IMAGE_H_ 
2 #define _MONONET_METADATA_IMAGE_H_
3
4 typedef struct _MonoImage MonoImage;
5
6 typedef struct {
7         MonoImage *image;
8         /* Load files here */
9 } MonoAssembly;
10
11 struct _MonoImage {
12         int   ref_count;
13         FILE *f;
14         char *name;
15         void *image_info;
16
17         /*
18          * references is initialized only by using the mono_assembly_open
19          * function, and not by using the lowlevel mono_image_open.
20          *
21          * It is NULL terminated.
22          */
23         MonoAssembly **references;
24
25         /*
26          * user_info is a public field and is not touched by the
27          * metadata engine
28          */
29         void *user_info;
30 };
31
32 enum MonoImageOpenStatus {
33         MONO_IMAGE_OK,
34         MONO_IMAGE_ERROR_ERRNO,
35         MONO_IMAGE_MISSING_ASSEMBLYREF,
36         MONO_IMAGE_IMAGE_INVALID
37 };
38
39 MonoImage    *mono_image_open     (const char *fname,
40                                    enum MonoImageOpenStatus *status);
41 void          mono_image_close    (MonoImage *image);
42 const char   *mono_image_strerror (enum MonoImageOpenStatus status);
43
44
45 int           mono_image_ensure_section     (MonoImage *image,
46                                              const char *section);
47 int           mono_image_ensure_section_idx (MonoImage *image,
48                                              int section);
49         
50 #endif