* Removed all Id tags.
[cacao.git] / src / native / vm / cldc1.1 / java_lang_Object.c
index 1eb4b86e382473c5d9c7501419050fa111a41d7a..2f6698c49da1f5cb57e44ab0aaa3226b9746f105 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/llni.h"
+#include "native/native.h"
 
-#include "native/include/java_lang_String.h" /* required by java_lang_Class.h */
+#include "native/include/java_lang_String.h"             /* required by j.l.C */
 #include "native/include/java_lang_Class.h"
+
 #include "native/include/java_lang_Object.h"
 
 #include "native/vm/java_lang_Object.h"
 
 
+/* native methods implemented by this file ************************************/
+static JNINativeMethod methods[] = {
+       { "getClass",  "()Ljava/lang/Class;",                   (void *) (ptrint) &Java_java_lang_Object_getClass  },
+       { "hashCode",  "()I",                                   (void *) (ptrint) &Java_java_lang_Object_hashCode  },
+       { "notify",    "()V",                                   (void *) (ptrint) &Java_java_lang_Object_notify    },
+       { "notifyAll", "()V",                                   (void *) (ptrint) &Java_java_lang_Object_notifyAll },
+       { "wait",      "(J)V",                                  (void *) (ptrint) &Java_java_lang_Object_wait      },
+};
+/* _Jv_java_lang_Object_init ***************************************************
+   Register native functions.
+*******************************************************************************/
+void _Jv_java_lang_Object_init(void)
+{
+       utf *u;
+       u = utf_new_char("java/lang/Object");
+       native_method_register(u, methods, NATIVE_METHODS_COUNT);
+}
+
+
 /*
- * Class:     java/lang/VMObject
+ * Class:     java/lang/Object
  * Method:    getClass
- * Signature: (Ljava/lang/Object;)Ljava/lang/Class;
+ * Signature: ()Ljava/lang/Class;
  */
 JNIEXPORT java_lang_Class* JNICALL Java_java_lang_Object_getClass(JNIEnv *env, java_lang_Object *obj)
 {
-       java_objectheader *o;
-       classinfo         *c;
+       java_handle_t *o;
+       classinfo     *c;
 
-       o = (java_objectheader *) obj;
+       o = (java_handle_t *) obj;
 
        if (o == NULL)
                return NULL;
 
        c = o->vftbl->class;
 
-       return (java_lang_Class *) c;
+       return LLNI_classinfo_wrap(c);
 }