Name: krC82822 Date: 09/03/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
The javah tool has a -stubs option, but that no longer works in JDK 1.3 and
should just be removed. Aside from that, my main issue is that I am generating
over 600 functions via the javah tool. I have to cut-and-paste the .H file
declarations into a .CPP file and add names for all the parameters, and add
extern "C" to EVERY function. This is very annoying and time consuming, and
every time I re-generate the headers, it all has to be done over again. I know
the information for generating source files with named parameters has to be
easily accessible from the .java source file, and that's why I am perplexed
that it hasn't be done. PLEASE add a new option to this tool to generate a
source file with a fully formed prototype, and if possible, include a return
statement in the function where appropriate. As an example, here is what I
would like to see...
-----
.JAVA
-----
public MyClass
{
public int value;
}
public class Texture
{
public static native boolean foo1(MyClass a, int i);
static {
System.LoadLibrary("Texture");
}
}
-------------
.H from JAVAH
-------------
* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class Texture */
#ifndef _Included_Texture
#define _Included_Texture
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: Texture
* Method: foo1
* Signature: ()LTexture;
*/
JNIEXPORT boolean JNICALL Java_Texture_foo1
(JNIEnv *, jclass, jobject, jint);
#ifdef __cplusplus
}
#endif
#endif
----------------
.C or .CPP File (What I'd like to see...)
----------------
#include <jni.h>
#include "Texture.h"
/*
* Class: Texture
* Method: foo1
* Signature: ()LTexture;
*/
extern "C" JNIEXPORT boolean JNICALL Java_Texture_foo1
(JNIEnv *env, jclass cl_Texture, jobject a, jint i) // <--- notice naming
{
jboolean jbResult = false;
// TODO : INSERT YOUR CODE HERE
return jbResult;
}
(Review ID: 108023)
======================================================================