Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / metadata / exception.h
index 17279507a010c68d2fa2c5bfd151fe4e7197eb16..6575694c7c50ce37e9c0d903a89dabf869f3d3f4 100644 (file)
@@ -1,9 +1,10 @@
+/**
+ * \file
+ */
+
 #ifndef _MONO_METADATA_EXCEPTION_H_
 #define _MONO_METADATA_EXCEPTION_H_
 
-/* here for compat: should not be used anymore */
-#define MONO_ARCH_SAVE_REGS 
-
 #include <mono/metadata/object.h>
 #include <mono/metadata/image.h>
 
@@ -17,6 +18,7 @@ mono_exception_from_name               (MonoImage *image,
 MONO_API MonoException *
 mono_exception_from_token              (MonoImage *image, uint32_t token);
 
+MONO_RT_EXTERNAL_ONLY
 MONO_API MonoException *
 mono_exception_from_name_two_strings (MonoImage *image, const char *name_space,
                                      const char *name, MonoString *a1, MonoString *a2);
@@ -25,6 +27,7 @@ MONO_API MonoException *
 mono_exception_from_name_msg          (MonoImage *image, const char *name_space,
                                        const char *name, const char *msg);
 
+MONO_RT_EXTERNAL_ONLY
 MONO_API MonoException *
 mono_exception_from_token_two_strings (MonoImage *image, uint32_t token,
                                                   MonoString *a1, MonoString *a2);
@@ -106,9 +109,11 @@ mono_get_exception_io                    (const char *msg);
 MONO_API MonoException *
 mono_get_exception_file_not_found        (MonoString *fname);
 
+MONO_RT_EXTERNAL_ONLY
 MONO_API MonoException *
 mono_get_exception_file_not_found2       (const char *msg, MonoString *fname);
 
+MONO_RT_EXTERNAL_ONLY
 MONO_API MonoException *
 mono_get_exception_type_initialization (const char *type_name, MonoException *inner);
 
@@ -124,6 +129,7 @@ mono_get_exception_appdomain_unloaded (void);
 MONO_API MonoException *
 mono_get_exception_bad_image_format (const char *msg);
 
+MONO_RT_EXTERNAL_ONLY
 MONO_API MonoException *
 mono_get_exception_bad_image_format2 (const char *msg, MonoString *fname);
 
@@ -139,12 +145,22 @@ mono_get_exception_field_access (void);
 MONO_API MonoException *
 mono_get_exception_method_access (void);
 
+MONO_RT_EXTERNAL_ONLY
 MONO_API MonoException *
 mono_get_exception_reflection_type_load (MonoArray *types, MonoArray *exceptions);
 
+MONO_RT_EXTERNAL_ONLY
 MONO_API MonoException *
 mono_get_exception_runtime_wrapped (MonoObject *wrapped_exception);
 
+/* Installs a function which is called when the runtime encounters an unhandled exception.
+ * This hook isn't expected to return.
+ * If no hook has been installed, the runtime will print a message before aborting.
+ */
+typedef void  (*MonoUnhandledExceptionFunc)         (MonoObject *exc, void *user_data);
+MONO_API void mono_install_unhandled_exception_hook (MonoUnhandledExceptionFunc func, void *user_data);
+void          mono_invoke_unhandled_exception_hook  (MonoObject *exc);
+
 MONO_END_DECLS
 
 #endif /* _MONO_METADATA_EXCEPTION_H_ */