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