// This file describes the Cygnus Native Interface, CNI.
// It provides a nicer interface to many of the things in gcj/javaprims.h.
-/* Copyright (C) 1998, 1999 Cygnus Solutions
+/* Copyright (C) 1998, 1999 Free Software Foundation
This file is part of libgcj.
#include <gcj/array.h>
+#include <string.h>
+
extern inline jobject
JvAllocObject (jclass cls)
{
return _Jv_NewStringUTF (bytes);
}
-extern class _Jv_PrimClass _Jv_byteClass, _Jv_shortClass, _Jv_intClass,
- _Jv_longClass, _Jv_booleanClass, _Jv_charClass, _Jv_floatClass,
- _Jv_doubleClass, _Jv_voidClass;
-#define JvPrimClass(TYPE) ((jclass) & _Jv_##TYPE##Class)
-
class JvSynchronize
{
private:
{ _Jv_MonitorExit (obj); }
};
-// Throw some exception.
-extern void JvThrow (jobject obj) __attribute__ ((__noreturn__));
-extern inline void
-JvThrow (jobject obj)
-{
- _Jv_Throw ((void *) obj);
-}
-
/* Call malloc, but throw exception if insufficient memory. */
extern inline void *
JvMalloc (jsize size)
{
return _Jv_Free (ptr);
}
+
+extern inline jint
+JvCreateJavaVM (void* vm_args)
+{
+ return _Jv_CreateJavaVM (vm_args);
+}
+
+extern inline java::lang::Thread*
+JvAttachCurrentThread (jstring name, java::lang::ThreadGroup* group)
+{
+ return _Jv_AttachCurrentThread (name, group);
+}
+
+extern inline jint
+JvDetachCurrentThread (void)
+{
+ return _Jv_DetachCurrentThread ();
+}
#endif /* __GCJ_CNI_H__ */