#include "jni.h"
#include <stdlib.h>
#include <string.h>
Include dependency graph for jnilib.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | Jvm_ |
A structure for C, which descripes the Jvm. More... | |
struct | JvmCPP_ |
A structure for C++, which descripes the Jvm. More... | |
struct | JvmData |
This structure holds the data needed for the Jvm for C and C++. More... | |
Typedefs | |
typedef Jvm_ | Jvm |
Defines which structure is used as Jvm. | |
typedef Jvm_ | Jvm_ |
A structure for C, which descripes the Jvm. | |
typedef JvmCPP_ | JvmCPP_ |
A structure for C++, which descripes the Jvm. | |
typedef JvmData | JvmData |
This structure holds the data needed for the Jvm for C and C++. | |
Functions | |
jboolean | callBooleanMethod (jobject obj, jmethodID mid,...) |
Calls a boolean method. | |
jboolean | callBooleanMethodByName (jobject obj, const char *method, const char *signature,...) |
Calls a boolean method. | |
jbyte | callByteMethod (jobject obj, jmethodID mid,...) |
Calls a byte method. | |
jbyte | callByteMethodByName (jobject obj, const char *method, const char *signature,...) |
Calls a byte method. | |
jchar | callCharMethod (jobject obj, jmethodID mid,...) |
Calls a char method. | |
jchar | callCharMethodByName (jobject obj, const char *method, const char *signature,...) |
Calls a char method. | |
jdouble | callDoubleMethod (jobject obj, jmethodID mid,...) |
Calls a double method. | |
jdouble | callDoubleMethodByName (jobject obj, const char *method, const char *signature,...) |
Calls a double method. | |
jfloat | callFloatMethod (jobject obj, jmethodID mid,...) |
Calls a float method. | |
jfloat | callFloatMethodByName (jobject obj, const char *method, const char *signature,...) |
Calls a float method. | |
jint | callIntMethod (jobject obj, jmethodID mid,...) |
Calls an int method. | |
jint | callIntMethodByName (jobject obj, const char *method, const char *signature,...) |
Calls an int method. | |
jlong | callLongMethod (jobject obj, jmethodID mid,...) |
Calls a long method. | |
jlong | callLongMethodByName (jobject obj, const char *method, const char *signature,...) |
Calls a long method. | |
jobject | callObjectMethod (jobject obj, jmethodID mid,...) |
Calls a object method. | |
jobject | callObjectMethodByName (jobject obj, const char *method, const char *signature,...) |
Calls a object method. | |
jshort | callShortMethod (jobject obj, jmethodID mid,...) |
Calls a short method. | |
jshort | callShortMethodByName (jobject obj, const char *method, const char *signature,...) |
Calls a short method. | |
jint | callStaticIntMethod (jclass cls, jmethodID mid,...) |
Calls a static int method. | |
jobject | callStaticObjectMethod (jclass cls, jmethodID mid,...) |
Calls a static object method. | |
void | callStaticVoidMethod (jclass cls, jmethodID mid,...) |
Calls a static void method. | |
void | callVoidMethod (jobject obj, jmethodID mid,...) |
Calls a void method. | |
void | callVoidMethodByName (jobject obj, const char *method, const char *signature,...) |
Calls a void method. | |
char * | convertJString (jstring jstr) |
Creates a native char* from a jstring. | |
jobject | createGlobalReference (jobject obj) |
Creates a global reference of a Java-Object and deletes the local reference. | |
jstring | createJString (const char *str) |
Creates a jstring from a native char*. | |
void | deleteGlobalReference (jobject obj) |
Deletes a global reference. | |
void | deleteLocalReference (jobject) |
Deletes a local reference. | |
jboolean | exception () |
Tests if an exception was thrown and prints the exception. | |
jclass | findClass (const char *strclass) |
Finds the Java class specified by strclass. | |
jmethodID | findMethod (jclass cls, const char *method, const char *signature) |
Finds a method of a Java class. | |
jfieldID | findStaticField (jclass cls, const char *field, const char *signature) |
Finds a static field of a Java class. | |
jmethodID | findStaticMethod (jclass cls, const char *method, const char *signature) |
Finds a static method of a Java class. | |
JavaVM * | getJavaVM () |
Gets a Pointer to the current JavaVM structure. | |
JNIEnv * | getJNIEnv () |
Gets a Pointer to the actual JNIEnv structure. | |
jclass | getObjectClass (jobject obj) |
Gets the Class of the Java-Object. | |
jint | getStaticIntFieldByName (const char *strclass, const char *strfield) |
Gets the value of a class field. | |
jobject | getStaticObjectFieldByName (const char *strclass, const char *strfield, const char *signature) |
Gets the value of a class field. | |
void | initJvm (Jvm *jvm, const char *classpath) |
Initializes and creates the Jvm. | |
jboolean | isSameObject (jobject obj1, jobject obj2) |
Compares 2 objects if they are the same or not. | |
void | jnisleep (jint ms) |
Sleeps for ms milliseconds. | |
jobject | newObject (jclass cls, jmethodID mid,...) |
Creates a new Object of a Class. | |
jobject | newObjectBySignature (jclass cls, const char *signature,...) |
Creates a new Object of a Class. | |
jint | registerNatives (jclass cls, const JNINativeMethod *nm, jint nMethods) |
Resgisters a native function pointer as native function in a Java-Class. | |
void | throwByName (const char *name, const char *msg) |
Throws an Throwable by name. |
These functions and structures provide access to a JVM. You can initialize a JVM instance and create objects and call methods by using these functions. Also some helper functions can be found here.
If you define the symbol DEBUG you get Java JNI debug information.
Definition in file jnilib.h.
|
Defines which structure is used as Jvm.
|
|
A structure for C, which descripes the Jvm.
|
|
A structure for C++, which descripes the Jvm.
|
|
This structure holds the data needed for the Jvm for C and C++.
|
|
Calls a boolean method.
|
|
Calls a boolean method.
|
|
Calls a byte method.
|
|
Calls a byte method.
|
|
Calls a char method.
|
|
Calls a char method.
|
|
Calls a double method.
|
|
Calls a double method.
|
|
Calls a float method.
|
|
Calls a float method.
|
|
Calls an int method.
|
|
Calls an int method.
|
|
Calls a long method.
|
|
Calls a long method.
|
|
Calls a object method.
|
|
Calls a object method.
|
|
Calls a short method.
|
|
Calls a short method.
|
|
Calls a static int method.
|
|
Calls a static object method.
|
|
Calls a static void method.
|
|
Calls a void method.
|
|
Calls a void method.
|
|
Creates a native char* from a jstring.
|
|
Creates a global reference of a Java-Object and deletes the local reference.
|
|
Creates a jstring from a native char*.
|
|
Deletes a global reference.
|
|
Deletes a local reference.
|
|
Tests if an exception was thrown and prints the exception.
|
|
Finds the Java class specified by strclass.
|
|
Finds a method of a Java class.
|
|
Finds a static field of a Java class.
|
|
Finds a static method of a Java class.
|
|
Gets a Pointer to the current JavaVM structure.
|
|
Gets a Pointer to the actual JNIEnv structure.
|
|
Gets the Class of the Java-Object.
|
|
Gets the value of a class field.
|
|
Gets the value of a class field.
|
|
Initializes and creates the Jvm.
|
|
Compares 2 objects if they are the same or not.
|
|
Sleeps for ms milliseconds.
|
|
Creates a new Object of a Class.
|
|
Creates a new Object of a Class.
|
|
Resgisters a native function pointer as native function in a Java-Class.
|
|
Throws an Throwable by name.
|