ed7920e69f9346ecadb255199f81b9529eee6fc2
[mono.git] / mono / metadata / verify.h
1 /**
2  * \file
3  */
4
5 #ifndef __MONO_METADATA_VERIFY_H__
6 #define __MONO_METADATA_VERIFY_H__
7
8 #include <mono/metadata/metadata.h>
9 #include <mono/metadata/image.h>
10 #include <mono/metadata/loader.h>
11 #include <mono/metadata/class-internals.h>
12 #include <glib.h> /* GSList dep */
13
14 MONO_BEGIN_DECLS
15
16 typedef enum {
17         MONO_VERIFY_OK,
18         MONO_VERIFY_ERROR,
19         MONO_VERIFY_WARNING,
20         MONO_VERIFY_CLS = 4,
21         MONO_VERIFY_ALL = 7,
22
23         /* Status signaling code that is not verifiable.*/
24         MONO_VERIFY_NOT_VERIFIABLE = 8,
25
26         /*OR it with other flags*/
27         
28         /* Abort the verification if the code is not verifiable.
29          * The standard behavior is to abort if the code is not valid.
30          * */
31         MONO_VERIFY_FAIL_FAST = 16,
32
33
34         /* Perform less verification of the code. This flag should be used
35          * if one wants the verifier to be more compatible to the MS runtime.
36          * Mind that this is not to be more compatible with MS peverify, but
37          * with the runtime itself, that has a less strict verifier.
38          */
39         MONO_VERIFY_NON_STRICT = 32,
40
41         /*Skip all visibility related checks*/
42         MONO_VERIFY_SKIP_VISIBILITY = 64,
43
44         /*Skip all visibility related checks*/
45         MONO_VERIFY_REPORT_ALL_ERRORS = 128
46
47 } MonoVerifyStatus;
48
49 typedef struct {
50         char            *message;
51         MonoVerifyStatus status;
52 } MonoVerifyInfo;
53
54 typedef struct {
55         MonoVerifyInfo info;
56         MonoExceptionType exception_type : 8; /*should be one of MONO_EXCEPTION_* */
57 } MonoVerifyInfoExtended;
58
59
60 MONO_API GSList* mono_method_verify       (MonoMethod *method, int level);
61 MONO_API void    mono_free_verify_list    (GSList *list);
62 MONO_API char*   mono_verify_corlib       (void);
63
64 MONO_END_DECLS
65
66 #endif  /* __MONO_METADATA_VERIFY_H__ */
67