[System.Data] Try to fix random DataViewTest.DefaultColumnNameAddListChangedTest...
[mono-project.git] / mono / metadata / image.h
blobc3ad58b3431c00e04a95676339e5f07ea2e3291f
1 #ifndef _MONONET_METADATA_IMAGE_H_
2 #define _MONONET_METADATA_IMAGE_H_
4 #include <stdio.h>
5 #include <mono/utils/mono-publib.h>
7 MONO_BEGIN_DECLS
9 typedef struct _MonoImage MonoImage;
10 typedef struct _MonoAssembly MonoAssembly;
11 typedef struct _MonoAssemblyName MonoAssemblyName;
12 typedef struct _MonoTableInfo MonoTableInfo;
14 typedef enum {
15 MONO_IMAGE_OK,
16 MONO_IMAGE_ERROR_ERRNO,
17 MONO_IMAGE_MISSING_ASSEMBLYREF,
18 MONO_IMAGE_IMAGE_INVALID
19 } MonoImageOpenStatus;
21 MONO_API void mono_images_init (void);
22 MONO_API void mono_images_cleanup (void);
24 MONO_API MonoImage *mono_image_open (const char *fname,
25 MonoImageOpenStatus *status);
26 MONO_API MonoImage *mono_image_open_full (const char *fname,
27 MonoImageOpenStatus *status, mono_bool refonly);
28 MONO_API MonoImage *mono_pe_file_open (const char *fname,
29 MonoImageOpenStatus *status);
30 MONO_API MonoImage *mono_image_open_from_data (char *data, uint32_t data_len, mono_bool need_copy,
31 MonoImageOpenStatus *status);
32 MONO_API MonoImage *mono_image_open_from_data_full (char *data, uint32_t data_len, mono_bool need_copy,
33 MonoImageOpenStatus *status, mono_bool refonly);
34 MONO_API MonoImage *mono_image_open_from_data_with_name (char *data, uint32_t data_len, mono_bool need_copy,
35 MonoImageOpenStatus *status, mono_bool refonly, const char *name);
36 MONO_API void mono_image_fixup_vtable (MonoImage *image);
37 MONO_API MonoImage *mono_image_loaded (const char *name);
38 MONO_API MonoImage *mono_image_loaded_full (const char *name, mono_bool refonly);
39 MONO_API MonoImage *mono_image_loaded_by_guid (const char *guid);
40 MONO_API MonoImage *mono_image_loaded_by_guid_full (const char *guid, mono_bool refonly);
41 MONO_API void mono_image_init (MonoImage *image);
42 MONO_API void mono_image_close (MonoImage *image);
43 MONO_API void mono_image_addref (MonoImage *image);
44 MONO_API const char *mono_image_strerror (MonoImageOpenStatus status);
46 MONO_API int mono_image_ensure_section (MonoImage *image,
47 const char *section);
48 MONO_API int mono_image_ensure_section_idx (MonoImage *image,
49 int section);
51 MONO_API uint32_t mono_image_get_entry_point (MonoImage *image);
52 MONO_API const char *mono_image_get_resource (MonoImage *image, uint32_t offset, uint32_t *size);
53 MONO_API MonoImage* mono_image_load_file_for_image (MonoImage *image, int fileidx);
55 MONO_API MonoImage* mono_image_load_module (MonoImage *image, int idx);
57 MONO_API const char* mono_image_get_name (MonoImage *image);
58 MONO_API const char* mono_image_get_filename (MonoImage *image);
59 MONO_API const char * mono_image_get_guid (MonoImage *image);
60 MONO_API MonoAssembly* mono_image_get_assembly (MonoImage *image);
61 MONO_API mono_bool mono_image_is_dynamic (MonoImage *image);
62 MONO_API char* mono_image_rva_map (MonoImage *image, uint32_t rva);
64 MONO_API const MonoTableInfo *mono_image_get_table_info (MonoImage *image, int table_id);
65 MONO_API int mono_image_get_table_rows (MonoImage *image, int table_id);
66 MONO_API int mono_table_info_get_rows (const MonoTableInfo *table);
68 /* This actually returns a MonoPEResourceDataEntry *, but declaring it
69 * causes an include file loop.
71 MONO_API void* mono_image_lookup_resource (MonoImage *image, uint32_t res_id,
72 uint32_t lang_id, mono_unichar2 *name);
74 MONO_API const char* mono_image_get_public_key (MonoImage *image, uint32_t *size);
75 MONO_API const char* mono_image_get_strong_name (MonoImage *image, uint32_t *size);
76 MONO_API uint32_t mono_image_strong_name_position (MonoImage *image, uint32_t *size);
77 MONO_API void mono_image_add_to_name_cache (MonoImage *image,
78 const char *nspace, const char *name, uint32_t idx);
79 MONO_API mono_bool mono_image_has_authenticode_entry (MonoImage *image);
81 MONO_END_DECLS
83 #endif