// gcj/cni.h -*- c++ -*-
-// This file describes the Cygnus Native Interface, CNI.
+// This file describes the Compiled Native Interface, CNI.
// It provides a nicer interface to many of the things in gcj/javaprims.h.
-/* Copyright (C) 1998, 1999 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2002 Free Software Foundation
This file is part of libgcj.
#include <java/lang/Class.h>
#include <gcj/array.h>
+#include <gcj/javaprims.h>
#include <string.h>
-extern inline jobject
-JvAllocObject (jclass cls)
-{
- return _Jv_AllocObject (cls, cls->size());
-}
-
-extern inline jobject
-JvAllocObject (jclass cls, jsize sz)
-{
- return _Jv_AllocObject (cls, sz);
-}
-
-extern "C" jstring _Jv_NewStringUTF (const char *bytes);
extern "C" void _Jv_InitClass (jclass);
+extern "C" void *_Jv_AllocBytes (jsize size) __attribute__((__malloc__));
extern inline void
JvInitClass (jclass cls)
return _Jv_InitClass (cls);
}
+extern inline void *
+JvAllocBytes (jsize sz)
+{
+ return _Jv_AllocBytes (sz);
+}
+
extern inline jstring
JvAllocString (jsize sz)
{
return _Jv_Malloc (size);
}
+extern inline void *
+JvRealloc (void *ptr, jsize size)
+{
+ return _Jv_Realloc (ptr, size);
+}
+
extern inline void
JvFree (void *ptr)
{
return _Jv_Free (ptr);
}
+
+typedef struct _Jv_VMOption JvVMOption;
+typedef struct _Jv_VMInitArgs JvVMInitArgs;
+
+extern inline jint
+JvCreateJavaVM (JvVMInitArgs* 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 java::lang::Thread*
+JvAttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group)
+{
+ return _Jv_AttachCurrentThreadAsDaemon (name, group);
+}
+
+extern inline jint
+JvDetachCurrentThread (void)
+{
+ return _Jv_DetachCurrentThread ();
+}
#endif /* __GCJ_CNI_H__ */