* Removed all Id tags.
[cacao.git] / src / native / vm / cldc1.1 / com_sun_cldchi_jvm_JVM.c
index 4a42b030a9cdf9bb43e06c5e928153fe255da39e..8814d2f9f35d22222d3db3c5e2716003f3bd7fb1 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: java_lang_VMRuntime.c 5900 2006-11-04 17:30:44Z michi $
-
 */
 
 
 #include "vm/types.h"
 
 #include "native/jni.h"
+#include "native/native.h"
 
 #include "native/include/java_lang_String.h"
 
+#include "native/include/com_sun_cldchi_jvm_JVM.h"
+
 #include "native/vm/java_lang_Runtime.h"
 
 #include "vm/exceptions.h"
 #include "vm/stringlocal.h"
 
 
+/* native methods implemented by this file ************************************/
+static JNINativeMethod methods[] = {
+       { "loadLibrary", "(Ljava/lang/String;)V", (void *) (ptrint) &Java_com_sun_cldchi_jvm_JVM_loadLibrary },
+};
+
+
+/* _Jv_com_sun_cldchi_jvm_JVM_init *********************************************
+   Register native functions.
+*******************************************************************************/
+void _Jv_com_sun_cldchi_jvm_JVM_init(void)
+{
+       utf *u;
+       u = utf_new_char("com/sun/cldchi/jvm/JVM");
+       native_method_register(u, methods, NATIVE_METHODS_COUNT);
+}
+
+
 /*
  * Class:     com/sun/cldchi/jvm/JVM
  * Method:    loadLibrary
@@ -59,7 +83,7 @@ JNIEXPORT void JNICALL Java_com_sun_cldchi_jvm_JVM_loadLibrary(JNIEnv *env, jcla
        /* check for error and throw one in case */
 
        if (result == 0) {
-               name = javastring_toutf((java_objectheader *) libName, false);
+               name = javastring_toutf((java_handle_t *) libName, false);
                exceptions_throw_unsatisfiedlinkerror(name);
        }
 }