summaryrefslogtreecommitdiffstats
path: root/java/src/jni/h5oImp.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2018-08-24 14:14:56 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2018-08-24 14:14:56 (GMT)
commit6569f208b8f39ace9e442e94ab110bec94c67d37 (patch)
treeb477826af1b6b47b1da9dfe948050ed7a50e75c4 /java/src/jni/h5oImp.c
parent2ad049a6411923653365962c826cf59cf801d0d7 (diff)
parent21eef8a98ee6949c69d79c6c4d87fc8e4e38dc29 (diff)
downloadhdf5-6569f208b8f39ace9e442e94ab110bec94c67d37.zip
hdf5-6569f208b8f39ace9e442e94ab110bec94c67d37.tar.gz
hdf5-6569f208b8f39ace9e442e94ab110bec94c67d37.tar.bz2
Merge pull request #1220 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:1.10/master to 1.10/master
* commit '21eef8a98ee6949c69d79c6c4d87fc8e4e38dc29': (354 commits) Commit version with new release date. Add example packaging option and fix html5 issues Commit version with new release date. Commit files changed by autogen.sh. Merge pull request #1208 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:hdf5_1_10 to hdf5_1_10 Merge pull request #1207 in HDFFV/hdf5 from ~BYRN/hdf5_adb:hdf5_1_10 to hdf5_1_10 Merge pull request #1203 in HDFFV/hdf5 from ~BYRN/hdf5_adb:hdf5_1_10 to hdf5_1_10 Commit version with new release date. Commit new generated H5version.h including #defines for H5_USE_110_API. Correct nested c-style comment. Merge pull request #1197 in HDFFV/hdf5 from ~BYRN/hdf5_merge_adb:hdf5_1_10 to hdf5_1_10 Merge pull request #1194 in HDFFV/hdf5 from ~VCHOI/my_hdf5_fork:hdf5_1_10 to hdf5_1_10 Updated the H5Dread/write_chunk() release note. Added a release note for the H5Dread/write_chunk() API calls. Update Intel Fortran version for Windows 10. RELEASE.txt updates. Version change for 1.10.3 release. Revised entry on CVE issues Added notes about CVE issues Update version for HDF5 1.10.3 release. Add placeholder for performance improvement in RELEASE.txt updated fortran fixes ...
Diffstat (limited to 'java/src/jni/h5oImp.c')
-rw-r--r--java/src/jni/h5oImp.c117
1 files changed, 67 insertions, 50 deletions
diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c
index e8abead..6093e46 100644
--- a/java/src/jni/h5oImp.c
+++ b/java/src/jni/h5oImp.c
@@ -105,11 +105,11 @@ Java_hdf_hdf5lib_H5_H5Ocopy
/*
* Class: hdf_hdf5lib_H5
* Method: H5Oget_info
- * Signature: (J)Lhdf/hdf5lib/structs/H5O_info_t;
+ * Signature: (JI)Lhdf/hdf5lib/structs/H5O_info_t;
*/
JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Oget_1info
- (JNIEnv *env, jclass clss, jlong loc_id)
+ (JNIEnv *env, jclass clss, jlong loc_id, jint fields)
{
herr_t status = -1;
H5O_info_t infobuf;
@@ -119,7 +119,7 @@ Java_hdf_hdf5lib_H5_H5Oget_1info
jobject ihinfobuf2;
jobject ret_obj = NULL;
- status = H5Oget_info((hid_t)loc_id, &infobuf);
+ status = H5Oget_info2((hid_t)loc_id, &infobuf, (unsigned)fields);
if (status < 0) {
h5libraryError(env);
@@ -168,11 +168,11 @@ Java_hdf_hdf5lib_H5_H5Oget_1info
/*
* Class: hdf_hdf5lib_H5
* Method: H5Oget_info_by_name
- * Signature: (JLjava/lang/String;J)Lhdf/hdf5lib/structs/H5O_info_t;
+ * Signature: (JLjava/lang/String;IJ)Lhdf/hdf5lib/structs/H5O_info_t;
*/
JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Oget_1info_1by_1name
- (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong access_id)
+ (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jint fields, jlong access_id)
{
const char *lName;
herr_t status = -1;
@@ -185,7 +185,7 @@ Java_hdf_hdf5lib_H5_H5Oget_1info_1by_1name
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
- status = H5Oget_info_by_name((hid_t)loc_id, lName, &infobuf, (hid_t)access_id);
+ status = H5Oget_info_by_name2((hid_t)loc_id, lName, &infobuf, (unsigned)fields, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
@@ -237,12 +237,12 @@ Java_hdf_hdf5lib_H5_H5Oget_1info_1by_1name
/*
* Class: hdf_hdf5lib_H5
* Method: H5Oget_info_by_idx
- * Signature: (JLjava/lang/String;IIJJ)Lhdf/hdf5lib/structs/H5O_info_t;
+ * Signature: (JLjava/lang/String;IIJIJ)Lhdf/hdf5lib/structs/H5O_info_t;
*/
JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Oget_1info_1by_1idx
(JNIEnv *env, jclass clss, jlong loc_id,
- jstring name, jint index_field, jint order, jlong link_n, jlong access_id)
+ jstring name, jint index_field, jint order, jlong link_n, jint fields, jlong access_id)
{
const char *lName;
herr_t status;
@@ -255,7 +255,7 @@ Java_hdf_hdf5lib_H5_H5Oget_1info_1by_1idx
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
- status = H5Oget_info_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, &infobuf, (hid_t)access_id);
+ status = H5Oget_info_by_idx2((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, &infobuf, (unsigned)fields, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
@@ -372,41 +372,58 @@ H5O_iterate_cb
constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "<init>", "(IIIIJJJJJJ)V");
if (constructor != 0) {
hdrinfobuf = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args);
-
- args[0].j = (jlong)info->meta_size.obj.index_size;
- args[1].j = (jlong)info->meta_size.obj.heap_size;
- // get a reference to the H5_ih_info_t class
- cls = CBENVPTR->FindClass(CBENVPAR "hdf/hdf5lib/structs/H5_ih_info_t");
- if (cls != 0) {
- // get a reference to the constructor; the name is <init>
- constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "<init>", "(JJ)V");
- if (constructor != 0) {
- ihinfobuf1 = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args);
- args[0].j = (jlong)info->meta_size.attr.index_size;
- args[1].j = (jlong)info->meta_size.attr.heap_size;
- ihinfobuf2 = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args);
-
- args[0].j = (jlong)info->fileno;
- args[1].j = (jlong)info->addr;
- args[2].i = info->type;
- args[3].i = (jint)info->rc;
- args[4].j = (jlong)info->num_attrs;
- args[5].j = info->atime;
- args[6].j = info->mtime;
- args[7].j = info->ctime;
- args[8].j = info->btime;
- args[9].l = hdrinfobuf;
- args[10].l = ihinfobuf1;
- args[11].l = ihinfobuf2;
- // get a reference to the H5O_info_t class
- cls = CBENVPTR->FindClass(CBENVPAR "hdf/hdf5lib/structs/H5O_info_t");
- if (cls != 0) {
- // get a reference to the constructor; the name is <init>
- constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "<init>", "(JJIIJJJJJLhdf/hdf5lib/structs/H5O_hdr_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;)V");
- if (constructor != 0) {
- cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args);
-
- status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data);
+ if (hdrinfobuf == NULL) {
+ printf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5O_hdr_info_t: Creation failed\n");
+ }
+ else {
+ args[0].j = (jlong)info->meta_size.obj.index_size;
+ args[1].j = (jlong)info->meta_size.obj.heap_size;
+ // get a reference to the H5_ih_info_t class
+ cls = CBENVPTR->FindClass(CBENVPAR "hdf/hdf5lib/structs/H5_ih_info_t");
+ if (cls != 0) {
+ // get a reference to the constructor; the name is <init>
+ constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "<init>", "(JJ)V");
+ if (constructor != 0) {
+ ihinfobuf1 = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args);
+ if (ihinfobuf1 == NULL) {
+ printf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5_ih_info_t: Creation failed\n");
+ }
+ else {
+ args[0].j = (jlong)info->meta_size.attr.index_size;
+ args[1].j = (jlong)info->meta_size.attr.heap_size;
+ ihinfobuf2 = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args);
+ if (ihinfobuf2 == NULL) {
+ printf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5_ih_info_t: Creation failed\n");
+ }
+ else {
+ args[0].j = (jlong)info->fileno;
+ args[1].j = (jlong)info->addr;
+ args[2].i = info->type;
+ args[3].i = (jint)info->rc;
+ args[4].j = (jlong)info->num_attrs;
+ args[5].j = info->atime;
+ args[6].j = info->mtime;
+ args[7].j = info->ctime;
+ args[8].j = info->btime;
+ args[9].l = hdrinfobuf;
+ args[10].l = ihinfobuf1;
+ args[11].l = ihinfobuf2;
+ // get a reference to the H5O_info_t class
+ cls = CBENVPTR->FindClass(CBENVPAR "hdf/hdf5lib/structs/H5O_info_t");
+ if (cls != 0) {
+ // get a reference to the constructor; the name is <init>
+ constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "<init>", "(JJIIJJJJJLhdf/hdf5lib/structs/H5O_hdr_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;)V");
+ if (constructor != 0) {
+ cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args);
+ if (cb_info_t == NULL) {
+ printf("H5O_iterate_cb ERROR: hdf/hdf5lib/structs/H5O_info_t: Creation failed\n");
+ }
+ else {
+ status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data);
+ }
+ }
+ }
+ }
}
}
}
@@ -423,12 +440,12 @@ H5O_iterate_cb
/*
* Class: hdf_hdf5lib_H5
* Method: H5Ovisit
- * Signature: (JIILjava/lang/Object;Ljava/lang/Object;)I
+ * Signature: (JIILjava/lang/Object;Ljava/lang/Object;I)I
*/
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Ovisit
(JNIEnv *env, jclass clss, jlong grp_id, jint idx_type, jint order,
- jobject callback_op, jobject op_data)
+ jobject callback_op, jobject op_data, jint fields)
{
herr_t status = -1;
@@ -442,7 +459,7 @@ Java_hdf_hdf5lib_H5_H5Ovisit
h5nullArgument(env, "H5Ovisit: callback_op is NULL");
} /* end if */
else {
- status = H5Ovisit((hid_t)grp_id, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5O_iterate_t)H5O_iterate_cb, (void*)op_data);
+ status = H5Ovisit2((hid_t)grp_id, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5O_iterate_t)H5O_iterate_cb, (void*)op_data, (unsigned)fields);
if (status < 0)
h5libraryError(env);
@@ -454,12 +471,12 @@ Java_hdf_hdf5lib_H5_H5Ovisit
/*
* Class: hdf_hdf5lib_H5
* Method: H5Ovisit_by_name
- * Signature: (JLjava/lang/String;IILjava/lang/Object;Ljava/lang/Object;J)I
+ * Signature: (JLjava/lang/String;IILjava/lang/Object;Ljava/lang/Object;IJ)I
*/
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Ovisit_1by_1name
(JNIEnv *env, jclass clss, jlong grp_id, jstring name, jint idx_type, jint order,
- jobject callback_op, jobject op_data, jlong access_id)
+ jobject callback_op, jobject op_data, jint fields, jlong access_id)
{
herr_t status = -1;
const char *lName;
@@ -478,7 +495,7 @@ Java_hdf_hdf5lib_H5_H5Ovisit_1by_1name
else {
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
- status = H5Ovisit_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5O_iterate_t)H5O_iterate_cb, (void*)op_data, (hid_t)access_id);
+ status = H5Ovisit_by_name2((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5O_iterate_t)H5O_iterate_cb, (void*)op_data, (unsigned)fields, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);