X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=native.h;h=f26814dc029aba924438f2e25c5fd51346acc7ce;hb=c8ad9d4f87f62c09b3c07381d0520ac180c81f21;hp=b36366fa66b9410aaeae8442b745bd9b97cdab96;hpb=d9c2cb3fb3bb71159e11e4b6e829fa9155d32510;p=cacao.git diff --git a/native.h b/native.h index b36366fa6..f26814dc0 100644 --- a/native.h +++ b/native.h @@ -26,7 +26,7 @@ Authors: Reinhard Grafl - $Id: native.h 1089 2004-05-27 15:41:37Z twisti $ + $Id: native.h 1296 2004-07-10 17:02:15Z stefan $ */ @@ -41,7 +41,32 @@ #include "nat/java_lang_Throwable.h" +/* table for locating native methods */ + +typedef struct nativeref nativeref; +typedef struct nativecompref nativecompref; + +struct nativeref { + char *classname; + char *methodname; + char *descriptor; + bool isstatic; + functionptr func; +}; + +/* table for fast string comparison */ + +struct nativecompref { + utf *classname; + utf *methodname; + utf *descriptor; + bool isstatic; + functionptr func; +}; + + /* searchpath for classfiles */ + extern char *classpath; extern classinfo *class_java_lang_Class; @@ -59,9 +84,11 @@ extern classinfo *class_java_lang_Character; extern classinfo *class_java_lang_Integer; -/* system exception classes required while compiling */ +/* system exception classes required in cacao */ extern classinfo *class_java_lang_Throwable; +extern classinfo *class_java_lang_Exception; +extern classinfo *class_java_lang_Error; /* exception/error super class */ @@ -117,9 +144,13 @@ extern hashtable string_hash; void init_system_exceptions(); void compile_all_class_methods(classinfo *c); -/* throw an exception and exit */ +/* exception throwing functions */ +void throw_exception(); void throw_exception_exit(); +void throw_main_exception(); +void throw_main_exception_exit(); + void throw_cacao_exception_exit(char *exception, char *message); /* initialize new exceptions */ @@ -201,7 +232,7 @@ java_objectheader *literalstring_u2(java_chararray *a, u4 length, u4 offset, /* dispose a javastring */ void literalstring_free(java_objectheader*); -void copy_vftbl(vftbl **dest, vftbl *src); +void copy_vftbl(vftbl_t **dest, vftbl_t *src); utf *create_methodsig(java_objectarray* types, char *retType); classinfo *get_type(char **utf_ptr,char *desc_end, bool skip);