2010-04-19 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / utils / mono-error.h
blob6f722cff980bede42657a4e3a9b792f2e55e45ec
1 #ifndef __MONO_ERROR_H__
2 #define __MONO_ERROR_H__
4 enum {
5 /*
6 The supplied strings were dup'd by means of calling mono_error_dup_strings.
7 */
8 MONO_ERROR_FREE_STRINGS = 0x0001,
11 Something happened while processing the error and the resulting message is incomplete.
13 MONO_ERROR_INCOMPLETE = 0x0002
16 enum {
17 MONO_ERROR_NONE = 0,
18 MONO_ERROR_MISSING_METHOD = 1,
19 MONO_ERROR_MISSING_FIELD = 2,
20 MONO_ERROR_TYPE_LOAD = 3,
21 MONO_ERROR_FILE_NOT_FOUND = 4,
22 MONO_ERROR_BAD_IMAGE = 5,
23 MONO_ERROR_OUT_OF_MEMORY = 6,
24 MONO_ERROR_ARGUMENT = 7,
25 MONO_ERROR_NOT_VERIFIABLE = 8,
27 * This is a generic error mechanism is you need to raise an arbitrary corlib exception.
28 * You must pass the exception name otherwise prepare_exception will fail with internal execution.
30 MONO_ERROR_GENERIC = 9
33 /*Keep in sync with MonoErrorInternal*/
34 typedef struct {
35 unsigned short error_code;
36 unsigned short hidden_0; /*DON'T TOUCH */
38 void *hidden_1 [12]; /*DON'T TOUCH */
39 char hidden_2 [128]; /*DON'T TOUCH */
40 } MonoError;
42 G_BEGIN_DECLS
44 void
45 mono_error_init (MonoError *error);
47 void
48 mono_error_init_flags (MonoError *error, unsigned short flags);
50 void
51 mono_error_cleanup (MonoError *error);
53 gboolean
54 mono_error_ok (MonoError *error);
56 unsigned short
57 mono_error_get_error_code (MonoError *error);
59 const char*
60 mono_error_get_message (MonoError *error);
62 G_END_DECLS
63 #endif