2
0
mirror of https://github.com/HDFGroup/hdf5.git synced 2025-04-24 17:51:25 +08:00

[svn-r30313] HDFFV-9972: unsatisfied link error under debug on Windows.

Added windows name suffix for debug to CMake cmd_arg for examples and test.
Fix issues discovered under debug testing;
   Create a version of H5Iget_name that correctly returns the name.
   Rework PIN_JAVA_STRING macro and usage to eliminate possible memory leaks by using if-else instead of mid-routine return.
   Update example to use new H5Iget_name API.
   
   Tested: windows under debug
This commit is contained in:
Allen Byrne 2016-08-22 12:05:00 -05:00
parent f14e4b3e20
commit 737bb56735
24 changed files with 1628 additions and 1634 deletions

@ -63,7 +63,11 @@ endforeach (HDFJAVA_JAR)
MACRO (ADD_H5_TEST resultfile resultcode)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;")
if (WIN32)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;")
else()
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;")
endif()
endif(CMAKE_BUILD_TYPE MATCHES Debug)
add_test (
NAME JAVA_datasets-${resultfile}

@ -63,7 +63,11 @@ endforeach (HDFJAVA_JAR)
MACRO (ADD_H5_TEST resultfile resultcode)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;")
if (WIN32)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;")
else()
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;")
endif()
endif(CMAKE_BUILD_TYPE MATCHES Debug)
add_test (
NAME JAVA_datatypes-${resultfile}

@ -256,11 +256,10 @@ public class H5Ex_T_ObjectReference {
object_id = H5.H5Rdereference(dataset_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_OBJECT, dset_data[indx]);
object_type = H5.H5Rget_obj_type(dataset_id, HDF5Constants.H5R_OBJECT, dset_data[indx]);
}
String[] obj_name = new String[1];
long name_size = 1;
String obj_name = null;
if (object_type >= 0) {
// Get the length of the name and retrieve the name.
name_size = 1 + H5.H5Iget_name(object_id, obj_name, name_size);
obj_name = H5.H5Iget_name(object_id);
}
if ((object_id >= 0) && (object_type >= -1)) {
switch (H5G_obj.get(object_type)) {
@ -299,8 +298,7 @@ public class H5Ex_T_ObjectReference {
}
}
// Print the name.
if (name_size > 1)
System.out.println(": " + obj_name[0]);
System.out.println(": " + obj_name);
}
catch (Exception e) {
e.printStackTrace();

@ -289,11 +289,10 @@ public class H5Ex_T_ObjectReferenceAttribute {
object_id = H5.H5Rdereference(dataset_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_OBJECT, dset_data[indx]);
object_type = H5.H5Rget_obj_type(dataset_id, HDF5Constants.H5R_OBJECT, dset_data[indx]);
}
String[] obj_name = new String[1];
long name_size = 1;
String obj_name = null;
if (object_type >= 0) {
// Get the length of the name and retrieve the name.
name_size = 1 + H5.H5Iget_name(object_id, obj_name, name_size);
obj_name = H5.H5Iget_name(object_id);
}
if ((object_id >= 0) && (object_type >= -1)) {
switch (H5G_obj.get(object_type)) {
@ -332,8 +331,7 @@ public class H5Ex_T_ObjectReferenceAttribute {
}
}
// Print the name.
if (name_size > 1)
System.out.println(": " + obj_name[0]);
System.out.println(": " + obj_name);
}
catch (Exception e) {
e.printStackTrace();

@ -62,7 +62,11 @@ add_custom_target(H5Ex_G_Visit_files ALL COMMENT "Copying files needed by H5Ex_G
MACRO (ADD_H5_TEST resultfile resultcode)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;")
if (WIN32)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;")
else()
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;")
endif()
endif(CMAKE_BUILD_TYPE MATCHES Debug)
add_test (
NAME JAVA_groups-${resultfile}

@ -64,7 +64,11 @@ endforeach (example ${HDF_JAVA_OBJECT_EXAMPLES})
MACRO (ADD_H5_TEST resultfile resultcode)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;")
if (WIN32)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;")
else()
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;")
endif()
endif(CMAKE_BUILD_TYPE MATCHES Debug)
add_test (
NAME JAVA_intro-${resultfile}

@ -3351,8 +3351,22 @@ public class H5 implements java.io.Serializable {
public synchronized static native long H5Iget_file_id(long obj_id) throws HDF5LibraryException;
@Deprecated
public synchronized static native long H5Iget_name(long obj_id, String[] name, long size)
throws HDF5LibraryException, NullPointerException;
/**
* H5Iget_name_str retrieves the name of an object specified by the identifier, obj_id.
*
* @param obj_id
* IN: Identifier of the object.
*
* @return String for Attribute name.
*
* @exception HDF5LibraryException
* - Error from the HDF-5 Library.
**/
public synchronized static native String H5Iget_name_str(long obj_id)
throws HDF5LibraryException;
public synchronized static native int H5Iget_ref(long obj_id) throws HDF5LibraryException, NullPointerException;

@ -57,6 +57,9 @@ SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF
H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED ${HDF5_JAVA_PACKAGE_SOVERSION})
if (WIN32)
get_filename_component (HDF5_JAVA_JNI_DLL_NAME ${HDF5_JAVA_JNI_LIB_TARGET} NAME_WE)
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (HDF5_JAVA_JNI_DLL_NAME "${HDF5_JAVA_JNI_DLL_NAME}_D")
endif ()
# message (STATUS "HDF5_JAVA_JNI_DLL_NAME: ${HDF5_JAVA_JNI_DLL_NAME}")
if (BUILD_TESTING)
add_custom_target (HDF5_JAVA_JNI-Test-Copy ALL

@ -67,14 +67,15 @@ Java_hdf_hdf5lib_H5__1H5Acreate
hid_t attr_id = -1;
const char *aName;
PIN_JAVA_STRING(name, aName, -1);
PIN_JAVA_STRING(name, aName);
if (aName != NULL) {
attr_id = H5Acreate2((hid_t)loc_id, aName, (hid_t)type_id, (hid_t)space_id, (hid_t)create_plist, (hid_t)H5P_DEFAULT);
attr_id = H5Acreate2((hid_t)loc_id, aName, (hid_t)type_id, (hid_t)space_id, (hid_t)create_plist, (hid_t)H5P_DEFAULT);
UNPIN_JAVA_STRING(name, aName);
UNPIN_JAVA_STRING(name, aName);
if (attr_id < 0)
h5libraryError(env);
if (attr_id < 0)
h5libraryError(env);
}
return (jlong)attr_id;
} /* end Java_hdf_hdf5lib_H5__1H5Acreate */
@ -91,14 +92,15 @@ Java_hdf_hdf5lib_H5__1H5Aopen_1name
hid_t attr_id = -1;
const char *aName;
PIN_JAVA_STRING(name, aName, -1);
PIN_JAVA_STRING(name, aName);
if (aName != NULL) {
attr_id = H5Aopen_name((hid_t)loc_id, aName);
attr_id = H5Aopen_name((hid_t)loc_id, aName);
UNPIN_JAVA_STRING(name,aName);
UNPIN_JAVA_STRING(name,aName);
if (attr_id < 0)
h5libraryError(env);
if (attr_id < 0)
h5libraryError(env);
}
return (jlong)attr_id;
} /* end Java_hdf_hdf5lib_H5__1H5Aopen_1name */
@ -242,8 +244,7 @@ Java_hdf_hdf5lib_H5_H5Aget_1name
ssize_t buf_size;
/* get the length of the name */
buf_size = H5Aget_name((hid_t)attr_id, NULL, 0);
buf_size = H5Aget_name((hid_t)attr_id, 0, NULL);
if (buf_size <= 0) {
h5badArgument(env, "H5Aget_name: buf_size <= 0");
} /* end if */
@ -299,14 +300,15 @@ Java_hdf_hdf5lib_H5_H5Adelete
herr_t status = -1;
const char *aName;
PIN_JAVA_STRING(name, aName, -1);
PIN_JAVA_STRING(name, aName);
if (aName != NULL) {
status = H5Adelete((hid_t)loc_id, aName);
status = H5Adelete((hid_t)loc_id, aName);
UNPIN_JAVA_STRING(name, aName);
UNPIN_JAVA_STRING(name, aName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Adelete */
@ -344,15 +346,16 @@ Java_hdf_hdf5lib_H5__1H5Acreate2
hid_t status = -1;
const char *aName;
PIN_JAVA_STRING(name, aName, -1);
PIN_JAVA_STRING(name, aName);
if (aName != NULL) {
status = H5Acreate2((hid_t)loc_id, aName, (hid_t)type_id,
(hid_t)space_id, (hid_t)create_plist, (hid_t)access_plist );
status = H5Acreate2((hid_t)loc_id, aName, (hid_t)type_id,
(hid_t)space_id, (hid_t)create_plist, (hid_t)access_plist );
UNPIN_JAVA_STRING(name, aName);
UNPIN_JAVA_STRING(name, aName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
return (jlong)status;
} /* end Java_hdf_hdf5lib_H5__1H5Acreate2 */
@ -371,14 +374,15 @@ Java_hdf_hdf5lib_H5__1H5Aopen
hid_t retVal = -1;
const char *aName;
PIN_JAVA_STRING(name, aName, -1);
PIN_JAVA_STRING(name, aName);
if (aName != NULL) {
retVal = H5Aopen((hid_t)obj_id, aName, (hid_t)access_plist);
retVal = H5Aopen((hid_t)obj_id, aName, (hid_t)access_plist);
UNPIN_JAVA_STRING(name, aName);
UNPIN_JAVA_STRING(name, aName);
if (retVal < 0)
h5libraryError(env);
if (retVal < 0)
h5libraryError(env);
}
return (jlong)retVal;
} /* end Java_hdf_hdf5lib_H5__1H5Aopen */
@ -395,15 +399,16 @@ Java_hdf_hdf5lib_H5__1H5Aopen_1by_1idx
hid_t retVal = -1;
const char *aName;
PIN_JAVA_STRING(name, aName, -1);
PIN_JAVA_STRING(name, aName);
if (aName != NULL) {
retVal = H5Aopen_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type,
(H5_iter_order_t)order, (hsize_t)n, (hid_t)aapl_id, (hid_t)lapl_id);
retVal = H5Aopen_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type,
(H5_iter_order_t)order, (hsize_t)n, (hid_t)aapl_id, (hid_t)lapl_id);
UNPIN_JAVA_STRING(name, aName);
UNPIN_JAVA_STRING(name, aName);
if (retVal < 0)
h5libraryError(env);
if (retVal < 0)
h5libraryError(env);
}
return (jlong)retVal;
} /* end Java_hdf_hdf5lib_H5__1H5Aopen_1by_1idx */
@ -421,15 +426,16 @@ Java_hdf_hdf5lib_H5__1H5Acreate_1by_1name
const char *aName;
const char *attrName;
PIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName, -1);
PIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName);
if (aName != NULL && attrName != NULL) {
retVal = H5Acreate_by_name((hid_t)loc_id, aName, attrName, (hid_t)type_id,
(hid_t)space_id, (hid_t)acpl_id, (hid_t)aapl_id, (hid_t)lapl_id);
retVal = H5Acreate_by_name((hid_t)loc_id, aName, attrName, (hid_t)type_id,
(hid_t)space_id, (hid_t)acpl_id, (hid_t)aapl_id, (hid_t)lapl_id);
UNPIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName);
UNPIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName);
if (retVal < 0)
h5libraryError(env);
if (retVal < 0)
h5libraryError(env);
}
return (jlong)retVal;
} /* end Java_hdf_hdf5lib_H5__1H5Acreate_1by_1name */
@ -443,20 +449,23 @@ JNIEXPORT jboolean JNICALL
Java_hdf_hdf5lib_H5_H5Aexists_1by_1name
(JNIEnv *env, jclass clss, jlong loc_id, jstring obj_name, jstring attr_name, jlong lapl_id)
{
htri_t retVal = -1;
htri_t bval = JNI_FALSE;
const char *aName;
const char *attrName;
PIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName, JNI_FALSE);
PIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName);
if (aName != NULL && attrName != NULL) {
bval = H5Aexists_by_name((hid_t)loc_id, aName, attrName, (hid_t)lapl_id);
retVal = H5Aexists_by_name((hid_t)loc_id, aName, attrName, (hid_t)lapl_id);
UNPIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName);
UNPIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName);
if (bval > 0)
bval = JNI_TRUE;
else if (bval < 0)
h5libraryError(env);
}
if (retVal < 0)
h5libraryError(env);
return (jboolean)retVal;
return (jboolean)bval;
} /* end Java_hdf_hdf5lib_H5_H5Aexists_1by_1name */
/*
@ -472,14 +481,15 @@ Java_hdf_hdf5lib_H5_H5Arename
const char *oName;
const char *nName;
PIN_JAVA_STRING_TWO(old_attr_name, oName, new_attr_name, nName, -1);
PIN_JAVA_STRING_TWO(old_attr_name, oName, new_attr_name, nName);
if (oName != NULL && nName != NULL) {
retVal = H5Arename((hid_t)loc_id, oName, nName);
retVal = H5Arename((hid_t)loc_id, oName, nName);
UNPIN_JAVA_STRING_TWO(old_attr_name, oName, new_attr_name, nName);
UNPIN_JAVA_STRING_TWO(old_attr_name, oName, new_attr_name, nName);
if (retVal < 0)
h5libraryError(env);
if (retVal < 0)
h5libraryError(env);
}
return (jint)retVal;
} /* end Java_hdf_hdf5lib_H5_H5Arename */
@ -499,14 +509,15 @@ Java_hdf_hdf5lib_H5_H5Arename_1by_1name
const char *oName;
const char *nName;
PIN_JAVA_STRING_THREE(obj_name, aName, old_attr_name, oName, new_attr_name, nName, -1);
PIN_JAVA_STRING_THREE(obj_name, aName, old_attr_name, oName, new_attr_name, nName);
if (aName != NULL && oName != NULL && nName != NULL) {
retVal = H5Arename_by_name((hid_t)loc_id, aName, oName, nName, (hid_t)lapl_id);
retVal = H5Arename_by_name((hid_t)loc_id, aName, oName, nName, (hid_t)lapl_id);
UNPIN_JAVA_STRING_THREE(obj_name, aName, old_attr_name, oName, new_attr_name, nName);
UNPIN_JAVA_STRING_THREE(obj_name, aName, old_attr_name, oName, new_attr_name, nName);
if (retVal < 0)
h5libraryError(env);
if (retVal < 0)
h5libraryError(env);
}
return (jint)retVal;
} /* end Java_hdf_hdf5lib_H5_H5Arename_1by_1name */
@ -526,44 +537,45 @@ Java_hdf_hdf5lib_H5_H5Aget_1name_1by_1idx
jstring str = NULL;
const char *aName;
PIN_JAVA_STRING(obj_name, aName, NULL);
PIN_JAVA_STRING(obj_name, aName);
if (aName != NULL) {
/* get the length of the attribute name */
status_size = H5Aget_name_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type,
(H5_iter_order_t) order, (hsize_t) n, (char*)NULL, (size_t)0, (hid_t)lapl_id);
/* get the length of the attribute name */
status_size = H5Aget_name_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type,
(H5_iter_order_t) order, (hsize_t) n, (char*)NULL, (size_t)0, (hid_t)lapl_id);
if(status_size < 0) {
UNPIN_JAVA_STRING(obj_name, aName);
h5libraryError(env);
} /* end if */
else {
buf_size = (size_t)status_size + 1;/* add extra space for the null terminator */
aValue = (char*)HDmalloc(sizeof(char) * buf_size);
if (aValue == NULL) {
if(status_size < 0) {
UNPIN_JAVA_STRING(obj_name, aName);
h5outOfMemory(env, "H5Aget_name_by_idx: malloc failed ");
h5libraryError(env);
} /* end if */
else {
status_size = H5Aget_name_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type,
(H5_iter_order_t) order, (hsize_t) n, (char*)aValue, (size_t)buf_size, (hid_t)lapl_id);
buf_size = (size_t)status_size + 1;/* add extra space for the null terminator */
UNPIN_JAVA_STRING(obj_name, aName);
if (status_size < 0) {
HDfree(aValue);
h5libraryError(env);
aValue = (char*)HDmalloc(sizeof(char) * buf_size);
if (aValue == NULL) {
UNPIN_JAVA_STRING(obj_name, aName);
h5outOfMemory(env, "H5Aget_name_by_idx: malloc failed ");
} /* end if */
else {
str = ENVPTR->NewStringUTF(ENVPAR aValue);
HDfree(aValue);
if (str == NULL) {
/* exception -- fatal JNI error */
h5JNIFatalError(env, "H5Aget_name_by_idx: return string not created");
status_size = H5Aget_name_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type,
(H5_iter_order_t) order, (hsize_t) n, (char*)aValue, (size_t)buf_size, (hid_t)lapl_id);
UNPIN_JAVA_STRING(obj_name, aName);
if (status_size < 0) {
HDfree(aValue);
h5libraryError(env);
} /* end if */
else {
str = ENVPTR->NewStringUTF(ENVPAR aValue);
HDfree(aValue);
if (str == NULL) {
/* exception -- fatal JNI error */
h5JNIFatalError(env, "H5Aget_name_by_idx: return string not created");
} /* end if */
} /* end else */
} /* end else */
} /* end else */
} /* end else */
}
return str;
} /* end Java_hdf_hdf5lib_H5_H5Aget_1name_1by_1idx */
@ -628,23 +640,24 @@ Java_hdf_hdf5lib_H5_H5Aget_1info_1by_1idx
jobject ret_obj = NULL;
const char *aName;
PIN_JAVA_STRING(obj_name, aName, NULL);
PIN_JAVA_STRING(obj_name, aName);
if (aName != NULL) {
status = H5Aget_info_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type,
(H5_iter_order_t)order, (hsize_t)n, &ainfo, (hid_t)lapl_id);
status = H5Aget_info_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type,
(H5_iter_order_t)order, (hsize_t)n, &ainfo, (hid_t)lapl_id);
UNPIN_JAVA_STRING(obj_name, aName);
UNPIN_JAVA_STRING(obj_name, aName);
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
args[0].z = ainfo.corder_valid;
args[1].j = ainfo.corder;
args[2].i = ainfo.cset;
args[3].j = (jlong)ainfo.data_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5A_info_t", "(ZJIJ)V", args);
} /* end else */
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
args[0].z = ainfo.corder_valid;
args[1].j = ainfo.corder;
args[2].i = ainfo.cset;
args[3].j = (jlong)ainfo.data_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5A_info_t", "(ZJIJ)V", args);
} /* end else */
}
return ret_obj;
} /* end Java_hdf_hdf5lib_H5_H5Aget_1info_1by_1idx */
@ -664,22 +677,23 @@ Java_hdf_hdf5lib_H5_H5Aget_1info_1by_1name
jvalue args[4];
jobject ret_obj = NULL;
PIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName, NULL);
PIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName);
if (aName != NULL && attrName != NULL) {
status = H5Aget_info_by_name((hid_t)loc_id, aName, attrName, &ainfo, (hid_t)lapl_id);
status = H5Aget_info_by_name((hid_t)loc_id, aName, attrName, &ainfo, (hid_t)lapl_id);
UNPIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName);
UNPIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName);
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
args[0].z = ainfo.corder_valid;
args[1].j = ainfo.corder;
args[2].i = ainfo.cset;
args[3].j = (jlong)ainfo.data_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5A_info_t", "(ZJIJ)V", args);
} /* end else */
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
args[0].z = ainfo.corder_valid;
args[1].j = ainfo.corder;
args[2].i = ainfo.cset;
args[3].j = (jlong)ainfo.data_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5A_info_t", "(ZJIJ)V", args);
} /* end else */
}
return ret_obj;
} /* end Java_hdf_hdf5lib_H5_H5Aget_1info_1by_1name */
@ -696,14 +710,15 @@ Java_hdf_hdf5lib_H5_H5Adelete_1by_1name
const char *aName;
const char *attrName;
PIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName, -1);
PIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName);
if (aName != NULL && attrName != NULL) {
retVal = H5Adelete_by_name((hid_t)loc_id, aName, attrName, (hid_t)lapl_id);
retVal = H5Adelete_by_name((hid_t)loc_id, aName, attrName, (hid_t)lapl_id);
UNPIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName);
UNPIN_JAVA_STRING_TWO(obj_name, aName, attr_name, attrName);
if (retVal < 0)
h5libraryError(env);
if (retVal < 0)
h5libraryError(env);
}
return (jint)retVal;
} /* end Java_hdf_hdf5lib_H5_H5Adelete_1by_1name */
@ -720,16 +735,17 @@ Java_hdf_hdf5lib_H5_H5Aexists
htri_t bval = JNI_FALSE;
const char *aName;
PIN_JAVA_STRING(attr_name, aName, JNI_FALSE);
PIN_JAVA_STRING(attr_name, aName);
if (aName != NULL) {
bval = H5Aexists((hid_t)obj_id, aName);
bval = H5Aexists((hid_t)obj_id, aName);
UNPIN_JAVA_STRING(attr_name, aName);
UNPIN_JAVA_STRING(attr_name, aName);
if (bval > 0)
bval = JNI_TRUE;
else if (bval < 0)
h5libraryError(env);
if (bval > 0)
bval = JNI_TRUE;
else if (bval < 0)
h5libraryError(env);
}
return (jboolean)bval;
} /* end Java_hdf_hdf5lib_H5_H5Aexists */
@ -746,14 +762,15 @@ Java_hdf_hdf5lib_H5_H5Adelete_1by_1idx
herr_t status = -1;
const char *aName;
PIN_JAVA_STRING0(obj_name, aName);
PIN_JAVA_STRING(obj_name, aName);
if (aName != NULL) {
status = H5Adelete_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t)n, (hid_t)lapl_id);
status = H5Adelete_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t)n, (hid_t)lapl_id);
UNPIN_JAVA_STRING(obj_name, aName);
UNPIN_JAVA_STRING(obj_name, aName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end Java_hdf_hdf5lib_H5_H5Adelete_1by_1idx */
/*
@ -770,14 +787,15 @@ Java_hdf_hdf5lib_H5__1H5Aopen_1by_1name
const char *aName;
const char *oName;
PIN_JAVA_STRING_TWO(obj_name, oName, attr_name, aName, -1);
PIN_JAVA_STRING_TWO(obj_name, oName, attr_name, aName);
if (oName != NULL && aName != NULL) {
status = H5Aopen_by_name((hid_t)loc_id, oName, aName, (hid_t)aapl_id, (hid_t)lapl_id);
status = H5Aopen_by_name((hid_t)loc_id, oName, aName, (hid_t)aapl_id, (hid_t)lapl_id);
UNPIN_JAVA_STRING_TWO(obj_name, oName, attr_name, aName);
UNPIN_JAVA_STRING_TWO(obj_name, oName, attr_name, aName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
return (jlong)status;
} /* end Java_hdf_hdf5lib_H5__1H5Aopen_1by_1name */
@ -892,14 +910,15 @@ Java_hdf_hdf5lib_H5_H5Aiterate_1by_1name
h5nullArgument(env, "H5Literate_by_name: op_data or callback_op is NULL");
} /* end if */
else {
PIN_JAVA_STRING(name, lName, -1);
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
status = H5Aiterate_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5A_operator2_t)H5A_iterate_cb, (void*)op_data, (hid_t)access_id);
status = H5Aiterate_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5A_operator2_t)H5A_iterate_cb, (void*)op_data, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
UNPIN_JAVA_STRING(name, lName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end else */
return (jint)status;

@ -161,14 +161,15 @@ Java_hdf_hdf5lib_H5__1H5Dcreate
hid_t dset_id = -1;
const char *fileName;
PIN_JAVA_STRING(name, fileName, -1);
PIN_JAVA_STRING(name, fileName);
if (fileName != NULL) {
dset_id = H5Dcreate2((hid_t)loc_id, fileName, (hid_t)type_id, (hid_t)space_id, H5P_DEFAULT, (hid_t)create_plist_id, H5P_DEFAULT);
dset_id = H5Dcreate2((hid_t)loc_id, fileName, (hid_t)type_id, (hid_t)space_id, H5P_DEFAULT, (hid_t)create_plist_id, H5P_DEFAULT);
UNPIN_JAVA_STRING(name, fileName);
UNPIN_JAVA_STRING(name, fileName);
if (dset_id < 0)
h5libraryError(env);
if (dset_id < 0)
h5libraryError(env);
}
return (jlong)dset_id;
} /* end Java_hdf_hdf5lib_H5__1H5Dcreate */
@ -185,13 +186,14 @@ Java_hdf_hdf5lib_H5__1H5Dopen
hid_t dset_id = -1;
const char *fileName;
PIN_JAVA_STRING(name, fileName, -1);
PIN_JAVA_STRING(name, fileName);
if (fileName != NULL) {
dset_id = H5Dopen2((hid_t)loc_id, fileName, H5P_DEFAULT);
dset_id = H5Dopen2((hid_t)loc_id, fileName, H5P_DEFAULT);
UNPIN_JAVA_STRING(name, fileName);
if (dset_id < 0)
h5libraryError(env);
UNPIN_JAVA_STRING(name, fileName);
if (dset_id < 0)
h5libraryError(env);
}
return (jlong)dset_id;
} /* end Java_hdf_hdf5lib_H5__1H5Dopen */
@ -285,7 +287,7 @@ Java_hdf_hdf5lib_H5_H5Dread
(JNIEnv *env, jclass clss, jlong dataset_id, jlong mem_type_id, jlong mem_space_id,
jlong file_space_id, jlong xfer_plist_id, jbyteArray buf, jboolean isCriticalPinning)
{
herr_t status;
herr_t status = -1;
jbyte *buffP;
jboolean isCopy;
htri_t data_class;
@ -341,7 +343,7 @@ Java_hdf_hdf5lib_H5_H5Dwrite
(JNIEnv *env, jclass clss, jlong dataset_id, jlong mem_type_id, jlong mem_space_id,
jlong file_space_id, jlong xfer_plist_id, jbyteArray buf, jboolean isCriticalPinning)
{
herr_t status;
herr_t status = -1;
jbyte *buffP;
jboolean isCopy;
htri_t data_class;
@ -1445,13 +1447,14 @@ Java_hdf_hdf5lib_H5__1H5Dcreate2
hid_t dset_id = -1;
const char *fileName;
PIN_JAVA_STRING(name, fileName, -1);
PIN_JAVA_STRING(name, fileName);
if (fileName != NULL) {
dset_id = H5Dcreate2((hid_t)loc_id, fileName, (hid_t)type_id, (hid_t)space_id, (hid_t)link_plist_id, (hid_t)create_plist_id, (hid_t)access_plist_id);
dset_id = H5Dcreate2((hid_t)loc_id, fileName, (hid_t)type_id, (hid_t)space_id, (hid_t)link_plist_id, (hid_t)create_plist_id, (hid_t)access_plist_id);
UNPIN_JAVA_STRING(name, fileName);
if (dset_id < 0)
h5libraryError(env);
UNPIN_JAVA_STRING(name, fileName);
if (dset_id < 0)
h5libraryError(env);
}
return (jlong)dset_id;
} /* end Java_hdf_hdf5lib_H5__1H5Dcreate2 */
@ -1465,16 +1468,17 @@ JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5__1H5Dopen2
(JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong access_plist)
{
hid_t dset_id;
hid_t dset_id = -1;
const char *fileName;
PIN_JAVA_STRING(name, fileName, -1);
PIN_JAVA_STRING(name, fileName);
if (fileName != NULL) {
dset_id = H5Dopen2((hid_t)loc_id, fileName, (hid_t)access_plist);
dset_id = H5Dopen2((hid_t)loc_id, fileName, (hid_t)access_plist);
UNPIN_JAVA_STRING(name, fileName);
if (dset_id < 0)
h5libraryError(env);
UNPIN_JAVA_STRING(name, fileName);
if (dset_id < 0)
h5libraryError(env);
}
return (jlong)dset_id;
} /* end Java_hdf_hdf5lib_H5__1H5Dopen2 */
@ -1585,39 +1589,40 @@ Java_hdf_hdf5lib_H5_H5Dfill
if (buf == NULL) {
h5nullArgument(env, "H5Dfill: buf is NULL");
return;
} /* end if */
buffP = ENVPTR->GetByteArrayElements(ENVPAR buf, &isCopy2);
if (buffP == NULL) {
h5JNIFatalError(env, "H5Dfill: buf not pinned");
return;
} /* end if */
if(fill) {
fillP = ENVPTR->GetByteArrayElements(ENVPAR fill, &isCopy1);
if (fillP == NULL) {
ENVPTR->ReleaseByteArrayElements(ENVPAR buf, buffP, JNI_ABORT);
h5JNIFatalError( env, "H5Dfill: fill not pinned");
return;
} /* end if */
} /* end if */
else
fillP = NULL;
status = H5Dfill((const void*)fillP, (hid_t)fill_type_id, (void*)buffP, (hid_t)buf_type_id, (hid_t)space_id);
if(fillP) {
/* free the buffer without copying back */
/* end if */ ENVPTR->ReleaseByteArrayElements(ENVPAR fill, fillP, JNI_ABORT);
}
if (status < 0) {
ENVPTR->ReleaseByteArrayElements(ENVPAR buf, buffP, JNI_ABORT);
h5libraryError(env);
} /* end if */
else {
if (isCopy2 == JNI_TRUE) {
ENVPTR->ReleaseByteArrayElements(ENVPAR buf, buffP, 0);
buffP = ENVPTR->GetByteArrayElements(ENVPAR buf, &isCopy2);
if (buffP == NULL) {
h5JNIFatalError(env, "H5Dfill: buf not pinned");
} /* end if */
} /* end else */
else {
if(fill) {
fillP = ENVPTR->GetByteArrayElements(ENVPAR fill, &isCopy1);
if (fillP == NULL) {
ENVPTR->ReleaseByteArrayElements(ENVPAR buf, buffP, JNI_ABORT);
h5JNIFatalError( env, "H5Dfill: fill not pinned");
return;
} /* end if */
} /* end if */
else
fillP = NULL;
status = H5Dfill((const void*)fillP, (hid_t)fill_type_id, (void*)buffP, (hid_t)buf_type_id, (hid_t)space_id);
if(fillP) {
/* free the buffer without copying back */
ENVPTR->ReleaseByteArrayElements(ENVPAR fill, fillP, JNI_ABORT);
} /* end if */
if (status < 0) {
ENVPTR->ReleaseByteArrayElements(ENVPAR buf, buffP, JNI_ABORT);
h5libraryError(env);
} /* end if */
else {
if (isCopy2 == JNI_TRUE) {
ENVPTR->ReleaseByteArrayElements(ENVPAR buf, buffP, 0);
} /* end if */
} /* end else */
}
}
} /* end Java_hdf_hdf5lib_H5_H5Dfill */
/*
@ -1638,35 +1643,35 @@ Java_hdf_hdf5lib_H5_H5Dset_1extent
if (buf == NULL) {
h5nullArgument(env, "H5Dset_extent: buf is NULL");
return;
} /* end if */
rank = ENVPTR->GetArrayLength(ENVPAR buf);
if (rank <= 0) {
h5JNIFatalError(env, "H5Dset_extent: rank <=0");
} /* end if */
else {
buffP = ENVPTR->GetLongArrayElements(ENVPAR buf, &isCopy);
if (buffP == NULL) {
h5JNIFatalError( env, "H5Dset_extent: buf not pinned");
rank = ENVPTR->GetArrayLength(ENVPAR buf);
if (rank <= 0) {
h5JNIFatalError(env, "H5Dset_extent: rank <=0");
} /* end if */
else {
dims = (hsize_t*)HDmalloc((size_t)rank * sizeof(hsize_t));
for (i = 0; i< rank; i++)
dims[i] = (hsize_t)buffP[i];
status = H5Dset_extent((hid_t)loc_id, (hsize_t*)dims);
HDfree (dims);
/* free the buffer without copying back */
ENVPTR->ReleaseLongArrayElements(ENVPAR buf, buffP, JNI_ABORT);
if (status < 0) {
h5libraryError(env);
buffP = ENVPTR->GetLongArrayElements(ENVPAR buf, &isCopy);
if (buffP == NULL) {
h5JNIFatalError( env, "H5Dset_extent: buf not pinned");
} /* end if */
else {
dims = (hsize_t*)HDmalloc((size_t)rank * sizeof(hsize_t));
for (i = 0; i< rank; i++)
dims[i] = (hsize_t)buffP[i];
status = H5Dset_extent((hid_t)loc_id, (hsize_t*)dims);
HDfree (dims);
/* free the buffer without copying back */
ENVPTR->ReleaseLongArrayElements(ENVPAR buf, buffP, JNI_ABORT);
if (status < 0) {
h5libraryError(env);
} /* end if */
} /* end else */
} /* end else */
} /* end else */
}
} /* end Java_hdf_hdf5lib_H5_H5Dset_1extent */
static herr_t
@ -1747,34 +1752,32 @@ Java_hdf_hdf5lib_H5_H5Diterate
if (op_data == NULL) {
h5nullArgument(env, "H5Diterate: op_data is NULL");
return -1;
} /* end if */
if (callback_op == NULL) {
else if (callback_op == NULL) {
h5nullArgument(env, "H5Diterate: callback_op is NULL");
return -1;
} /* end if */
if (buf == NULL) {
else if (buf == NULL) {
h5nullArgument(env, "H5Diterate: buf is NULL");
return -1;
} /* end if */
buffP = ENVPTR->GetByteArrayElements(ENVPAR buf, &isCopy);
if (buffP == NULL) {
h5JNIFatalError(env, "H5Diterate: buf not pinned");
} /* end if */
else {
status = H5Diterate((void*)buffP, (hid_t)buf_type, (hid_t)space, (H5D_operator_t)H5D_iterate_cb, (void*)op_data);
if (status < 0) {
ENVPTR->ReleaseByteArrayElements(ENVPAR buf, buffP, JNI_ABORT);
h5libraryError(env);
buffP = ENVPTR->GetByteArrayElements(ENVPAR buf, &isCopy);
if (buffP == NULL) {
h5JNIFatalError(env, "H5Diterate: buf not pinned");
} /* end if */
else {
if (isCopy == JNI_TRUE) {
ENVPTR->ReleaseByteArrayElements(ENVPAR buf, buffP, 0);
status = H5Diterate((void*)buffP, (hid_t)buf_type, (hid_t)space, (H5D_operator_t)H5D_iterate_cb, (void*)op_data);
if (status < 0) {
ENVPTR->ReleaseByteArrayElements(ENVPAR buf, buffP, JNI_ABORT);
h5libraryError(env);
} /* end if */
else {
if (isCopy == JNI_TRUE) {
ENVPTR->ReleaseByteArrayElements(ENVPAR buf, buffP, 0);
} /* end if */
} /* end else */
} /* end else */
} /* end else */
}
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Diterate */

@ -98,14 +98,15 @@ Java_hdf_hdf5lib_H5_H5Eregister_1class
const char* the_lib_name;
const char* the_version;
PIN_JAVA_STRING_THREE(cls_name, the_cls_name, lib_name, the_lib_name, version, the_version, -1);
PIN_JAVA_STRING_THREE(cls_name, the_cls_name, lib_name, the_lib_name, version, the_version);
if (the_cls_name != NULL && the_lib_name != NULL && the_version != NULL) {
ret_val = H5Eregister_class(the_cls_name, the_lib_name, the_version);
ret_val = H5Eregister_class(the_cls_name, the_lib_name, the_version);
UNPIN_JAVA_STRING_THREE(cls_name, the_cls_name, lib_name, the_lib_name, version, the_version);
UNPIN_JAVA_STRING_THREE(cls_name, the_cls_name, lib_name, the_lib_name, version, the_version);
if (ret_val < 0)
h5libraryError(env);
if (ret_val < 0)
h5libraryError(env);
}
return (jlong)ret_val;
} /* end Java_hdf_hdf5lib_H5_H5Eregister_1class */
@ -159,14 +160,15 @@ Java_hdf_hdf5lib_H5_H5Ecreate_1msg
h5badArgument(env, "H5Ecreate_msg: invalid argument");
} /* end if */
else {
PIN_JAVA_STRING(err_msg, the_err_msg, -1);
PIN_JAVA_STRING(err_msg, the_err_msg);
if (the_err_msg != NULL) {
ret_val = H5Ecreate_msg((hid_t)err_id, error_msg_type, the_err_msg);
ret_val = H5Ecreate_msg((hid_t)err_id, error_msg_type, the_err_msg);
UNPIN_JAVA_STRING(err_msg, the_err_msg);
UNPIN_JAVA_STRING(err_msg, the_err_msg);
if (ret_val < 0)
h5libraryError(env);
if (ret_val < 0)
h5libraryError(env);
}
} /* end else */
return (jlong)ret_val;
@ -305,7 +307,7 @@ Java_hdf_hdf5lib_H5_H5Eget_1class_1name
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Eset_1current_1stack
(JNIEnv *env, jclass cls, jlong stk_id)
(JNIEnv *env, jclass cls, jlong stk_id)
{
if (stk_id < 0) {
h5badArgument(env, "H5Eset_current_stack: invalid argument");
@ -358,15 +360,16 @@ Java_hdf_hdf5lib_H5_H5Epush2
h5badArgument(env, "H5Epush: invalid minor_id argument");
} /* end else if */
else {
PIN_JAVA_STRING_THREE0(filename, fName, funcname, fncName, err_desc, errMsg);
PIN_JAVA_STRING_THREE(filename, fName, funcname, fncName, err_desc, errMsg);
if (fName != NULL && fncName != NULL && errMsg != NULL) {
ret_val = H5Epush2((hid_t)stk_id, fName, fncName, (unsigned)linenumber, (hid_t)class_id,
(hid_t)major_id, (hid_t)minor_id, errMsg);
ret_val = H5Epush2((hid_t)stk_id, fName, fncName, (unsigned)linenumber, (hid_t)class_id,
(hid_t)major_id, (hid_t)minor_id, errMsg);
UNPIN_JAVA_STRING_THREE(filename, fName, funcname, fncName, err_desc, errMsg);
UNPIN_JAVA_STRING_THREE(filename, fName, funcname, fncName, err_desc, errMsg);
if (ret_val < 0)
h5libraryError(env);
if (ret_val < 0)
h5libraryError(env);
}
} /* end else */
} /* end Java_hdf_hdf5lib_H5_H5Epush2 */

@ -45,14 +45,15 @@ Java_hdf_hdf5lib_H5__1H5Fopen
hid_t status = -1;
const char *fileName;
PIN_JAVA_STRING(name, fileName, -1);
PIN_JAVA_STRING(name, fileName);
if (fileName != NULL) {
status = H5Fopen(fileName, (unsigned)flags, (hid_t)access_id );
status = H5Fopen(fileName, (unsigned)flags, (hid_t)access_id );
UNPIN_JAVA_STRING(name, fileName);
UNPIN_JAVA_STRING(name, fileName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
return (jlong)status;
} /* end Java_hdf_hdf5lib_H5__1H5Fopen */
@ -69,14 +70,15 @@ Java_hdf_hdf5lib_H5__1H5Fcreate
hid_t status = -1;
const char *fileName;
PIN_JAVA_STRING(name, fileName, -1);
PIN_JAVA_STRING(name, fileName);
if (fileName != NULL) {
status = H5Fcreate(fileName, (unsigned)flags, create_id, access_id);
status = H5Fcreate(fileName, (unsigned)flags, create_id, access_id);
UNPIN_JAVA_STRING(name, fileName);
UNPIN_JAVA_STRING(name, fileName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
return (jlong)status;
} /* end Java_hdf_hdf5lib_H5__1H5Fcreate */
@ -152,16 +154,17 @@ Java_hdf_hdf5lib_H5_H5Fis_1hdf5
htri_t bval = JNI_FALSE;
const char *fileName;
PIN_JAVA_STRING(name, fileName, JNI_FALSE);
PIN_JAVA_STRING(name, fileName);
if (fileName != NULL) {
bval = H5Fis_hdf5(fileName);
bval = H5Fis_hdf5(fileName);
UNPIN_JAVA_STRING(name, fileName);
UNPIN_JAVA_STRING(name, fileName);
if (bval > 0)
bval = JNI_TRUE;
else if (bval < 0)
h5libraryError(env);
if (bval > 0)
bval = JNI_TRUE;
else if (bval < 0)
h5libraryError(env);
}
return (jboolean)bval;
} /* end Java_hdf_hdf5lib_H5_H5Fis_1hdf5 */
@ -251,14 +254,15 @@ Java_hdf_hdf5lib_H5_H5Fmount
herr_t status = -1;
const char *fileName;
PIN_JAVA_STRING(name, fileName, -1);
PIN_JAVA_STRING(name, fileName);
if (fileName != NULL) {
status = H5Fmount((hid_t)loc_id, fileName, (hid_t)child_id, (hid_t)plist_id);
status = H5Fmount((hid_t)loc_id, fileName, (hid_t)child_id, (hid_t)plist_id);
UNPIN_JAVA_STRING(name, fileName);
UNPIN_JAVA_STRING(name, fileName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Fmount */
@ -275,14 +279,15 @@ Java_hdf_hdf5lib_H5_H5Funmount
herr_t status = -1;
const char *fileName;
PIN_JAVA_STRING(name, fileName, -1);
PIN_JAVA_STRING(name, fileName);
if (fileName != NULL) {
status = H5Funmount((hid_t)loc_id, fileName);
status = H5Funmount((hid_t)loc_id, fileName);
UNPIN_JAVA_STRING(name, fileName);
UNPIN_JAVA_STRING(name, fileName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Funmount */

@ -69,33 +69,30 @@ create_H5G_info_t
jclass cls;
jboolean jmounted;
jint storage_type;
jobject obj;
jobject obj = NULL;
jfieldID fid_storage_type, fid_nlinks, fid_max_corder, fid_mounted;
cls = ENVPTR->FindClass(ENVPAR "hdf/hdf5lib/structs/H5G_info_t");
if (cls == NULL)
return NULL;
obj = ENVPTR->AllocObject(ENVPAR cls);
if (obj == NULL)
return NULL;
fid_storage_type = ENVPTR->GetFieldID(ENVPAR cls, "storage_type", "I");
fid_nlinks = ENVPTR->GetFieldID(ENVPAR cls, "nlinks", "J");
fid_max_corder = ENVPTR->GetFieldID(ENVPAR cls, "max_corder", "J");
fid_mounted = ENVPTR->GetFieldID(ENVPAR cls, "mounted", "Z");
if (fid_storage_type==NULL || fid_nlinks==NULL || fid_max_corder==NULL || fid_mounted == NULL)
return NULL;
jmounted = (group_info.mounted==0) ? JNI_FALSE : JNI_TRUE;
storage_type = (jint)group_info.storage_type;
ENVPTR->SetIntField(ENVPAR obj, fid_storage_type, (jint)storage_type);
ENVPTR->SetLongField(ENVPAR obj, fid_nlinks, (jlong)group_info.nlinks);
ENVPTR->SetLongField(ENVPAR obj, fid_max_corder, (jlong)group_info.max_corder);
ENVPTR->SetBooleanField(ENVPAR obj, fid_mounted, jmounted);
if (cls != NULL) {
obj = ENVPTR->AllocObject(ENVPAR cls);
if (obj != NULL) {
if ((fid_storage_type = ENVPTR->GetFieldID(ENVPAR cls, "storage_type", "I")) != NULL) {
if ((fid_nlinks = ENVPTR->GetFieldID(ENVPAR cls, "nlinks", "J")) != NULL) {
if ((fid_max_corder = ENVPTR->GetFieldID(ENVPAR cls, "max_corder", "J")) != NULL) {
if ((fid_mounted = ENVPTR->GetFieldID(ENVPAR cls, "mounted", "Z")) != NULL) {
jmounted = (group_info.mounted==0) ? JNI_FALSE : JNI_TRUE;
storage_type = (jint)group_info.storage_type;
ENVPTR->SetIntField(ENVPAR obj, fid_storage_type, (jint)storage_type);
ENVPTR->SetLongField(ENVPAR obj, fid_nlinks, (jlong)group_info.nlinks);
ENVPTR->SetLongField(ENVPAR obj, fid_max_corder, (jlong)group_info.max_corder);
ENVPTR->SetBooleanField(ENVPAR obj, fid_mounted, jmounted);
}
}
}
}
}
}
return obj;
} /* end create_H5G_info_t */
@ -112,13 +109,14 @@ Java_hdf_hdf5lib_H5__1H5Gcreate2
hid_t group_id = -1;
const char *gName;
PIN_JAVA_STRING(name, gName, -1);
PIN_JAVA_STRING(name, gName);
if (gName != NULL) {
group_id = H5Gcreate2((hid_t)loc_id, gName, (hid_t)link_plist_id, (hid_t)create_plist_id, (hid_t)access_plist_id );
group_id = H5Gcreate2((hid_t)loc_id, gName, (hid_t)link_plist_id, (hid_t)create_plist_id, (hid_t)access_plist_id );
UNPIN_JAVA_STRING(name, gName);
if (group_id < 0)
h5libraryError(env);
UNPIN_JAVA_STRING(name, gName);
if (group_id < 0)
h5libraryError(env);
}
return (jlong)group_id;
} /* end Java_hdf_hdf5lib_H5__1H5Gcreate2 */
@ -153,14 +151,15 @@ Java_hdf_hdf5lib_H5__1H5Gopen2
hid_t group_id = -1;
const char *gName;
PIN_JAVA_STRING(name, gName, -1);
PIN_JAVA_STRING(name, gName);
if (gName != NULL) {
group_id = H5Gopen2((hid_t)loc_id, gName, (hid_t)access_plist_id );
group_id = H5Gopen2((hid_t)loc_id, gName, (hid_t)access_plist_id );
UNPIN_JAVA_STRING(name, gName);
UNPIN_JAVA_STRING(name, gName);
if (group_id < 0)
h5libraryError(env);
if (group_id < 0)
h5libraryError(env);
}
return (jlong)group_id;
} /* end Java_hdf_hdf5lib_H5__1H5Gopen2 */
@ -192,14 +191,15 @@ JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Gget_1info
(JNIEnv *env, jclass cls, jlong loc_id)
{
jobject obj = NULL;
H5G_info_t group_info;
if (H5Gget_info((hid_t)loc_id, &group_info) < 0) {
if (H5Gget_info((hid_t)loc_id, &group_info) < 0)
h5libraryError(env);
return NULL;
} /* end if */
else
obj = create_H5G_info_t(env, group_info);
return create_H5G_info_t(env, group_info);
return obj;
} /* end Java_hdf_hdf5lib_H5_H5Gget_1info */
/*
@ -211,22 +211,24 @@ JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1name
(JNIEnv *env, jclass cls, jlong loc_id, jstring name, jlong lapl_id)
{
jobject obj = NULL;
herr_t ret_val = -1;
const char *gName;
H5G_info_t group_info;
PIN_JAVA_STRING(name, gName, NULL);
PIN_JAVA_STRING(name, gName);
if (gName != NULL) {
ret_val = H5Gget_info_by_name((hid_t)loc_id, gName, &group_info, (hid_t)lapl_id);
ret_val = H5Gget_info_by_name((hid_t)loc_id, gName, &group_info, (hid_t)lapl_id);
UNPIN_JAVA_STRING(name, gName);
UNPIN_JAVA_STRING(name, gName);
if (ret_val < 0)
h5libraryError(env);
else
obj = create_H5G_info_t(env, group_info);
}
if (ret_val < 0) {
h5libraryError(env);
return NULL;
} /* end if */
return create_H5G_info_t(env, group_info);
return obj;
} /* end Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1name */
/*
@ -239,25 +241,27 @@ Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx
(JNIEnv *env, jclass cls, jlong loc_id, jstring name, jint index_type,
jint order, jlong n, jlong lapl_id)
{
jobject obj = NULL;
herr_t ret_val = -1;
const char *gName;
H5G_info_t group_info;
H5_index_t cindex_type = (H5_index_t)index_type;
H5_iter_order_t corder = (H5_iter_order_t)order;
PIN_JAVA_STRING(name, gName, NULL);
PIN_JAVA_STRING(name, gName);
if (gName != NULL) {
ret_val = H5Gget_info_by_idx((hid_t)loc_id, gName, cindex_type,
corder, (hsize_t)n, &group_info, (hid_t)lapl_id);
ret_val = H5Gget_info_by_idx((hid_t)loc_id, gName, cindex_type,
corder, (hsize_t)n, &group_info, (hid_t)lapl_id);
UNPIN_JAVA_STRING(name, gName);
UNPIN_JAVA_STRING(name, gName);
if (ret_val < 0)
h5libraryError(env);
else
obj = create_H5G_info_t(env, group_info);
}
if (ret_val < 0) {
h5libraryError(env);
return NULL;
} /* end if */
return create_H5G_info_t(env, group_info);
return obj;
} /* end Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx */
/*
@ -267,7 +271,7 @@ Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Gflush
(JNIEnv *env, jclass clss, jlong loc_id)
(JNIEnv *env, jclass clss, jlong loc_id)
{
if (H5Gflush((hid_t)loc_id) < 0)
h5libraryError(env);
@ -280,7 +284,7 @@ Java_hdf_hdf5lib_H5_H5Gflush
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Grefresh
(JNIEnv *env, jclass clss, jlong loc_id)
(JNIEnv *env, jclass clss, jlong loc_id)
{
if (H5Grefresh((hid_t)loc_id) < 0)
h5libraryError(env);

@ -89,6 +89,45 @@ Java_hdf_hdf5lib_H5_H5Iget_1name
} /* end Java_hdf_hdf5lib_H5_H5Iget_1name */
/*
* Class: hdf_hdf5lib_H5
* Method: H5Iget_name_str
* Signature: (J)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5Iget_1name_1str
(JNIEnv *env, jclass clss, jlong obj_id)
{
char *aName;
jstring str = NULL;
ssize_t buf_size;
/* get the length of the name */
buf_size = H5Iget_name((hid_t)obj_id, NULL, 0);
if (buf_size <= 0) {
h5badArgument(env, "H5Iget_name: buf_size <= 0");
} /* end if */
else {
buf_size++; /* add extra space for the null terminator */
aName = (char*)HDmalloc(sizeof(char) * (size_t)buf_size);
if (aName == NULL) {
h5outOfMemory(env, "H5Iget_name: malloc failed");
} /* end if */
else {
buf_size = H5Iget_name((hid_t)obj_id, aName, (size_t)buf_size);
if (buf_size < 0) {
h5libraryError(env);
} /* end if */
else {
str = ENVPTR->NewStringUTF(ENVPAR aName);
}
HDfree(aName);
}
}
return str;
} /* end Java_hdf_hdf5lib_H5_H5Iget_1name */
/*
* Class: hdf_hdf5lib_H5
* Method: H5Iget_ref

@ -41,6 +41,15 @@ JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Iget_1name
(JNIEnv*, jclass, jlong, jobjectArray, jlong);
/*
* Class: hdf_hdf5lib_H5
* Method: H5Iget_name_str
* Signature: (J)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5Iget_1name_1str
(JNIEnv*, jclass, jlong);
/*
* Class: hdf_hdf5lib_H5
* Method: H5Iget_ref

@ -67,29 +67,17 @@
/* Macros for string access */
#define PIN_JAVA_STRING(javastr,localstr,retdefault) { \
#define PIN_JAVA_STRING(javastr,localstr) { \
jboolean isCopy; \
(localstr) = NULL; \
if ((javastr) == NULL) { \
h5nullArgument(env, "java string is NULL"); \
return (retdefault); \
} \
(localstr) = ENVPTR->GetStringUTFChars(ENVPAR (javastr), &isCopy); \
if ((localstr) == NULL) { \
h5JNIFatalError(env, "local c string is not pinned"); \
return (retdefault); \
} \
}
#define PIN_JAVA_STRING0(javastr,localstr) { \
jboolean isCopy; \
if ((javastr) == NULL) { \
h5nullArgument(env, "java string is NULL"); \
return; \
} \
(localstr) = ENVPTR->GetStringUTFChars(ENVPAR (javastr), &isCopy); \
if ((localstr) == NULL) { \
h5JNIFatalError(env, "local c string is not pinned"); \
return; \
else { \
(localstr) = ENVPTR->GetStringUTFChars(ENVPAR (javastr), &isCopy); \
if ((localstr) == NULL) { \
h5JNIFatalError(env, "local c string is not pinned"); \
} \
} \
}
@ -97,49 +85,28 @@
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
}
#define PIN_JAVA_STRING_TWO(javastr,localstr,java2str,local2str,retdefault) { \
#define PIN_JAVA_STRING_TWO(javastr,localstr,java2str,local2str) { \
jboolean isCopy; \
(localstr) = NULL; \
(local2str) = NULL; \
if ((javastr) == NULL) { \
h5nullArgument(env, "java string is NULL"); \
return (retdefault); \
} \
if ((java2str) == NULL) { \
else if ((java2str) == NULL) { \
h5nullArgument(env, "second java string is NULL"); \
return (retdefault); \
} \
(localstr) = ENVPTR->GetStringUTFChars(ENVPAR (javastr), &isCopy); \
if ((localstr) == NULL) { \
h5JNIFatalError(env, "local c string is not pinned"); \
return (retdefault); \
} \
(local2str) = ENVPTR->GetStringUTFChars(ENVPAR (java2str), &isCopy); \
if ((local2str) == NULL) { \
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
h5JNIFatalError(env, "second local c string is not pinned"); \
return (retdefault); \
} \
}
#define PIN_JAVA_STRING_TWO0(javastr,localstr,java2str,local2str) { \
jboolean isCopy; \
if ((javastr) == NULL) { \
h5nullArgument(env, "java string is NULL"); \
return; \
} \
if ((java2str) == NULL) { \
h5nullArgument(env, "second java string is NULL"); \
return; \
} \
(localstr) = ENVPTR->GetStringUTFChars(ENVPAR (javastr), &isCopy); \
if ((localstr) == NULL) { \
h5JNIFatalError(env, "local c string is not pinned"); \
return; \
} \
(local2str) = ENVPTR->GetStringUTFChars(ENVPAR (java2str), &isCopy); \
if ((local2str) == NULL) { \
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
h5JNIFatalError(env, "second local c string is not pinned"); \
return; \
else { \
(localstr) = ENVPTR->GetStringUTFChars(ENVPAR (javastr), &isCopy); \
if ((localstr) == NULL) { \
h5JNIFatalError(env, "local c string is not pinned"); \
} \
else { \
(local2str) = ENVPTR->GetStringUTFChars(ENVPAR (java2str), &isCopy); \
if ((local2str) == NULL) { \
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
h5JNIFatalError(env, "second local c string is not pinned"); \
} \
} \
} \
}
@ -148,71 +115,40 @@
ENVPTR->ReleaseStringUTFChars(ENVPAR (java2str), (local2str)); \
}
#define PIN_JAVA_STRING_THREE(javastr,localstr,java2str,local2str,java3str,local3str,retdefault) { \
#define PIN_JAVA_STRING_THREE(javastr,localstr,java2str,local2str,java3str,local3str) { \
jboolean isCopy; \
(localstr) = NULL; \
(local2str) = NULL; \
(local3str) = NULL; \
if ((javastr) == NULL) { \
h5nullArgument(env, "java string is NULL"); \
return (retdefault); \
} \
if ((java2str) == NULL) { \
else if ((java2str) == NULL) { \
h5nullArgument(env, "second java string is NULL"); \
return (retdefault); \
} \
if ((java3str) == NULL) { \
else if ((java3str) == NULL) { \
h5nullArgument(env, "third java string is NULL"); \
return (retdefault); \
} \
(localstr) = ENVPTR->GetStringUTFChars(ENVPAR (javastr), &isCopy); \
if ((localstr) == NULL) { \
h5JNIFatalError(env, "local c string is not pinned"); \
return (retdefault); \
} \
(local2str) = ENVPTR->GetStringUTFChars(ENVPAR (java2str), &isCopy); \
if ((local2str) == NULL) { \
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
h5JNIFatalError(env, "second local c string is not pinned"); \
return (retdefault); \
} \
(local3str) = ENVPTR->GetStringUTFChars(ENVPAR (java3str), &isCopy); \
if ((local3str) == NULL) { \
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
ENVPTR->ReleaseStringUTFChars(ENVPAR (java2str), (local2str)); \
h5JNIFatalError(env, "third local c string is not pinned"); \
return (retdefault); \
} \
}
#define PIN_JAVA_STRING_THREE0(javastr,localstr,java2str,local2str,java3str,local3str) { \
jboolean isCopy; \
if ((javastr) == NULL) { \
h5nullArgument(env, "java string is NULL"); \
return; \
} \
if ((java2str) == NULL) { \
h5nullArgument(env, "second java string is NULL"); \
return; \
} \
if ((java3str) == NULL) { \
h5nullArgument(env, "third java string is NULL"); \
return; \
} \
(localstr) = ENVPTR->GetStringUTFChars(ENVPAR (javastr), &isCopy); \
if ((localstr) == NULL) { \
h5JNIFatalError(env, "local c string is not pinned"); \
return; \
} \
(local2str) = ENVPTR->GetStringUTFChars(ENVPAR (java2str), &isCopy); \
if ((local2str) == NULL) { \
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
h5JNIFatalError(env, "second local c string is not pinned"); \
return; \
} \
(local3str) = ENVPTR->GetStringUTFChars(ENVPAR (java3str), &isCopy); \
if ((local3str) == NULL) { \
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
ENVPTR->ReleaseStringUTFChars(ENVPAR (java2str), (local2str)); \
h5JNIFatalError(env, "third local c string is not pinned"); \
return; \
else { \
(localstr) = ENVPTR->GetStringUTFChars(ENVPAR (javastr), &isCopy); \
if ((localstr) == NULL) { \
h5JNIFatalError(env, "local c string is not pinned"); \
} \
else { \
(local2str) = ENVPTR->GetStringUTFChars(ENVPAR (java2str), &isCopy); \
if ((local2str) == NULL) { \
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
h5JNIFatalError(env, "second local c string is not pinned"); \
} \
else { \
(local3str) = ENVPTR->GetStringUTFChars(ENVPAR (java3str), &isCopy); \
if ((local3str) == NULL) { \
ENVPTR->ReleaseStringUTFChars(ENVPAR (javastr), (localstr)); \
ENVPTR->ReleaseStringUTFChars(ENVPAR (java2str), (local2str)); \
h5JNIFatalError(env, "third local c string is not pinned"); \
} \
} \
} \
} \
}

@ -52,14 +52,15 @@ Java_hdf_hdf5lib_H5_H5Lcopy
const char *lCurName;
const char *lDstName;
PIN_JAVA_STRING_TWO0(cur_name, lCurName, dst_name, lDstName);
PIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
if (lCurName != NULL && lDstName != NULL) {
status = H5Lcopy((hid_t)cur_loc_id, lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
status = H5Lcopy((hid_t)cur_loc_id, lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
UNPIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
UNPIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end Java_hdf_hdf5lib_H5_H5Lcopy */
/*
@ -77,14 +78,15 @@ Java_hdf_hdf5lib_H5_H5Lcreate_1external
const char *lCurName;
const char *lDstName;
PIN_JAVA_STRING_THREE0(file_name, lFileName, cur_name, lCurName, dst_name, lDstName);
PIN_JAVA_STRING_THREE(file_name, lFileName, cur_name, lCurName, dst_name, lDstName);
if (lFileName != NULL && lCurName != NULL && lDstName != NULL) {
status = H5Lcreate_external(lFileName, lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
status = H5Lcreate_external(lFileName, lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
UNPIN_JAVA_STRING_THREE(file_name, lFileName, cur_name, lCurName, dst_name, lDstName);
UNPIN_JAVA_STRING_THREE(file_name, lFileName, cur_name, lCurName, dst_name, lDstName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end Java_hdf_hdf5lib_H5_H5Lcreate_1external */
/*
@ -101,14 +103,15 @@ Java_hdf_hdf5lib_H5_H5Lcreate_1hard
const char *lCurName;
const char *lDstName;
PIN_JAVA_STRING_TWO0(cur_name, lCurName, dst_name, lDstName);
PIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
if (lCurName != NULL && lDstName != NULL) {
status = H5Lcreate_hard((hid_t)cur_loc_id, lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
status = H5Lcreate_hard((hid_t)cur_loc_id, lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
UNPIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
UNPIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end Java_hdf_hdf5lib_H5_H5Lcreate_1hard */
/*
@ -125,14 +128,15 @@ Java_hdf_hdf5lib_H5_H5Lcreate_1soft
const char *lCurName;
const char *lDstName;
PIN_JAVA_STRING_TWO0(cur_name, lCurName, dst_name, lDstName);
PIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
if (lCurName != NULL && lDstName != NULL) {
status = H5Lcreate_soft(lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
status = H5Lcreate_soft(lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
UNPIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
UNPIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end Java_hdf_hdf5lib_H5_H5Lcreate_1soft */
/*
@ -147,14 +151,15 @@ Java_hdf_hdf5lib_H5_H5Ldelete
herr_t status = -1;
const char *lName;
PIN_JAVA_STRING0(name, lName);
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
status = H5Ldelete((hid_t)loc_id, lName, (hid_t)access_id);
status = H5Ldelete((hid_t)loc_id, lName, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
UNPIN_JAVA_STRING(name, lName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end Java_hdf_hdf5lib_H5_H5Ldelete */
/*
@ -171,14 +176,15 @@ Java_hdf_hdf5lib_H5_H5Ldelete_1by_1idx
herr_t status;
const char *lName;
PIN_JAVA_STRING0(name, lName);
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
status = H5Ldelete_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, n, (hid_t)access_id);
status = H5Ldelete_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, n, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
UNPIN_JAVA_STRING(name, lName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end Java_hdf_hdf5lib_H5_H5Ldelete_1by_1idx */
/*
@ -193,16 +199,17 @@ Java_hdf_hdf5lib_H5_H5Lexists
htri_t bval = JNI_FALSE;
const char *lName;
PIN_JAVA_STRING(name, lName, JNI_FALSE);
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
bval = H5Lexists((hid_t)loc_id, lName, (hid_t)access_id);
bval = H5Lexists((hid_t)loc_id, lName, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
UNPIN_JAVA_STRING(name, lName);
if (bval > 0)
bval = JNI_TRUE;
else if (bval < 0)
h5libraryError(env);
if (bval > 0)
bval = JNI_TRUE;
else if (bval < 0)
h5libraryError(env);
}
return (jboolean)bval;
} /* end Java_hdf_hdf5lib_H5_H5Lexists */
@ -222,26 +229,27 @@ Java_hdf_hdf5lib_H5_H5Lget_1info
H5L_info_t infobuf;
const char *lName;
PIN_JAVA_STRING(name, lName, NULL);
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
status = H5Lget_info((hid_t)loc_id, lName, &infobuf, (hid_t)access_id);
status = H5Lget_info((hid_t)loc_id, lName, &infobuf, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
UNPIN_JAVA_STRING(name, lName);
if (status < 0) {
h5libraryError(env);
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
args[0].i = infobuf.type;
args[1].z = infobuf.corder_valid;
args[2].j = infobuf.corder;
args[3].i = infobuf.cset;
if(infobuf.type==0)
args[4].j = (jlong)infobuf.u.address;
else
args[4].j = (jlong)infobuf.u.val_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5L_info_t", "(IZJIJ)V", args);
} /* end else */
} /* end if */
else {
args[0].i = infobuf.type;
args[1].z = infobuf.corder_valid;
args[2].j = infobuf.corder;
args[3].i = infobuf.cset;
if(infobuf.type==0)
args[4].j = (jlong)infobuf.u.address;
else
args[4].j = (jlong)infobuf.u.val_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5L_info_t", "(IZJIJ)V", args);
} /* end else */
return ret_obj;
} /* end Java_hdf_hdf5lib_H5_H5Lget_1info */
@ -261,26 +269,27 @@ Java_hdf_hdf5lib_H5_H5Lget_1info_1by_1idx
H5L_info_t infobuf;
const char *lName;
PIN_JAVA_STRING(name, lName, NULL);
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
status = H5Lget_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 = H5Lget_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);
UNPIN_JAVA_STRING(name, lName);
UNPIN_JAVA_STRING(name, lName);
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
args[0].i = infobuf.type;
args[1].z = infobuf.corder_valid;
args[2].j = infobuf.corder;
args[3].i = infobuf.cset;
if(infobuf.type==0)
args[4].j = (jlong)infobuf.u.address;
else
args[4].j = (jlong)infobuf.u.val_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5L_info_t", "(IZJIJ)V", args);
} /* end els */
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
args[0].i = infobuf.type;
args[1].z = infobuf.corder_valid;
args[2].j = infobuf.corder;
args[3].i = infobuf.cset;
if(infobuf.type==0)
args[4].j = (jlong)infobuf.u.address;
else
args[4].j = (jlong)infobuf.u.val_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5L_info_t", "(IZJIJ)V", args);
} /* end els */
}
return ret_obj;
} /* end Java_hdf_hdf5lib_H5_H5Lget_1info_1by_1idx */
@ -289,7 +298,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1info_1by_1idx
* Method: H5Lget_name_by_idx
* Signature: (JLjava/lang/String;IIJJ)Ljava/lang/String;
*/
JNIEXPORT jobject JNICALL
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5Lget_1name_1by_1idx
(JNIEnv *env, jclass clss, jlong loc_id, jstring name,
jint index_field, jint order, jlong link_n, jlong access_id)
@ -300,39 +309,38 @@ Java_hdf_hdf5lib_H5_H5Lget_1name_1by_1idx
const char *lName;
char *lValue;
PIN_JAVA_STRING(name, lName, NULL);
/* get the length of the link name */
status_size = H5Lget_name_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (char*)NULL, (size_t)0, H5P_DEFAULT);
if(status_size < 0) {
UNPIN_JAVA_STRING(name, lName);
h5libraryError(env);
} /* end if */
else {
buf_size = (size_t)status_size + 1;/* add extra space for the null terminator */
lValue = (char*)HDmalloc(sizeof(char) * buf_size);
if (lValue == NULL) {
UNPIN_JAVA_STRING(name, lName);
h5outOfMemory(env, "H5Lget_name_by_idx: malloc failed ");
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
/* get the length of the link name */
status_size = H5Lget_name_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (char*)NULL, (size_t)0, H5P_DEFAULT);
if(status_size < 0) {
h5libraryError(env);
} /* end if */
else {
status_size = H5Lget_name_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (char*)lValue, (size_t)buf_size, (hid_t)access_id);
buf_size = (size_t)status_size + 1;/* add extra space for the null terminator */
UNPIN_JAVA_STRING(name, lName);
if (status_size < 0) {
HDfree(lValue);
h5libraryError(env);
lValue = (char*)HDmalloc(sizeof(char) * buf_size);
if (lValue == NULL) {
h5outOfMemory(env, "H5Lget_name_by_idx: malloc failed ");
} /* end if */
else {
str = ENVPTR->NewStringUTF(ENVPAR lValue);
HDfree(lValue);
if (str == NULL)
h5JNIFatalError(env, "H5Lget_name_by_idx: return string not created");
status_size = H5Lget_name_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (char*)lValue, (size_t)buf_size, (hid_t)access_id);
if (status_size < 0) {
HDfree(lValue);
h5libraryError(env);
} /* end if */
else {
str = ENVPTR->NewStringUTF(ENVPAR lValue);
HDfree(lValue);
if (str == NULL)
h5JNIFatalError(env, "H5Lget_name_by_idx: return string not created");
} /* end else */
} /* end else */
} /* end else */
} /* end else */
UNPIN_JAVA_STRING(name, lName);
}
return str;
} /* end Java_hdf_hdf5lib_H5_H5Lget_1name_1by_1idx */
@ -354,79 +362,70 @@ Java_hdf_hdf5lib_H5_H5Lget_1value
const char *obj_name;
jstring str;
PIN_JAVA_STRING(name, lName, -1);
infobuf.type = -1;
/* get the length of the link val */
status = H5Lget_info((hid_t)loc_id, lName, &infobuf, H5P_DEFAULT);
if(status < 0) {
UNPIN_JAVA_STRING(name, lName);
h5libraryError(env);
} /* end if */
else {
buf_size = infobuf.u.val_size + 1;/* add extra space for the null terminator */
if(infobuf.type == H5L_TYPE_HARD) {
UNPIN_JAVA_STRING(name, lName);
h5JNIFatalError(env, "H5Lget_val: link is hard type");
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
/* get the length of the link val */
status = H5Lget_info((hid_t)loc_id, lName, &infobuf, H5P_DEFAULT);
if(status < 0) {
h5libraryError(env);
} /* end if */
else {
lValue = (char*)HDmalloc(sizeof(char) * buf_size);
if (lValue == NULL) {
UNPIN_JAVA_STRING(name, lName);
h5outOfMemory(env, "H5Lget_val: malloc failed");
buf_size = infobuf.u.val_size + 1;/* add extra space for the null terminator */
if(infobuf.type == H5L_TYPE_HARD) {
h5JNIFatalError(env, "H5Lget_val: link is hard type");
} /* end if */
else {
status = H5Lget_val((hid_t)loc_id, lName, (void*)lValue, buf_size, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
if (status < 0) {
HDfree(lValue);
h5libraryError(env);
lValue = (char*)HDmalloc(sizeof(char) * buf_size);
if (lValue == NULL) {
h5outOfMemory(env, "H5Lget_val: malloc failed");
} /* end if */
else if(infobuf.type == H5L_TYPE_EXTERNAL) {
status = H5Lunpack_elink_val(lValue, (size_t)infobuf.u.val_size, (unsigned*)NULL, &file_name, &obj_name);
else {
status = H5Lget_val((hid_t)loc_id, lName, (void*)lValue, buf_size, (hid_t)access_id);
if (status < 0) {
HDfree(lValue);
h5libraryError(env);
} /* end if */
else if(infobuf.type == H5L_TYPE_EXTERNAL) {
status = H5Lunpack_elink_val(lValue, (size_t)infobuf.u.val_size, (unsigned*)NULL, &file_name, &obj_name);
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
str = ENVPTR->NewStringUTF(ENVPAR obj_name);
if (str == NULL) {
h5JNIFatalError(env, "H5Lget_val: return string not created");
} /* end if */
else {
ENVPTR->SetObjectArrayElement(ENVPAR link_value, 0, str);
str = ENVPTR->NewStringUTF(ENVPAR file_name);
if (str == NULL) {
h5JNIFatalError(env, "H5Lget_val: return string not created");
} /* end if */
else {
ENVPTR->SetObjectArrayElement(ENVPAR link_value, 1, str);
} /* end else */
} /* end else */
} /* end else */
} /* end else if */
else {
str = ENVPTR->NewStringUTF(ENVPAR obj_name);
str = ENVPTR->NewStringUTF(ENVPAR lValue);
if (str == NULL) {
HDfree(lValue);
/* exception -- fatal JNI error */
h5JNIFatalError(env, "H5Lget_val: return string not created");
} /* end if */
else {
ENVPTR->SetObjectArrayElement(ENVPAR link_value, 0, str);
str = ENVPTR->NewStringUTF(ENVPAR file_name);
if (str == NULL) {
HDfree(lValue);
h5JNIFatalError(env, "H5Lget_val: return string not created");
} /* end if */
else {
ENVPTR->SetObjectArrayElement(ENVPAR link_value, 1, str);
HDfree(lValue);
} /* end else */
} /* end else */
} /* end else */
} /* end else if */
else {
str = ENVPTR->NewStringUTF(ENVPAR lValue);
if (str == NULL) {
/* exception -- fatal JNI error */
HDfree(lValue);
h5JNIFatalError(env, "H5Lget_val: return string not created");
} /* end if */
else {
ENVPTR->SetObjectArrayElement(ENVPAR link_value, 0, str);
HDfree(lValue);
} /* end else */
HDfree(lValue);
} /* end else */
} /* end else */
} /* end else */
} /* end else */
UNPIN_JAVA_STRING(name, lName);
}
return infobuf.type;
} /* end Java_hdf_hdf5lib_H5_H5Lget_1val */
@ -450,80 +449,69 @@ Java_hdf_hdf5lib_H5_H5Lget_1value_1by_1idx
const char *obj_name;
jstring str;
PIN_JAVA_STRING(name, lName, -1);
infobuf.type = -1;
/* get the length of the link valuee */
status = H5Lget_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);
if(status < 0) {
UNPIN_JAVA_STRING(name, lName);
h5libraryError(env);
return -1;
} /* end if */
else {
buf_size = infobuf.u.val_size;
if(buf_size < 0) {
UNPIN_JAVA_STRING(name, lName);
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
/* get the length of the link valuee */
status = H5Lget_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);
if(status < 0) {
h5libraryError(env);
return -1;
} /* end if */
else {
lValue = (void*)HDmalloc(buf_size);
if (lValue == NULL) {
UNPIN_JAVA_STRING(name, lName);
h5outOfMemory(env, "H5Lget_val_by_idx: malloc failed ");
return -1;
buf_size = infobuf.u.val_size;
if(buf_size < 0) {
h5libraryError(env);
} /* end if */
else {
status = H5Lget_val_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (void*)lValue, (size_t)buf_size, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
if (status < 0) {
HDfree(lValue);
h5libraryError(env);
lValue = (void*)HDmalloc(buf_size);
if (lValue == NULL) {
h5outOfMemory(env, "H5Lget_val_by_idx: malloc failed ");
} /* end if */
else if(infobuf.type == H5L_TYPE_EXTERNAL) {
status = H5Lunpack_elink_val((char*)lValue, (size_t)infobuf.u.val_size, (unsigned*)NULL, (const char**)&file_name, (const char**)&obj_name);
else {
status = H5Lget_val_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (void*)lValue, (size_t)buf_size, (hid_t)access_id);
if (status < 0) {
HDfree(lValue);
h5libraryError(env);
} /* end if */
else if(infobuf.type == H5L_TYPE_EXTERNAL) {
status = H5Lunpack_elink_val((char*)lValue, (size_t)infobuf.u.val_size, (unsigned*)NULL, (const char**)&file_name, (const char**)&obj_name);
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
str = ENVPTR->NewStringUTF(ENVPAR obj_name);
if (str == NULL) {
h5JNIFatalError(env, "H5Lget_val_by_idx: return string not created");
} /* end if */
else {
ENVPTR->SetObjectArrayElement(ENVPAR link_value, 0, str);
str = ENVPTR->NewStringUTF(ENVPAR file_name);
if (str == NULL) {
h5JNIFatalError(env, "H5Lget_val_by_idx: return string not created");
} /* end if */
else {
ENVPTR->SetObjectArrayElement(ENVPAR link_value, 1, str);
} /* end else */
} /* end else */
} /* end else */
} /* end else if */
else {
str = ENVPTR->NewStringUTF(ENVPAR obj_name);
str = ENVPTR->NewStringUTF(ENVPAR (char *)lValue);
if (str == NULL) {
HDfree(lValue);
h5JNIFatalError(env, "H5Lget_val_by_idx: return string not created");
} /* end if */
else {
ENVPTR->SetObjectArrayElement(ENVPAR link_value, 0, str);
str = ENVPTR->NewStringUTF(ENVPAR file_name);
if (str == NULL) {
HDfree(lValue);
h5JNIFatalError(env, "H5Lget_val_by_idx: return string not created");
} /* end if */
else {
ENVPTR->SetObjectArrayElement(ENVPAR link_value, 1, str);
HDfree(lValue);
} /* end else */
} /* end else */
} /* end else */
} /* end else if */
else {
str = ENVPTR->NewStringUTF(ENVPAR (char *)lValue);
if (str == NULL) {
HDfree(lValue);
h5JNIFatalError(env, "H5Lget_val_by_idx: return string not created");
} /* end if */
else {
ENVPTR->SetObjectArrayElement(ENVPAR link_value, 0, str);
HDfree(lValue);
} /* end else */
HDfree(lValue);
} /* end else */
} /* end else */
} /* end else */
} /* end else */
UNPIN_JAVA_STRING(name, lName);
}
return infobuf.type;
} /* end Java_hdf_hdf5lib_H5_H5Lget_1val_1by_1idx */
@ -541,20 +529,21 @@ Java_hdf_hdf5lib_H5_H5Lmove
const char *lCurName;
const char *lDstName;
PIN_JAVA_STRING_TWO0(cur_name, lCurName, dst_name, lDstName);
PIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
if (lCurName != NULL && lDstName != NULL) {
status = H5Lmove((hid_t)cur_loc_id, lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
status = H5Lmove((hid_t)cur_loc_id, lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
UNPIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
UNPIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end Java_hdf_hdf5lib_H5_H5Lmove */
static herr_t
H5L_iterate_cb
(hid_t g_id, const char *name, const H5L_info_t *info, void *op_data)
(hid_t g_id, const char *name, const H5L_info_t *info, void *op_data)
{
JNIEnv *cbenv;
jint status;
@ -645,14 +634,15 @@ Java_hdf_hdf5lib_H5_H5Lvisit_1by_1name
h5nullArgument(env, "H5Lvisit_by_name: op_data or callback_op is NULL");
} /* end if */
else {
PIN_JAVA_STRING(name, lName, -1);
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
status = H5Lvisit_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5L_iterate_t)H5L_iterate_cb, (void*)op_data, (hid_t)access_id);
status = H5Lvisit_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5L_iterate_t)H5L_iterate_cb, (void*)op_data, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
UNPIN_JAVA_STRING(name, lName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end else */
return status;
@ -708,14 +698,15 @@ Java_hdf_hdf5lib_H5_H5Literate_1by_1name
h5nullArgument(env, "H5Literate_by_name: op_data or callback_op is NULL");
} /* end if */
else {
PIN_JAVA_STRING(name, lName, -1);
PIN_JAVA_STRING(name, lName);
if (lName != NULL) {
status = H5Literate_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5L_iterate_t)H5L_iterate_cb, (void*)op_data, (hid_t)access_id);
status = H5Literate_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5L_iterate_t)H5L_iterate_cb, (void*)op_data, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
UNPIN_JAVA_STRING(name, lName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end else */
return status;

@ -110,7 +110,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1info_1by_1idx
* Method: H5Lget_name_by_idx
* Signature: (JLjava/lang/String;IIJJ)Ljava/lang/String;
*/
JNIEXPORT jobject JNICALL
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5Lget_1name_1by_1idx
(JNIEnv*, jclass, jlong, jstring, jint, jint, jlong, jlong);

@ -46,17 +46,18 @@ JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5__1H5Oopen
(JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong access_plist_id)
{
hid_t status;
hid_t status = -1;
const char *oName;
PIN_JAVA_STRING(name, oName, -1);
PIN_JAVA_STRING(name, oName);
if (oName != NULL) {
status = H5Oopen((hid_t)loc_id, oName, (hid_t)access_plist_id );
status = H5Oopen((hid_t)loc_id, oName, (hid_t)access_plist_id );
UNPIN_JAVA_STRING(name, oName);
UNPIN_JAVA_STRING(name, oName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
return (jlong)status;
} /* end Java_hdf_hdf5lib_H5__1H5Oopen */
@ -92,14 +93,15 @@ Java_hdf_hdf5lib_H5_H5Ocopy
const char *lCurName;
const char *lDstName;
PIN_JAVA_STRING_TWO0(cur_name, lCurName, dst_name, lDstName);
PIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
if (lCurName != NULL && lDstName != NULL) {
status = H5Ocopy((hid_t)cur_loc_id, lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
status = H5Ocopy((hid_t)cur_loc_id, lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
UNPIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
UNPIN_JAVA_STRING_TWO(cur_name, lCurName, dst_name, lDstName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end Java_hdf_hdf5lib_H5_H5Ocopy */
/*
@ -123,44 +125,44 @@ Java_hdf_hdf5lib_H5_H5Oget_1info
if (status < 0) {
h5libraryError(env);
return NULL;
} /* end if */
else {
args[0].i = (jint)infobuf.hdr.version;
args[1].i = (jint)infobuf.hdr.nmesgs;
args[2].i = (jint)infobuf.hdr.nchunks;
args[3].i = (jint)infobuf.hdr.flags;
args[4].j = (jlong)infobuf.hdr.space.total;
args[5].j = (jlong)infobuf.hdr.space.meta;
args[6].j = (jlong)infobuf.hdr.space.mesg;
args[7].j = (jlong)infobuf.hdr.space.free;
args[8].j = (jlong)infobuf.hdr.mesg.present;
args[9].j = (jlong)infobuf.hdr.mesg.shared;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5O_hdr_info_t", "(IIIIJJJJJJ)V", args);
hdrinfobuf = ret_obj;
args[0].i = (jint)infobuf.hdr.version;
args[1].i = (jint)infobuf.hdr.nmesgs;
args[2].i = (jint)infobuf.hdr.nchunks;
args[3].i = (jint)infobuf.hdr.flags;
args[4].j = (jlong)infobuf.hdr.space.total;
args[5].j = (jlong)infobuf.hdr.space.meta;
args[6].j = (jlong)infobuf.hdr.space.mesg;
args[7].j = (jlong)infobuf.hdr.space.free;
args[8].j = (jlong)infobuf.hdr.mesg.present;
args[9].j = (jlong)infobuf.hdr.mesg.shared;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5O_hdr_info_t", "(IIIIJJJJJJ)V", args);
hdrinfobuf = ret_obj;
args[0].j = (jlong)infobuf.meta_size.obj.index_size;
args[1].j = (jlong)infobuf.meta_size.obj.heap_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
ihinfobuf1 = ret_obj;
args[0].j = (jlong)infobuf.meta_size.attr.index_size;
args[1].j = (jlong)infobuf.meta_size.attr.heap_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
ihinfobuf2 = ret_obj;
args[0].j = (jlong)infobuf.meta_size.obj.index_size;
args[1].j = (jlong)infobuf.meta_size.obj.heap_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
ihinfobuf1 = ret_obj;
args[0].j = (jlong)infobuf.meta_size.attr.index_size;
args[1].j = (jlong)infobuf.meta_size.attr.heap_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
ihinfobuf2 = ret_obj;
args[0].j = (jlong)infobuf.fileno;
args[1].j = (jlong)infobuf.addr;
args[2].i = infobuf.type;
args[3].i = (jint)infobuf.rc;
args[4].j = (jlong)infobuf.num_attrs;
args[5].j = infobuf.atime;
args[6].j = infobuf.mtime;
args[7].j = infobuf.ctime;
args[8].j = infobuf.btime;
args[9].l = hdrinfobuf;
args[10].l = ihinfobuf1;
args[11].l = ihinfobuf2;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5O_info_t", "(JJIIJJJJJLhdf/hdf5lib/structs/H5O_hdr_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;)V", args);
args[0].j = (jlong)infobuf.fileno;
args[1].j = (jlong)infobuf.addr;
args[2].i = infobuf.type;
args[3].i = (jint)infobuf.rc;
args[4].j = (jlong)infobuf.num_attrs;
args[5].j = infobuf.atime;
args[6].j = infobuf.mtime;
args[7].j = infobuf.ctime;
args[8].j = infobuf.btime;
args[9].l = hdrinfobuf;
args[10].l = ihinfobuf1;
args[11].l = ihinfobuf2;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5O_info_t", "(JJIIJJJJJLhdf/hdf5lib/structs/H5O_hdr_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;)V", args);
}
return ret_obj;
} /* end Java_hdf_hdf5lib_H5_H5Oget_1info */
@ -183,52 +185,53 @@ Java_hdf_hdf5lib_H5_H5Oget_1info_1by_1name
jobject ihinfobuf2;
jobject ret_obj = NULL;
PIN_JAVA_STRING(name, lName, NULL);
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_name((hid_t)loc_id, lName, &infobuf, (hid_t)access_id);
UNPIN_JAVA_STRING(name, lName);
UNPIN_JAVA_STRING(name, lName);
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
args[0].i = (jint)infobuf.hdr.version;
args[1].i = (jint)infobuf.hdr.nmesgs;
args[2].i = (jint)infobuf.hdr.nchunks;
args[3].i = (jint)infobuf.hdr.flags;
args[4].j = (jlong)infobuf.hdr.space.total;
args[5].j = (jlong)infobuf.hdr.space.meta;
args[6].j = (jlong)infobuf.hdr.space.mesg;
args[7].j = (jlong)infobuf.hdr.space.free;
args[8].j = (jlong)infobuf.hdr.mesg.present;
args[9].j = (jlong)infobuf.hdr.mesg.shared;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5O_hdr_info_t", "(IIIIJJJJJJ)V", args);
hdrinfobuf = ret_obj;
if (status < 0) {
h5libraryError(env);
return NULL;
} /* end if */
args[0].j = (jlong)infobuf.meta_size.obj.index_size;
args[1].j = (jlong)infobuf.meta_size.obj.heap_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
ihinfobuf1 = ret_obj;
args[0].j = (jlong)infobuf.meta_size.attr.index_size;
args[1].j = (jlong)infobuf.meta_size.attr.heap_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
ihinfobuf2 = ret_obj;
args[0].i = (jint)infobuf.hdr.version;
args[1].i = (jint)infobuf.hdr.nmesgs;
args[2].i = (jint)infobuf.hdr.nchunks;
args[3].i = (jint)infobuf.hdr.flags;
args[4].j = (jlong)infobuf.hdr.space.total;
args[5].j = (jlong)infobuf.hdr.space.meta;
args[6].j = (jlong)infobuf.hdr.space.mesg;
args[7].j = (jlong)infobuf.hdr.space.free;
args[8].j = (jlong)infobuf.hdr.mesg.present;
args[9].j = (jlong)infobuf.hdr.mesg.shared;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5O_hdr_info_t", "(IIIIJJJJJJ)V", args);
hdrinfobuf = ret_obj;
args[0].j = (jlong)infobuf.meta_size.obj.index_size;
args[1].j = (jlong)infobuf.meta_size.obj.heap_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
ihinfobuf1 = ret_obj;
args[0].j = (jlong)infobuf.meta_size.attr.index_size;
args[1].j = (jlong)infobuf.meta_size.attr.heap_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
ihinfobuf2 = ret_obj;
args[0].j = (jlong)infobuf.fileno;
args[1].j = (jlong)infobuf.addr;
args[2].i = infobuf.type;
args[3].i = (jint)infobuf.rc;
args[4].j = (jlong)infobuf.num_attrs;
args[5].j = infobuf.atime;
args[6].j = infobuf.mtime;
args[7].j = infobuf.ctime;
args[8].j = infobuf.btime;
args[9].l = hdrinfobuf;
args[10].l = ihinfobuf1;
args[11].l = ihinfobuf2;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5O_info_t", "(JJIIJJJJJLhdf/hdf5lib/structs/H5O_hdr_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;)V", args);
args[0].j = (jlong)infobuf.fileno;
args[1].j = (jlong)infobuf.addr;
args[2].i = infobuf.type;
args[3].i = (jint)infobuf.rc;
args[4].j = (jlong)infobuf.num_attrs;
args[5].j = infobuf.atime;
args[6].j = infobuf.mtime;
args[7].j = infobuf.ctime;
args[8].j = infobuf.btime;
args[9].l = hdrinfobuf;
args[10].l = ihinfobuf1;
args[11].l = ihinfobuf2;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5O_info_t", "(JJIIJJJJJLhdf/hdf5lib/structs/H5O_hdr_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;)V", args);
}
}
return ret_obj;
} /* end Java_hdf_hdf5lib_H5_H5Oget_1info_1by_1name */
@ -252,52 +255,53 @@ Java_hdf_hdf5lib_H5_H5Oget_1info_1by_1idx
jobject ihinfobuf2;
jobject ret_obj = NULL;
PIN_JAVA_STRING(name, lName, NULL);
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_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);
UNPIN_JAVA_STRING(name, lName);
UNPIN_JAVA_STRING(name, lName);
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
args[0].i = (jint)infobuf.hdr.version;
args[1].i = (jint)infobuf.hdr.nmesgs;
args[2].i = (jint)infobuf.hdr.nchunks;
args[3].i = (jint)infobuf.hdr.flags;
args[4].j = (jlong)infobuf.hdr.space.total;
args[5].j = (jlong)infobuf.hdr.space.meta;
args[6].j = (jlong)infobuf.hdr.space.mesg;
args[7].j = (jlong)infobuf.hdr.space.free;
args[8].j = (jlong)infobuf.hdr.mesg.present;
args[9].j = (jlong)infobuf.hdr.mesg.shared;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5O_hdr_info_t", "(IIIIJJJJJJ)V", args);
hdrinfobuf = ret_obj;
if (status < 0) {
h5libraryError(env);
return NULL;
} /* end if */
args[0].j = (jlong)infobuf.meta_size.obj.index_size;
args[1].j = (jlong)infobuf.meta_size.obj.heap_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
ihinfobuf1 = ret_obj;
args[0].j = (jlong)infobuf.meta_size.attr.index_size;
args[1].j = (jlong)infobuf.meta_size.attr.heap_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
ihinfobuf2 = ret_obj;
args[0].i = (jint)infobuf.hdr.version;
args[1].i = (jint)infobuf.hdr.nmesgs;
args[2].i = (jint)infobuf.hdr.nchunks;
args[3].i = (jint)infobuf.hdr.flags;
args[4].j = (jlong)infobuf.hdr.space.total;
args[5].j = (jlong)infobuf.hdr.space.meta;
args[6].j = (jlong)infobuf.hdr.space.mesg;
args[7].j = (jlong)infobuf.hdr.space.free;
args[8].j = (jlong)infobuf.hdr.mesg.present;
args[9].j = (jlong)infobuf.hdr.mesg.shared;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5O_hdr_info_t", "(IIIIJJJJJJ)V", args);
hdrinfobuf = ret_obj;
args[0].j = (jlong)infobuf.meta_size.obj.index_size;
args[1].j = (jlong)infobuf.meta_size.obj.heap_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
ihinfobuf1 = ret_obj;
args[0].j = (jlong)infobuf.meta_size.attr.index_size;
args[1].j = (jlong)infobuf.meta_size.attr.heap_size;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5_ih_info_t", "(JJ)V", args);
ihinfobuf2 = ret_obj;
args[0].j = (jlong)infobuf.fileno;
args[1].j = (jlong)infobuf.addr;
args[2].i = infobuf.type;
args[3].i = (jint)infobuf.rc;
args[4].j = (jlong)infobuf.num_attrs;
args[5].j = infobuf.atime;
args[6].j = infobuf.mtime;
args[7].j = infobuf.ctime;
args[8].j = infobuf.btime;
args[9].l = hdrinfobuf;
args[10].l = ihinfobuf1;
args[11].l = ihinfobuf2;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5O_info_t", "(JJIIJJJJJLhdf/hdf5lib/structs/H5O_hdr_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;)V", args);
args[0].j = (jlong)infobuf.fileno;
args[1].j = (jlong)infobuf.addr;
args[2].i = infobuf.type;
args[3].i = (jint)infobuf.rc;
args[4].j = (jlong)infobuf.num_attrs;
args[5].j = infobuf.atime;
args[6].j = infobuf.mtime;
args[7].j = infobuf.ctime;
args[8].j = infobuf.btime;
args[9].l = hdrinfobuf;
args[10].l = ihinfobuf1;
args[11].l = ihinfobuf2;
CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5O_info_t", "(JJIIJJJJJLhdf/hdf5lib/structs/H5O_hdr_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;Lhdf/hdf5lib/structs/H5_ih_info_t;)V", args);
}
}
return ret_obj;
} /* end Java_hdf_hdf5lib_H5_H5Oget_1info_1by_1idx */
@ -315,14 +319,15 @@ Java_hdf_hdf5lib_H5_H5Olink
herr_t status = -1;
const char *lDstName;
PIN_JAVA_STRING0(dst_name, lDstName);
PIN_JAVA_STRING(dst_name, lDstName);
if (lDstName != NULL) {
status = H5Olink((hid_t)cur_loc_id, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
status = H5Olink((hid_t)cur_loc_id, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);
UNPIN_JAVA_STRING(dst_name, lDstName);
UNPIN_JAVA_STRING(dst_name, lDstName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end Java_hdf_hdf5lib_H5_H5Olink */
static herr_t
@ -347,90 +352,71 @@ H5O_iterate_cb
return -1;
} /* end if */
cls = CBENVPTR->GetObjectClass(CBENVPAR visit_callback);
if (cls == 0) {
/* printf("JNI H5O_iterate_cb error: GetObjectClass failed\n"); */
JVMPTR->DetachCurrentThread(JVMPAR);
return -1;
} /* end if */
mid = CBENVPTR->GetMethodID(CBENVPAR cls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5O_info_t;Lhdf/hdf5lib/callbacks/H5O_iterate_t;)I");
if (mid == 0) {
/* printf("JNI H5O_iterate_cb error: GetMethodID failed\n"); */
JVMPTR->DetachCurrentThread(JVMPAR);
return -1;
} /* end if */
str = CBENVPTR->NewStringUTF(CBENVPAR name);
if (cls != 0) {
mid = CBENVPTR->GetMethodID(CBENVPAR cls, "callback", "(JLjava/lang/String;Lhdf/hdf5lib/structs/H5O_info_t;Lhdf/hdf5lib/callbacks/H5O_iterate_t;)I");
if (mid != 0) {
str = CBENVPTR->NewStringUTF(CBENVPAR name);
args[0].i = (jint)info->hdr.version;
args[1].i = (jint)info->hdr.nmesgs;
args[2].i = (jint)info->hdr.nchunks;
args[3].i = (jint)info->hdr.flags;
args[4].j = (jlong)info->hdr.space.total;
args[5].j = (jlong)info->hdr.space.meta;
args[6].j = (jlong)info->hdr.space.mesg;
args[7].j = (jlong)info->hdr.space.free;
args[8].j = (jlong)info->hdr.mesg.present;
args[9].j = (jlong)info->hdr.mesg.shared;
// get a reference to the H5_hdr_info_t class
cls = CBENVPTR->FindClass(CBENVPAR "hdf/hdf5lib/structs/H5O_hdr_info_t");
if (cls == 0) {
JVMPTR->DetachCurrentThread(JVMPAR);
return -1;
} /* end if */
// get a reference to the constructor; the name is <init>
constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "<init>", "(IIIIJJJJJJ)V");
if (constructor == 0) {
JVMPTR->DetachCurrentThread(JVMPAR);
return -1;
} /* end if */
hdrinfobuf = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args);
args[0].i = (jint)info->hdr.version;
args[1].i = (jint)info->hdr.nmesgs;
args[2].i = (jint)info->hdr.nchunks;
args[3].i = (jint)info->hdr.flags;
args[4].j = (jlong)info->hdr.space.total;
args[5].j = (jlong)info->hdr.space.meta;
args[6].j = (jlong)info->hdr.space.mesg;
args[7].j = (jlong)info->hdr.space.free;
args[8].j = (jlong)info->hdr.mesg.present;
args[9].j = (jlong)info->hdr.mesg.shared;
// get a reference to the H5_hdr_info_t class
cls = CBENVPTR->FindClass(CBENVPAR "hdf/hdf5lib/structs/H5O_hdr_info_t");
if (cls != 0) {
// get a reference to the constructor; the name is <init>
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) {
JVMPTR->DetachCurrentThread(JVMPAR);
return -1;
} /* end if */
// get a reference to the constructor; the name is <init>
constructor = CBENVPTR->GetMethodID(CBENVPAR cls, "<init>", "(JJ)V");
if (constructor == 0) {
JVMPTR->DetachCurrentThread(JVMPAR);
return -1;
} /* end if */
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->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) {
JVMPTR->DetachCurrentThread(JVMPAR);
return -1;
} /* end if */
// 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) {
JVMPTR->DetachCurrentThread(JVMPAR);
return -1;
} /* end if */
cb_info_t = CBENVPTR->NewObjectA(CBENVPAR cls, constructor, args);
status = CBENVPTR->CallIntMethod(CBENVPAR visit_callback, mid, g_id, str, cb_info_t, op_data);
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);
}
}
}
}
}
}
}
} /* end if */
JVMPTR->DetachCurrentThread(JVMPAR);
return status;
@ -453,17 +439,16 @@ Java_hdf_hdf5lib_H5_H5Ovisit
if (op_data == NULL) {
h5nullArgument(env, "H5Ovisit: op_data is NULL");
return -1;
} /* end if */
if (callback_op == NULL) {
else if (callback_op == NULL) {
h5nullArgument(env, "H5Ovisit: callback_op is NULL");
return -1;
} /* 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 = H5Ovisit((hid_t)grp_id, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5O_iterate_t)H5O_iterate_cb, (void*)op_data);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
return status;
} /* end Java_hdf_hdf5lib_H5_H5Ovisit */
@ -488,19 +473,21 @@ Java_hdf_hdf5lib_H5_H5Ovisit_1by_1name
h5nullArgument(env, "H5Ovisit_by_name: op_data is NULL");
return -1;
} /* end if */
if (callback_op == NULL) {
else if (callback_op == NULL) {
h5nullArgument(env, "H5Ovisit_by_name: callback_op is NULL");
return -1;
} /* end if */
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);
PIN_JAVA_STRING(name, lName, -1);
UNPIN_JAVA_STRING(name, lName);
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);
UNPIN_JAVA_STRING(name, lName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
}
return status;
} /* end Java_hdf_hdf5lib_H5_H5Ovisit_1by_1name */
@ -515,25 +502,21 @@ Java_hdf_hdf5lib_H5_H5Oset_1comment
(JNIEnv *env, jclass clss, jlong loc_id, jstring comment)
{
herr_t status = -1;
const char *oComment;
const char *oComment = NULL;
jboolean isCopy;
if (comment == NULL) {
oComment = NULL;
status = H5Oset_comment((hid_t)loc_id, oComment);
} /* end if */
else {
oComment = ENVPTR->GetStringUTFChars(ENVPAR comment, &isCopy);
if (oComment == NULL) {
h5JNIFatalError( env, "H5Oset_comment: comment not pinned");
return;
} /* end if */
if (oComment != NULL) {
status = H5Oset_comment((hid_t)loc_id, oComment);
ENVPTR->ReleaseStringUTFChars(ENVPAR comment, oComment);
}
} /* end else */
status = H5Oset_comment((hid_t)loc_id, oComment);
if(oComment)
ENVPTR->ReleaseStringUTFChars(ENVPAR comment, oComment);
if (status < 0)
h5libraryError(env);
} /* end Java_hdf_hdf5lib_H5_H5Oset_1comment */
@ -552,30 +535,25 @@ Java_hdf_hdf5lib_H5_H5Oset_1comment_1by_1name
const char *oName;
const char *oComment;
PIN_JAVA_STRING0(name, oName);
if (comment == NULL) {
oComment = NULL;
} /* end if */
else {
jboolean isCopy;
oComment = ENVPTR->GetStringUTFChars(ENVPAR comment, &isCopy);
if (oComment == NULL) {
UNPIN_JAVA_STRING(name, oName);
h5JNIFatalError( env, "H5Oset_comment_by_name: comment not pinned");
return;
PIN_JAVA_STRING(name, oName);
if (oName != NULL) {
if (comment == NULL) {
status = H5Oset_comment_by_name((hid_t)loc_id, oName, NULL, (hid_t)access_id);
} /* end if */
} /* end else */
else {
jboolean isCopy;
oComment = ENVPTR->GetStringUTFChars(ENVPAR comment, &isCopy);
if (oComment != NULL) {
status = H5Oset_comment_by_name((hid_t)loc_id, oName, oComment, (hid_t)access_id);
ENVPTR->ReleaseStringUTFChars(ENVPAR comment, oComment);
} /* end if */
} /* end else */
status = H5Oset_comment_by_name((hid_t)loc_id, oName, oComment, (hid_t)access_id);
UNPIN_JAVA_STRING(name, oName);
UNPIN_JAVA_STRING(name, oName);
if(oComment)
ENVPTR->ReleaseStringUTFChars(ENVPAR comment, oComment);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end Java_hdf_hdf5lib_H5_H5Oset_1comment_1by_1name */
/*
@ -596,34 +574,30 @@ Java_hdf_hdf5lib_H5_H5Oget_1comment
buf_size = H5Oget_comment((hid_t)loc_id, NULL, 0);
if (buf_size < 0) {
h5badArgument( env, "H5Oget_comment: buf_size < 0");
return NULL;
} /* end if */
if (buf_size == 0) {
return NULL;
} /* end if */
buf_size++; /* add extra space for the null terminator */
oComment = (char *)HDmalloc(sizeof(char) * (size_t)buf_size);
if (oComment == NULL) {
/* exception -- out of memory */
h5outOfMemory( env, "H5Oget_comment: malloc failed");
return NULL;
} /* end if */
status = H5Oget_comment((hid_t)loc_id, oComment, (size_t)buf_size);
if (status >= 0) {
/* may throw OutOfMemoryError */
str = ENVPTR->NewStringUTF(ENVPAR oComment);
HDfree(oComment);
if (str == NULL) {
h5JNIFatalError( env, "H5Oget_comment: return string not allocated");
else if (buf_size > 0) {
buf_size++; /* add extra space for the null terminator */
oComment = (char *)HDmalloc(sizeof(char) * (size_t)buf_size);
if (oComment == NULL) {
/* exception -- out of memory */
h5outOfMemory( env, "H5Oget_comment: malloc failed");
} /* end if */
} /* end if */
else {
HDfree(oComment);
h5libraryError(env);
} /* end else */
else {
status = H5Oget_comment((hid_t)loc_id, oComment, (size_t)buf_size);
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
/* may throw OutOfMemoryError */
str = ENVPTR->NewStringUTF(ENVPAR oComment);
if (str == NULL) {
h5JNIFatalError( env, "H5Oget_comment: return string not allocated");
} /* end if */
} /* end else */
HDfree(oComment);
}
} /* end else if */
return (jstring)str;
} /* end Java_hdf_hdf5lib_H5_H5Oget_1comment */
@ -643,43 +617,37 @@ Java_hdf_hdf5lib_H5_H5Oget_1comment_1by_1name
ssize_t status;
jstring str = NULL;
PIN_JAVA_STRING(name, oName, NULL);
/* get the length of the comment */
buf_size = H5Oget_comment_by_name((hid_t)loc_id, oName, NULL, 0, (hid_t)access_id);
if (buf_size < 0) {
UNPIN_JAVA_STRING(name, oName);
h5badArgument( env, "H5Oget_comment_by_name: buf_size < 0");
return NULL;
} /* end if */
if (buf_size == 0) {
UNPIN_JAVA_STRING(name, oName);
return NULL;
} /* end if */
buf_size++; /* add extra space for the null terminator */
oComment = (char *)HDmalloc(sizeof(char) * (size_t)buf_size);
if (oComment == NULL) {
UNPIN_JAVA_STRING(name, oName);
h5outOfMemory( env, "H5Oget_comment_by_name: malloc failed");
return NULL;
} /* end if */
status = H5Oget_comment_by_name((hid_t)loc_id, oName, oComment, (size_t)buf_size, (hid_t)access_id);
UNPIN_JAVA_STRING(name, oName);
if (status >= 0) {
/* may throw OutOfMemoryError */
str = ENVPTR->NewStringUTF(ENVPAR oComment);
HDfree(oComment);
if (str == NULL) {
h5JNIFatalError( env, "H5Oget_comment_by_name: return string not allocated");
PIN_JAVA_STRING(name, oName);
if (oName != NULL) {
/* get the length of the comment */
buf_size = H5Oget_comment_by_name((hid_t)loc_id, oName, NULL, 0, (hid_t)access_id);
if (buf_size < 0) {
h5badArgument( env, "H5Oget_comment_by_name: buf_size < 0");
} /* end if */
} /* end if */
else {
HDfree(oComment);
h5libraryError(env);
} /* end else */
else if (buf_size > 0) {
buf_size++; /* add extra space for the null terminator */
oComment = (char *)HDmalloc(sizeof(char) * (size_t)buf_size);
if (oComment == NULL) {
h5outOfMemory( env, "H5Oget_comment_by_name: malloc failed");
} /* end if */
else {
status = H5Oget_comment_by_name((hid_t)loc_id, oName, oComment, (size_t)buf_size, (hid_t)access_id);
if (status < 0) {
h5libraryError(env);
} /* end if */
else {
/* may throw OutOfMemoryError */
str = ENVPTR->NewStringUTF(ENVPAR oComment);
if (str == NULL) {
h5JNIFatalError( env, "H5Oget_comment_by_name: return string not allocated");
} /* end if */
} /* end else */
HDfree(oComment);
}
} /* end if */
UNPIN_JAVA_STRING(name, oName);
}
return (jstring)str;
} /* end Java_hdf_hdf5lib_H5_H5Oget_1comment_1by_1name */
@ -696,16 +664,17 @@ Java_hdf_hdf5lib_H5_H5Oexists_1by_1name
htri_t bval = JNI_FALSE;
const char *oName;
PIN_JAVA_STRING(name, oName, JNI_FALSE);
PIN_JAVA_STRING(name, oName);
if (oName != NULL) {
bval = H5Oexists_by_name((hid_t)loc_id, oName, (hid_t)access_id);
bval = H5Oexists_by_name((hid_t)loc_id, oName, (hid_t)access_id);
UNPIN_JAVA_STRING(name, oName);
UNPIN_JAVA_STRING(name, oName);
if (bval > 0)
bval = JNI_TRUE;
else if (bval < 0)
h5libraryError(env);
if (bval > 0)
bval = JNI_TRUE;
else if (bval < 0)
h5libraryError(env);
}
return (jboolean)bval;
} /* end Java_hdf_hdf5lib_H5_H5Oexists_1by_1name */
@ -767,14 +736,15 @@ Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx
hid_t retVal = -1;
const char *oName;
PIN_JAVA_STRING(name, oName, -1);
PIN_JAVA_STRING(name, oName);
if (oName != NULL) {
retVal = H5Oopen_by_idx((hid_t)loc_id, oName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (hid_t)lapl_id );
retVal = H5Oopen_by_idx((hid_t)loc_id, oName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (hid_t)lapl_id );
UNPIN_JAVA_STRING(name, oName);
UNPIN_JAVA_STRING(name, oName);
if (retVal < 0)
h5libraryError(env);
if (retVal < 0)
h5libraryError(env);
}
return (jlong)retVal;
} /* end Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx */
@ -786,7 +756,7 @@ Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Oflush
(JNIEnv *env, jclass clss, jlong loc_id)
(JNIEnv *env, jclass clss, jlong loc_id)
{
if (H5Oflush((hid_t)loc_id) < 0)
h5libraryError(env);
@ -799,7 +769,7 @@ Java_hdf_hdf5lib_H5_H5Oflush
*/
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Orefresh
(JNIEnv *env, jclass clss, jlong loc_id)
(JNIEnv *env, jclass clss, jlong loc_id)
{
if (H5Orefresh((hid_t)loc_id) < 0)
h5libraryError(env);

File diff suppressed because it is too large Load Diff

@ -46,45 +46,41 @@ Java_hdf_hdf5lib_H5_H5Rcreate
jbyte *refP;
jboolean isCopy2;
PIN_JAVA_STRING(name, rName, -1);
if (ref == NULL) {
UNPIN_JAVA_STRING(name, rName);
h5nullArgument( env, "H5Rcreate: ref is NULL");
} /* end if */
else {
if ((ref_type == H5R_OBJECT) && ENVPTR->GetArrayLength(ENVPAR ref) != H5R_OBJ_REF_BUF_SIZE) {
UNPIN_JAVA_STRING(name, rName);
h5badArgument( env, "H5Rcreate: ref input array != H5R_OBJ_REF_BUF_SIZE");
PIN_JAVA_STRING(name, rName);
if (rName != NULL) {
if (ref == NULL) {
h5nullArgument( env, "H5Rcreate: ref is NULL");
} /* end if */
else if ((ref_type == H5R_DATASET_REGION) && ENVPTR->GetArrayLength(ENVPAR ref) != H5R_DSET_REG_REF_BUF_SIZE) {
UNPIN_JAVA_STRING(name, rName);
h5badArgument( env, "H5Rcreate: region ref input array != H5R_DSET_REG_REF_BUF_SIZE");
} /* end else if */
else if ((ref_type != H5R_OBJECT) && (ref_type != H5R_DATASET_REGION)) {
UNPIN_JAVA_STRING(name, rName);
h5badArgument( env, "H5Rcreate: ref_type unknown type ");
} /* end else if */
else {
refP = (jbyte*)ENVPTR->GetByteArrayElements(ENVPAR ref, &isCopy2);
if (refP == NULL) {
UNPIN_JAVA_STRING(name, rName);
h5JNIFatalError(env, "H5Rcreate: ref not pinned");
if ((ref_type == H5R_OBJECT) && ENVPTR->GetArrayLength(ENVPAR ref) != H5R_OBJ_REF_BUF_SIZE) {
h5badArgument( env, "H5Rcreate: ref input array != H5R_OBJ_REF_BUF_SIZE");
} /* end if */
else if ((ref_type == H5R_DATASET_REGION) && ENVPTR->GetArrayLength(ENVPAR ref) != H5R_DSET_REG_REF_BUF_SIZE) {
h5badArgument( env, "H5Rcreate: region ref input array != H5R_DSET_REG_REF_BUF_SIZE");
} /* end else if */
else if ((ref_type != H5R_OBJECT) && (ref_type != H5R_DATASET_REGION)) {
h5badArgument( env, "H5Rcreate: ref_type unknown type ");
} /* end else if */
else {
status = H5Rcreate(refP, (hid_t)loc_id, rName, (H5R_type_t)ref_type, (hid_t)space_id);
UNPIN_JAVA_STRING(name, rName);
if (status < 0) {
ENVPTR->ReleaseByteArrayElements(ENVPAR ref, refP, JNI_ABORT);
h5libraryError(env);
refP = (jbyte*)ENVPTR->GetByteArrayElements(ENVPAR ref, &isCopy2);
if (refP == NULL) {
h5JNIFatalError(env, "H5Rcreate: ref not pinned");
} /* end if */
else {
ENVPTR->ReleaseByteArrayElements(ENVPAR ref, refP, 0);
status = H5Rcreate(refP, (hid_t)loc_id, rName, (H5R_type_t)ref_type, (hid_t)space_id);
if (status < 0) {
ENVPTR->ReleaseByteArrayElements(ENVPAR ref, refP, JNI_ABORT);
h5libraryError(env);
} /* end if */
else {
ENVPTR->ReleaseByteArrayElements(ENVPAR ref, refP, 0);
} /* end else */
} /* end else */
} /* end else */
} /* end else */
} /* end else */
UNPIN_JAVA_STRING(name, rName);
}
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Rcreate */

@ -43,17 +43,18 @@ JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5__1H5Topen2
(JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong access_plist)
{
hid_t status;
hid_t status = -1;
const char *tName;
PIN_JAVA_STRING(name, tName, -1);
PIN_JAVA_STRING(name, tName);
if (tName != NULL) {
status = H5Topen2((hid_t)loc_id, tName, (hid_t)access_plist);
status = H5Topen2((hid_t)loc_id, tName, (hid_t)access_plist);
UNPIN_JAVA_STRING(name, tName);
UNPIN_JAVA_STRING(name, tName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
return (jlong)status;
} /* end Java_hdf_hdf5lib_H5__1H5Topen2 */
@ -789,14 +790,15 @@ Java_hdf_hdf5lib_H5_H5Tget_1member_1index
const char *tName;
int index = -1;
PIN_JAVA_STRING(field_name, tName, -1);
PIN_JAVA_STRING(field_name, tName);
if (tName != NULL) {
index = H5Tget_member_index((hid_t)type_id, tName);
index = H5Tget_member_index((hid_t)type_id, tName);
UNPIN_JAVA_STRING(field_name, tName);
UNPIN_JAVA_STRING(field_name, tName);
if (index < 0)
h5libraryError(env);
if (index < 0)
h5libraryError(env);
}
return (jint)index;
} /* end Java_hdf_hdf5lib_H5_H5Tget_1member_1index */
@ -858,17 +860,18 @@ JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Tinsert
(JNIEnv *env, jclass clss, jlong type_id, jstring name, jlong offset, jlong field_id)
{
herr_t status;
herr_t status = -1;
const char *tName;
long off = (long)offset;
PIN_JAVA_STRING(name, tName, -1);
PIN_JAVA_STRING(name, tName);
if (tName != NULL) {
status = H5Tinsert((hid_t)type_id, tName, (size_t)off, field_id);
status = H5Tinsert((hid_t)type_id, tName, (size_t)off, field_id);
UNPIN_JAVA_STRING(name,tName);
if (status < 0)
h5libraryError(env);
UNPIN_JAVA_STRING(name,tName);
if (status < 0)
h5libraryError(env);
}
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Tinsert */
@ -939,14 +942,15 @@ Java_hdf_hdf5lib_H5_H5Tset_1tag
herr_t status = -1;
const char *tagP;
PIN_JAVA_STRING(tag, tagP, -1);
PIN_JAVA_STRING(tag, tagP);
if (tagP != NULL) {
status = H5Tset_tag((hid_t)type, tagP);
status = H5Tset_tag((hid_t)type, tagP);
UNPIN_JAVA_STRING(tag,tagP);
UNPIN_JAVA_STRING(tag,tagP);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Tset_1tag */
@ -1029,21 +1033,22 @@ Java_hdf_hdf5lib_H5_H5Tenum_1insert_1int
h5nullArgument(env, "H5Tenum_insert: value is NULL");
} /* end if */
else {
PIN_JAVA_STRING(name, nameP, -1);
PIN_JAVA_STRING(name, nameP);
if (nameP != NULL) {
intP = ENVPTR->GetIntArrayElements(ENVPAR value, &isCopy2);
if (intP == NULL) {
h5JNIFatalError(env, "H5Tenum_insert: value not pinned");
} /* end if */
else {
status = H5Tenum_insert((hid_t)type_id, nameP, intP);
intP = ENVPTR->GetIntArrayElements(ENVPAR value, &isCopy2);
if (intP == NULL) {
h5JNIFatalError(env, "H5Tenum_insert: value not pinned");
} /* end if */
else {
status = H5Tenum_insert((hid_t)type_id, nameP, intP);
ENVPTR->ReleaseIntArrayElements(ENVPAR value, intP, JNI_ABORT);
ENVPTR->ReleaseIntArrayElements(ENVPAR value, intP, JNI_ABORT);
if (status < 0)
h5libraryError(env);
} /* end else */
UNPIN_JAVA_STRING(name, nameP);
if (status < 0)
h5libraryError(env);
} /* end else */
UNPIN_JAVA_STRING(name, nameP);
}
} /* end else */
return (jint)status;
@ -1067,21 +1072,22 @@ Java_hdf_hdf5lib_H5_H5Tenum_1insert
h5nullArgument(env, "H5Tenum_insert: value is NULL");
} /* end if */
else {
PIN_JAVA_STRING0(name, nameP);
PIN_JAVA_STRING(name, nameP);
if (nameP != NULL) {
byteP = ENVPTR->GetByteArrayElements(ENVPAR value, &isCopy2);
if (byteP == NULL) {
h5JNIFatalError(env, "H5Tenum_insert: value not pinned");
} /* end if */
else {
status = H5Tenum_insert((hid_t)type_id, nameP, byteP);
byteP = ENVPTR->GetByteArrayElements(ENVPAR value, &isCopy2);
if (byteP == NULL) {
h5JNIFatalError(env, "H5Tenum_insert: value not pinned");
} /* end if */
else {
status = H5Tenum_insert((hid_t)type_id, nameP, byteP);
ENVPTR->ReleaseByteArrayElements(ENVPAR value, byteP, JNI_ABORT);
ENVPTR->ReleaseByteArrayElements(ENVPAR value, byteP, JNI_ABORT);
if (status < 0)
h5libraryError(env);
} /* end else */
UNPIN_JAVA_STRING(name, nameP);
if (status < 0)
h5libraryError(env);
} /* end else */
UNPIN_JAVA_STRING(name, nameP);
}
} /* end else */
} /* end Java_hdf_hdf5lib_H5_H5Tenum_1insert */
@ -1218,23 +1224,24 @@ Java_hdf_hdf5lib_H5_H5Tenum_1valueof_1int
h5nullArgument(env, "H5Tenum_valueof: value is NULL");
} /* end if */
else {
PIN_JAVA_STRING(name, nameP, -1);
intP = ENVPTR->GetIntArrayElements(ENVPAR value, &isCopy2);
if (intP == NULL) {
h5JNIFatalError(env, "H5Tenum_valueof: value not pinned");
} /* end if */
else {
status = H5Tenum_valueof((hid_t)type_id, nameP, intP);
if (status < 0) {
ENVPTR->ReleaseIntArrayElements(ENVPAR value, intP, JNI_ABORT);
h5libraryError(env);
PIN_JAVA_STRING(name, nameP);
if (nameP != NULL) {
intP = ENVPTR->GetIntArrayElements(ENVPAR value, &isCopy2);
if (intP == NULL) {
h5JNIFatalError(env, "H5Tenum_valueof: value not pinned");
} /* end if */
else
ENVPTR->ReleaseIntArrayElements(ENVPAR value, intP, 0);
} /* end else */
UNPIN_JAVA_STRING(name, nameP);
else {
status = H5Tenum_valueof((hid_t)type_id, nameP, intP);
if (status < 0) {
ENVPTR->ReleaseIntArrayElements(ENVPAR value, intP, JNI_ABORT);
h5libraryError(env);
} /* end if */
else
ENVPTR->ReleaseIntArrayElements(ENVPAR value, intP, 0);
} /* end else */
UNPIN_JAVA_STRING(name, nameP);
}
} /* end else */
return (jint)status;
@ -1258,23 +1265,24 @@ Java_hdf_hdf5lib_H5_H5Tenum_1valueof
h5nullArgument(env, "H5Tenum_valueof: value is NULL");
} /* end if */
else {
PIN_JAVA_STRING0(name, nameP);
byteP = ENVPTR->GetByteArrayElements(ENVPAR value, &isCopy2);
if (byteP == NULL) {
h5JNIFatalError(env, "H5Tenum_valueof: value not pinned");
} /* end if */
else {
status = H5Tenum_valueof((hid_t)type_id, nameP, byteP);
if (status < 0) {
ENVPTR->ReleaseByteArrayElements(ENVPAR value, byteP, JNI_ABORT);
h5libraryError(env);
PIN_JAVA_STRING(name, nameP);
if (nameP != NULL) {
byteP = ENVPTR->GetByteArrayElements(ENVPAR value, &isCopy2);
if (byteP == NULL) {
h5JNIFatalError(env, "H5Tenum_valueof: value not pinned");
} /* end if */
else
ENVPTR->ReleaseByteArrayElements(ENVPAR value, byteP, 0);
} /* end else */
UNPIN_JAVA_STRING(name, nameP);
else {
status = H5Tenum_valueof((hid_t)type_id, nameP, byteP);
if (status < 0) {
ENVPTR->ReleaseByteArrayElements(ENVPAR value, byteP, JNI_ABORT);
h5libraryError(env);
} /* end if */
else
ENVPTR->ReleaseByteArrayElements(ENVPAR value, byteP, 0);
} /* end else */
UNPIN_JAVA_STRING(name, nameP);
}
} /* end else */
} /* end Java_hdf_hdf5lib_H5_H5Tenum_1valueof */
@ -1487,14 +1495,15 @@ Java_hdf_hdf5lib_H5_H5Tcommit
herr_t status = -1;
const char *tName;
PIN_JAVA_STRING0(name, tName);
PIN_JAVA_STRING(name, tName);
if (tName != NULL) {
status = H5Tcommit2((hid_t)loc_id, tName, (hid_t)type, (hid_t)link_plist_id, (hid_t)create_plist_id, (hid_t)access_plist_id);
status = H5Tcommit2((hid_t)loc_id, tName, (hid_t)type, (hid_t)link_plist_id, (hid_t)create_plist_id, (hid_t)access_plist_id);
UNPIN_JAVA_STRING(name, tName);
UNPIN_JAVA_STRING(name, tName);
if (status < 0)
h5libraryError(env);
if (status < 0)
h5libraryError(env);
}
} /* end Java_hdf_hdf5lib_H5_H5Tcommit */
/*

@ -2634,49 +2634,50 @@ Java_hdf_hdf5lib_H5_H5export_1dataset
h5nullArgument(env, "HDF5Library_export_data: object_path is NULL");
} /* end else if */
else {
PIN_JAVA_STRING0(file_name, fileName);
PIN_JAVA_STRING(file_name, fileName);
if (fileName != NULL) {
file_id = H5Fopen(fileName, (unsigned)H5F_ACC_RDWR, (hid_t)H5P_DEFAULT);
file_id = H5Fopen(fileName, (unsigned)H5F_ACC_RDWR, (hid_t)H5P_DEFAULT);
UNPIN_JAVA_STRING(file_name, fileName);
UNPIN_JAVA_STRING(file_name, fileName);
if (file_id < 0) {
/* throw exception */
h5libraryError(env);
} /* end if */
else {
object_name = ENVPTR->GetStringUTFChars(ENVPAR object_path, &isCopy2);
if (object_name == NULL) {
h5JNIFatalError( env, "H5Dopen: object name not pinned");
if (file_id < 0) {
/* throw exception */
h5libraryError(env);
} /* end if */
else {
dataset_id = H5Dopen2(file_id, object_name, H5P_DEFAULT);
ENVPTR->ReleaseStringUTFChars(ENVPAR object_path, object_name);
if (dataset_id < 0) {
H5Fclose(file_id);
h5libraryError(env);
object_name = ENVPTR->GetStringUTFChars(ENVPAR object_path, &isCopy2);
if (object_name == NULL) {
h5JNIFatalError( env, "H5Dopen: object name not pinned");
} /* end if */
else {
file_export = ENVPTR->GetStringUTFChars(ENVPAR file_export_name, 0);
stream = HDfopen(file_export, "w+");
ENVPTR->ReleaseStringUTFChars(ENVPAR file_export_name, file_export);
dataset_id = H5Dopen2(file_id, object_name, H5P_DEFAULT);
ret_val = h5str_dump_simple_dset(stream, dataset_id, binary_order);
ENVPTR->ReleaseStringUTFChars(ENVPAR object_path, object_name);
if (stream)
HDfclose(stream);
H5Dclose(dataset_id);
H5Fclose(file_id);
if (ret_val < 0)
if (dataset_id < 0) {
H5Fclose(file_id);
h5libraryError(env);
} /* end if */
else {
file_export = ENVPTR->GetStringUTFChars(ENVPAR file_export_name, 0);
stream = HDfopen(file_export, "w+");
ENVPTR->ReleaseStringUTFChars(ENVPAR file_export_name, file_export);
ret_val = h5str_dump_simple_dset(stream, dataset_id, binary_order);
if (stream)
HDfclose(stream);
H5Dclose(dataset_id);
H5Fclose(file_id);
if (ret_val < 0)
h5libraryError(env);
} /* end else */
} /* end else */
} /* end else */
} /* end else */
}
} /* end else */
} /* end Java_hdf_hdf5lib_H5_H5export_1dataset */

@ -88,7 +88,11 @@ set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}
set (testfilter "OK (598 tests)")
if (CMAKE_BUILD_TYPE MATCHES Debug)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;")
if (WIN32)
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_D;")
else()
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=hdf5_java_debug;")
endif()
endif(CMAKE_BUILD_TYPE MATCHES Debug)
add_test (