* src/vm/vm.c (usage): Small change.
[cacao.git] / src / native / native.h
index 2dffc6efdd6872beca08a7cd0e82e026ed5262dc..3df0504f9e42249fc64454d68c6046c0c6187ec1 100644 (file)
@@ -1,9 +1,9 @@
 /* src/native/native.h - table of native functions
 
-   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
-   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
-   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
-   Institut f. Computersprachen - TU Wien
+   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
+   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
+   J. Wenninger, Institut f. Computersprachen - TU Wien
 
    This file is part of CACAO.
 
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
 
-   Contact: cacao@complang.tuwien.ac.at
+   Contact: cacao@cacaojvm.org
 
    Authors: Reinhard Grafl
 
    Changes: Christian Thalinger
 
-   $Id: native.h 3196 2005-09-16 12:32:43Z twisti $
+   $Id: native.h 4530 2006-02-21 09:11:53Z twisti $
 
 */
 
 #ifndef _NATIVE_H
 #define _NATIVE_H
 
-#if !defined(ENABLE_STATICVM)
-# include "libltdl/ltdl.h"
+#include "config.h"
+
+#if !defined(WITH_STATIC_CLASSPATH)
+# include <ltdl.h>
 #endif
 
 #include "vm/class.h"
@@ -56,25 +58,26 @@ typedef struct nativeref nativeref;
 typedef struct nativecompref nativecompref;
 
 
-#if !defined(ENABLE_STATICVM)
-typedef struct library_hash_loader_entry library_hash_loader_entry;
-typedef struct library_hash_name_entry library_hash_name_entry;
+#if !defined(WITH_STATIC_CLASSPATH)
+typedef struct hashtable_library_loader_entry hashtable_library_loader_entry;
+typedef struct hashtable_library_name_entry hashtable_library_name_entry;
+
 
-/* library_hash_loader_entry **************************************************/
+/* hashtable_library_loader_entry *********************************************/
 
-struct library_hash_loader_entry {
-       java_objectheader         *loader;  /* class loader                       */
-       library_hash_name_entry   *namelink;/* libraries loaded by this loader    */
-       library_hash_loader_entry *hashlink;/* link for external chaining         */
+struct hashtable_library_loader_entry {
+       java_objectheader              *loader;  /* class loader                  */
+       hashtable_library_name_entry   *namelink;/* libs loaded by this loader    */
+       hashtable_library_loader_entry *hashlink;/* link for external chaining    */
 };
 
 
-/* library_hash_name_entry ****************************************************/
+/* hashtable_library_name_entry ***********************************************/
 
-struct library_hash_name_entry {
-       utf                     *name;      /* library name                       */
-       lt_dlhandle              handle;    /* libtool library handle             */
-       library_hash_name_entry *hashlink;  /* link for external chaining         */
+struct hashtable_library_name_entry {
+       utf                          *name;      /* library name                  */
+       lt_dlhandle                   handle;    /* libtool library handle        */
+       hashtable_library_name_entry *hashlink;  /* link for external chaining    */
 };
 #endif
 
@@ -98,26 +101,29 @@ struct nativecompref {
 };
 
 
-bool use_class_as_object(classinfo *c);
-
 /* initialize native subsystem */
 bool native_init(void);
 
+#if defined(WITH_STATIC_CLASSPATH)
+
 /* find native function */
-functionptr native_findfunction(utf *cname, utf *mname, 
-                                                               utf *desc, bool isstatic);
+functionptr native_findfunction(utf *cname, utf *mname, utf *desc,
+                                                               bool isstatic);
+
+#else /* defined(WITH_STATIC_CLASSPATH) */
 
-#if !defined(ENABLE_STATICVM)
 /* add a library to the library hash */
-void native_library_hash_add(utf *filename, java_objectheader *loader,
-                                                        lt_dlhandle handle);
+void native_hashtable_library_add(utf *filename, java_objectheader *loader,
+                                                                 lt_dlhandle handle);
+
+/* find a library entry in the library hash */
+hashtable_library_name_entry *native_hashtable_library_find(utf *filename,
+                                                                                                                       java_objectheader *loader);
 
-/* find a library in the library hash */
-library_hash_name_entry *native_library_hash_find(utf *filename,
-                                                                                                 java_objectheader *loader);
 /* resolve native function */
 functionptr native_resolve_function(methodinfo *m);
-#endif
+
+#endif /* defined(WITH_STATIC_CLASSPATH) */
 
 /* create new object on the heap and call the initializer */
 java_objectheader *native_new_and_init(classinfo *c);
@@ -134,90 +140,10 @@ java_objectheader *native_new_and_init_int(classinfo *c, s4 i);
    mainly used for exceptions with cause */
 java_objectheader *native_new_and_init_throwable(classinfo *c, java_lang_Throwable *t);
 
-/* add property to temporary property list -- located in nat/VMRuntime.c */
-void create_property(char *key, char *value);
-
-/* search 'classinfo'-structure for a field with the specified name */
-fieldinfo *class_findfield_approx(classinfo *c, utf *name);
-s4 class_findfield_index_approx(classinfo *c, utf *name);
-
-void copy_vftbl(vftbl_t **dest, vftbl_t *src);
-
-utf *create_methodsig(java_objectarray* types, char *retType);
-
 java_objectarray *native_get_parametertypes(methodinfo *m);
 java_objectarray *native_get_exceptiontypes(methodinfo *m);
 classinfo *native_get_returntype(methodinfo *m);
 
-
-/*----- For Static Analysis of Natives by parseRT -----*/
-
-/*---------- global variables ---------------------------*/
-typedef struct classMeth classMeth;
-typedef struct nativeCall   nativeCall;
-typedef struct methodCall   methodCall;
-typedef struct nativeMethod nativeMethod;
-
-typedef struct nativeCompCall   nativeCompCall;
-typedef struct methodCompCall   methodCompCall;
-typedef struct nativeCompMethod nativeCompMethod;
-
-/*---------- Define Constants ---------------------------*/
-#define MAXCALLS 30 
-
-struct classMeth {
-       int i_class;
-       int j_method;
-       int methCnt;
-};
-
-struct  methodCall{
-       char *classname;
-       char *methodname;
-       char *descriptor;
-};
-
-struct  nativeMethod  {
-       char *methodname;
-       char *descriptor;
-       struct methodCall methodCalls[MAXCALLS];
-};
-
-
-struct nativeCall {
-       char *classname;
-       struct nativeMethod methods[MAXCALLS];
-       int methCnt;
-       int callCnt[MAXCALLS];
-};
-
-
-struct methodCompCall {
-       utf *classname;
-       utf *methodname;
-       utf *descriptor;
-};
-
-
-struct nativeCompMethod {
-       utf *methodname;
-       utf *descriptor;
-       struct methodCompCall methodCalls[MAXCALLS];
-};
-
-
-struct nativeCompCall {
-       utf *classname;
-       struct nativeCompMethod methods[MAXCALLS];
-       int methCnt;
-       int callCnt[MAXCALLS];
-};
-
-
-bool natcall2utf(bool);
-void printNativeCall(nativeCall);
-void markNativeMethodsRT(utf *, utf* , utf* ); 
-
 #endif /* _NATIVE_H */