diff options
author | Quincey Koziol <koziol@lbl.gov> | 2019-04-14 04:06:38 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@lbl.gov> | 2019-04-14 04:06:38 (GMT) |
commit | 5696c02a3cceec73cfb404b7415ca33ca1a48718 (patch) | |
tree | c25d0985895862053d6b9d1eb1fce4fa94d471e3 /java/src | |
parent | 52276f3713eec584044bc72d4724507848cfeba0 (diff) | |
parent | d7e1464058515d07b838741f65a77977224814de (diff) | |
download | hdf5-5696c02a3cceec73cfb404b7415ca33ca1a48718.zip hdf5-5696c02a3cceec73cfb404b7415ca33ca1a48718.tar.gz hdf5-5696c02a3cceec73cfb404b7415ca33ca1a48718.tar.bz2 |
Merge pull request #1653 in HDFFV/hdf5 from ~KOZIOL/hdf5:get_fileno to develop
* commit 'd7e1464058515d07b838741f65a77977224814de':
Add C++, Java, and FORTRAN wrappers and tests for H5Fget_fileno
Add trace macro.
Add H5Fget_fileno() API routine.
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/hdf/hdf5lib/H5.java | 13 | ||||
-rw-r--r-- | java/src/jni/h5fImp.c | 20 | ||||
-rw-r--r-- | java/src/jni/h5fImp.h | 9 |
3 files changed, 42 insertions, 0 deletions
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index d107ad8..e874732 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -2968,6 +2968,19 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Fget_intent(long file_id) throws HDF5LibraryException; /** + * H5Fget_fileno retrieves the "file number" for an open file. + * + * @param file_id + * IN: File identifier for a currently-open HDF5 file + * + * @return the unique file number for the file. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Fget_fileno(long file_id) throws HDF5LibraryException; + + /** * H5Fget_mdc_hit_rate queries the metadata cache of the target file to obtain its hit rate (cache hits / (cache * hits + cache misses)) since the last time hit rate statistics were reset. * diff --git a/java/src/jni/h5fImp.c b/java/src/jni/h5fImp.c index d145c6a..26c1d17 100644 --- a/java/src/jni/h5fImp.c +++ b/java/src/jni/h5fImp.c @@ -275,6 +275,26 @@ done: /* * Class: hdf_hdf5lib_H5 + * Method: H5Fget_fileno + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5Fget_1fileno + (JNIEnv *env, jclass cls, jlong file_id) +{ + unsigned long fileno = 0; + + UNUSED(cls); + + if (H5Fget_intent((hid_t)file_id, &fileno) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + return (jlong)fileno; +} /* end Java_hdf_hdf5lib_H5_H5Fget_1intent */ + +/* + * Class: hdf_hdf5lib_H5 * Method: H5Fclose * Signature: (J)I */ diff --git a/java/src/jni/h5fImp.h b/java/src/jni/h5fImp.h index 410a249..fc02c76 100644 --- a/java/src/jni/h5fImp.h +++ b/java/src/jni/h5fImp.h @@ -104,6 +104,15 @@ Java_hdf_hdf5lib_H5_H5Fget_1intent /* * Class: hdf_hdf5lib_H5 + * Method: H5Fget_fileno + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5Fget_1fileno + (JNIEnv*, jclass, jlong); + +/* + * Class: hdf_hdf5lib_H5 * Method: H5Fclose * Signature: (J)I */ |