Save.
[cacao.git] / exceptions.h
1 /* exceptions.h - exception related functions prototypes
2
3    Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4    R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser,
5    M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck,
6    P. Tomsich, J. Wenninger
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23    02111-1307, USA.
24
25    Contact: cacao@complang.tuwien.ac.at
26
27    Authors: Christian Thalinger
28
29    $Id: exceptions.h 1370 2004-08-01 21:54:20Z stefan $
30
31 */
32
33
34 #ifndef _EXCEPTIONS_H
35 #define _EXCEPTIONS_H
36
37
38 #include "global.h"
39 #include "nat/java_lang_String.h"
40 #include "nat/java_lang_Throwable.h"
41
42
43 /* system exception classes required in cacao */
44
45 extern classinfo *class_java_lang_Throwable;
46 extern classinfo *class_java_lang_Exception;
47 extern classinfo *class_java_lang_Error;
48 extern classinfo *class_java_lang_OutOfMemoryError;
49
50
51 /* exception/error super class */
52
53 extern char *string_java_lang_Throwable;
54
55
56 /* specify some exception strings for code generation */
57
58 extern char *string_java_lang_ArithmeticException;
59 extern char *string_java_lang_ArithmeticException_message;
60 extern char *string_java_lang_ArrayIndexOutOfBoundsException;
61 extern char *string_java_lang_ArrayStoreException;
62 extern char *string_java_lang_ClassCastException;
63 extern char *string_java_lang_ClassNotFoundException;
64 extern char *string_java_lang_CloneNotSupportedException;
65 extern char *string_java_lang_Exception;
66 extern char *string_java_lang_IllegalArgumentException;
67 extern char *string_java_lang_IllegalMonitorStateException;
68 extern char *string_java_lang_InterruptedException;
69 extern char *string_java_lang_NegativeArraySizeException;
70 extern char *string_java_lang_NoSuchFieldException;
71 extern char *string_java_lang_NoSuchMethodException;
72 extern char *string_java_lang_NullPointerException;
73
74
75 /* specify some error strings for code generation */
76
77 extern char *string_java_lang_AbstractMethodError;
78 extern char *string_java_lang_ClassCircularityError;
79 extern char *string_java_lang_ClassFormatError;
80 extern char *string_java_lang_Error;
81 extern char *string_java_lang_ExceptionInInitializerError;
82 extern char *string_java_lang_IncompatibleClassChangeError;
83 extern char *string_java_lang_InternalError;
84 extern char *string_java_lang_LinkageError;
85 extern char *string_java_lang_NoClassDefFoundError;
86 extern char *string_java_lang_NoSuchFieldError;
87 extern char *string_java_lang_NoSuchMethodError;
88 extern char *string_java_lang_OutOfMemoryError;
89 extern char *string_java_lang_VerifyError;
90
91
92 /* function prototypes */
93
94 /* load, link and compile exceptions used in the system */
95 void init_system_exceptions();
96
97 /* exception throwing functions */
98 void throw_exception();
99 void throw_exception_exit();
100
101 void throw_main_exception();
102 void throw_main_exception_exit();
103
104 void throw_cacao_exception_exit(char *exception, char *message);
105
106 /* initialize new exceptions */
107 java_objectheader *new_exception(char *classname);
108 java_objectheader *new_exception_message(char *classname, char *message);
109 java_objectheader *new_exception_throwable(char *classname, java_lang_Throwable *cause);
110 java_objectheader *new_exception_utfmessage(char *classname, utf *message);
111 java_objectheader *new_exception_javastring(char *classname, java_lang_String *message);
112 java_objectheader *new_exception_int(char *classname, s4 i);
113
114 java_objectheader *new_classformaterror(classinfo *c, char *message, ...);
115 java_objectheader *new_verifyerror(methodinfo *m, char *message);
116
117 #endif /* _EXCEPTIONS_H */
118
119
120 /*
121  * These are local overrides for various environment variables in Emacs.
122  * Please do not remove this and leave it at the end of the file, where
123  * Emacs will automagically detect them.
124  * ---------------------------------------------------------------------
125  * Local variables:
126  * mode: c
127  * indent-tabs-mode: t
128  * c-basic-offset: 4
129  * tab-width: 4
130  * End:
131  */