diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2018-10-15 17:35:32 (GMT) |
---|---|---|
committer | Larry Knox <lrknox@hdfgroup.org> | 2018-10-15 17:35:32 (GMT) |
commit | 5eef94f83f4875b64ffe7f9cea05d965bddbd802 (patch) | |
tree | 98e19e98333de2fcdf6f8f9a777528dde879733d /java/src/jni/h5eImp.c | |
parent | 6569f208b8f39ace9e442e94ab110bec94c67d37 (diff) | |
parent | f3f29dc7df5f3cc41a5e9462d8c415e540cda3d6 (diff) | |
download | hdf5-5eef94f83f4875b64ffe7f9cea05d965bddbd802.zip hdf5-5eef94f83f4875b64ffe7f9cea05d965bddbd802.tar.gz hdf5-5eef94f83f4875b64ffe7f9cea05d965bddbd802.tar.bz2 |
Merge pull request #1296 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:1.10/master to 1.10/master
* commit 'f3f29dc7df5f3cc41a5e9462d8c415e540cda3d6': (42 commits)
Commit version string changes for HDF5 1.10.4 release.
Merge hdf5_1_10 changes to hdf5_1_10_4.
Merge in changes from hdf5_1_10.
Commit release date change.
Update RELEASE.txt for HDF5 1.10.4 release.
Add notes about unsupported options
Add contents of HDF5 1.10.3 RELEASE.txt to HISTORY-1_10.txt and update RELEASE.txt for continuing development.
Switch maintainer mode to disable, build mode to production, version to 1.10.4, and commit files generated by autogen.sh for release branch hdf5_1_10_4.
HDFFV-10568 fix hdf5_java library dependency
Fix Java library location for testing
Java groups example fix
Update system commands with HD prefix and whitespace
Merge pull request #1224 in HDFFV/hdf5 from ~JHENDERSON/hdf5:develop to develop
Disable failing tests because of execution issue
Add testfiles to data copy
Same changes needed for examples as test
Correct name of test jar
Only remove test jars
Remove obsolete var
Change prefix in example scripts to relative path to bin. This was done for 1.8, and works wherever installed without the need to replace the original prefix.
...
Diffstat (limited to 'java/src/jni/h5eImp.c')
-rw-r--r-- | java/src/jni/h5eImp.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c index 10a02b0..9c80461 100644 --- a/java/src/jni/h5eImp.c +++ b/java/src/jni/h5eImp.c @@ -40,7 +40,11 @@ extern "C" { #include "h5eImp.h" extern JavaVM *jvm; -extern jobject visit_callback; + +typedef struct _cb_wrapper { + jobject visit_callback; + jobject op_data; +} cb_wrapper; #ifdef __cplusplus #define CBENVPTR (cbenv) @@ -60,7 +64,7 @@ extern jobject visit_callback; /* Local Prototypes */ /********************/ -static herr_t H5E_walk_cb(int nindx, const H5E_error2_t *info, void *op_data); +static herr_t H5E_walk_cb(int nindx, const H5E_error2_t *info, void *cb_data); /* * Class: hdf_hdf5lib_H5 @@ -475,7 +479,7 @@ Java_hdf_hdf5lib_H5_H5Eget_1num static herr_t H5E_walk_cb - (int nindx, const H5E_error2_t *info, void *op_data) + (int nindx, const H5E_error2_t *info, void *cb_data) { JNIEnv *cbenv; jint status = -1; @@ -485,6 +489,9 @@ H5E_walk_cb jmethodID constructor; jvalue args[7]; jobject cb_info_t = NULL; + cb_wrapper *wrapper = (cb_wrapper *)cb_data; + void *op_data = (void *)wrapper->op_data; + jobject visit_callback = wrapper->visit_callback; if(JVMPTR->AttachCurrentThread(JVMPAR2 (void**)&cbenv, NULL) == 0) { cls = CBENVPTR->GetObjectClass(CBENVPAR visit_callback); @@ -532,13 +539,14 @@ JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Ewalk2 (JNIEnv *env, jclass cls, jlong stk_id, jlong direction, jobject callback_op, jobject op_data) { + cb_wrapper wrapper = {callback_op, op_data}; + ENVPTR->GetJavaVM(ENVPAR &jvm); - visit_callback = callback_op; if ((op_data == NULL) || (callback_op == NULL)) { h5nullArgument(env, "H5Ewalk2: op_data or callback_op is NULL"); } /* end if */ - else if (H5Ewalk2(stk_id, (H5E_direction_t)direction, (H5E_walk2_t)H5E_walk_cb, (void*)op_data) < 0) + else if (H5Ewalk2(stk_id, (H5E_direction_t)direction, (H5E_walk2_t)H5E_walk_cb, (void*)&wrapper) < 0) h5libraryError(env); } /* end iJava_hdf_hdf5lib_H5_H5Ewalk2f */ |