J
joe
I have the following header file generated by Java JNI's header file
generator (see bottom).
Obviously I will write a source file which will provide an implementation of
these methods.
I have a few questions regarding this:
1) Where is the class name defined? Is this a C++ class? It says "class
TestAPIMsg" in a generated comment but I can't see where this is set in the
header file.
2) How do I set global variables in this class (baring in mind it tells me
not to edit the header file)?
3) How do I add additional methods to this class i.e. ones not set in the
header file (again baring in mind I can't edit the header)?
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class TestAPIMsg */
#ifndef _Included_TestAPIMsg
#define _Included_TestAPIMsg
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: TestAPIMsg
* Method: SendMessageTest
* Signature: (Ljava/lang/StringZ
*/
JNIEXPORT jboolean JNICALL Java_TestAPIMsg_SendMessageTest
(JNIEnv *, jobject, jstring);
/*
* Class: TestAPIMsg
* Method: IncomingMessage
* Signature: (Ljava/lang/StringV
*/
JNIEXPORT void JNICALL Java_TestAPIMsg_IncomingMessage
(JNIEnv *, jobject, jstring);
/*
* Class: TestAPIMsg
* Method: DoConnect
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_TestAPIMsg_DoConnect
(JNIEnv *, jobject);
/*
* Class: TestAPIMsg
* Method: DoDisconnect
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_TestAPIMsg_DoDisconnect
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
generator (see bottom).
Obviously I will write a source file which will provide an implementation of
these methods.
I have a few questions regarding this:
1) Where is the class name defined? Is this a C++ class? It says "class
TestAPIMsg" in a generated comment but I can't see where this is set in the
header file.
2) How do I set global variables in this class (baring in mind it tells me
not to edit the header file)?
3) How do I add additional methods to this class i.e. ones not set in the
header file (again baring in mind I can't edit the header)?
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class TestAPIMsg */
#ifndef _Included_TestAPIMsg
#define _Included_TestAPIMsg
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: TestAPIMsg
* Method: SendMessageTest
* Signature: (Ljava/lang/StringZ
*/
JNIEXPORT jboolean JNICALL Java_TestAPIMsg_SendMessageTest
(JNIEnv *, jobject, jstring);
/*
* Class: TestAPIMsg
* Method: IncomingMessage
* Signature: (Ljava/lang/StringV
*/
JNIEXPORT void JNICALL Java_TestAPIMsg_IncomingMessage
(JNIEnv *, jobject, jstring);
/*
* Class: TestAPIMsg
* Method: DoConnect
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_TestAPIMsg_DoConnect
(JNIEnv *, jobject);
/*
* Class: TestAPIMsg
* Method: DoDisconnect
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_TestAPIMsg_DoDisconnect
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif