Hello Ali,
you're on the right track.
Generally, the procedure is as follows:
1) You add the native method to src/sparse/PrismSparse.java (your step 3)
2) You recompile once. The Java compiler generates the appropriate
method signature in include/jni/sparse_PrismSparse.h [1]
3) You then provide an implementation in some *.cc file in src/sparse
(all *.cc files in that directory are compiled and linked to the
libsparse library).
4) Then, everything should work out fine...
So, in particular, you don't have to (and should not) manually edit the
.h file, as it's autogenerated. For your native method, it generates
JNIEXPORT jint JNICALL Java_sparse_PrismSparse_PS_1ExportMatrix_12
(JNIEnv *, jclass, jlong, jstring, jlong, jint, jlong, jint, jlong,
jint, jstring);
as the signature (notice the _12 at the end of the method name, which is
due to the Java name mangling of underscores in the native method name).
Cheers,
Joachim Klein
PS: If you are basing your code on the PRISM trunk after July 12th, the
generated .h headers are in include/jni/PACKAGE_CLASS.h (see
https://github.com/prismmodelchecker/prism/commit/4de3c189a4c23587565e89580293fcded7f2f310),
before they are generated in include/CLASS.h