diff --git a/libs/native/jhdf5/amd64-Linux/libjhdf5.so b/libs/native/jhdf5/amd64-Linux/libjhdf5.so index 02d5d5029e9e7425f35dffcde0bffdbc2de17d18..93ee237affba09ee6670d25d9ec16c18972dd98d 100755 Binary files a/libs/native/jhdf5/amd64-Linux/libjhdf5.so and b/libs/native/jhdf5/amd64-Linux/libjhdf5.so differ diff --git a/source/c/compile_linux_amd64.sh b/source/c/compile_linux_amd64.sh index d675f02022e8ad48a07af8cc548c5818d3f333e7..ad22b5839c89be694d311560cb299b088653e783 100755 --- a/source/c/compile_linux_amd64.sh +++ b/source/c/compile_linux_amd64.sh @@ -8,7 +8,7 @@ fi rm -fR build/jni rm -f build/libjhdf5.so -cp -a jni build/ +cp -a build/hdf5-$VERSION/java/src/jni build/ cp -a *.c build/jni/ cd build cp hdf5-$VERSION/src/H5win32defs.h jni/ diff --git a/source/c/h5lHelperImp.c b/source/c/h5lHelperImp.c index 35d5f17022d45015659bb879e323a8784fdc4ede..6986d4eaf00cb4ab9081781a2781d7cc8a313534 100644 --- a/source/c/h5lHelperImp.c +++ b/source/c/h5lHelperImp.c @@ -17,6 +17,7 @@ #include "hdf5.h" #include "H5Ppublic.h" #include "h5jni.h" +#include "h5util.h" #include <jni.h> #include <stdlib.h> @@ -75,14 +76,12 @@ Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lexists (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong access_id) { htri_t bval = JNI_FALSE; - const char *lName; + const char *lName = NULL; - PIN_JAVA_STRING(name, lName); + PIN_JAVA_STRING(ENVONLY, name, lName, NULL, "H5Lexists: name not pinned"); if (lName != NULL) { bval = H5Lexists((hid_t)loc_id, lName, (hid_t)access_id); - UNPIN_JAVA_STRING(name, lName); - if (bval > 0) bval = JNI_TRUE; else if (bval < 0) @@ -92,10 +91,14 @@ Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lexists bval = JNI_FALSE; } else { - h5libraryError(env); + H5_LIBRARY_ERROR(ENVONLY); } } } + +done: + if (lName != NULL) + UNPIN_JAVA_STRING(ENVONLY, name, lName); return (jboolean)bval; } /* end Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lexists */ @@ -108,37 +111,32 @@ JNIEXPORT jint JNICALL Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lget_1li (JNIEnv *env, jclass clss, jlong loc_id, jstring object_name, jobjectArray linkName) { - jint type; - herr_t status; + jint type = FAIL; + herr_t status = FAIL; long minor_err_num; - char *oName; + const char *oName = NULL; char *linkval_buf; const char *filename; const char *obj_path; - jboolean isCopy; jstring str; H5L_info_t link_info; - H5O_info_t obj_info; + H5O_info1_t obj_info; - PIN_JAVA_STRING(object_name, oName); + PIN_JAVA_STRING(ENVONLY, object_name, oName, NULL, "H5Lget_link_info: name not pinned"); type = H5Lget_info( (hid_t) loc_id, oName, &link_info, H5P_DEFAULT ); if (type < 0) { - UNPIN_JAVA_STRING(object_name, oName); - h5libraryError(env); - return -1; + H5_LIBRARY_ERROR(ENVONLY); } else { str = NULL; if (link_info.type == H5L_TYPE_HARD) { status = H5Oget_info_by_name1(loc_id, oName, &obj_info, H5P_DEFAULT); - UNPIN_JAVA_STRING(object_name, oName); if (status < 0 ) { - h5libraryError(env); - return -1; + H5_LIBRARY_ERROR(ENVONLY); } else { type = obj_info.type; } @@ -155,8 +153,7 @@ JNIEXPORT jint JNICALL Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lget_1li } if (H5Lget_val(loc_id, oName, linkval_buf, link_info.u.val_size, H5P_DEFAULT) < 0) { - h5libraryError(env); - return -1; + H5_LIBRARY_ERROR(ENVONLY); } if (link_info.type == H5L_TYPE_EXTERNAL) { @@ -174,6 +171,10 @@ JNIEXPORT jint JNICALL Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lget_1li } } } + +done: + if (oName != NULL) + UNPIN_JAVA_STRING(ENVONLY, object_name, oName); return (jint)type; } @@ -183,9 +184,9 @@ typedef struct link_info_all JNIEnv *env; char **name; int *type; - char **linkname; - char **linkfname; - void **buf; + const char **linkname; + const char **linkfname; + char **buf; int count; } link_info_all_t; @@ -207,7 +208,7 @@ herr_t link_names_all(hid_t loc_id, const char *name, const H5L_info_t *link_inf return 0; } -herr_t H5Lget_link_names_all( JNIEnv *env, hid_t loc_id, char *group_name, char **names ) +herr_t H5Lget_link_names_all( JNIEnv *env, hid_t loc_id, const char *group_name, char **names ) { link_info_all_t info; info.env = env; @@ -228,37 +229,32 @@ JNIEXPORT jint JNICALL Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lget_1li (JNIEnv *env, jclass clss, jlong loc_id, jstring group_name, jobjectArray oname, jint n) { - herr_t status; - char *gName=NULL; - char **oName=NULL; - char **lName=NULL; + herr_t status = FAIL; + const char *gName = NULL; + char **oName = NULL; + char **lName = NULL; jstring str; jboolean isCopy; int i; if (oname == NULL) { - h5nullArgument( env, "_H5Lget_link_names_all: oname is NULL"); - return -1; + H5_NULL_ARGUMENT_ERROR(ENVONLY, "_H5Lget_link_names_all: oname is NULL"); } - PIN_JAVA_STRING(group_name, gName); + PIN_JAVA_STRING(ENVONLY, group_name, gName, NULL, "H5Lget_link_names_all: group_name not pinned"); - oName = malloc(n * sizeof (*oName)); + oName = HDmalloc(n * sizeof (*oName)); if (oName == NULL) { - UNPIN_JAVA_STRING(group_name, gName); - h5outOfMemory(env, "_H5Lget_link_names_all: malloc failed"); - return -1; + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "_H5Lget_link_names_all: failed to allocate oName buffer"); } for (i=0; i<n; i++) { oName[i] = NULL; } /* for (i=0; i<n; i++)*/ - status = H5Lget_link_names_all(env, (hid_t) loc_id, gName, oName); - - UNPIN_JAVA_STRING(group_name, gName); + status = H5Lget_link_names_all(env, (hid_t) loc_id, gName, oName); if (status < 0) { h5str_array_free(oName, n); - h5libraryError(env); + H5_LIBRARY_ERROR(ENVONLY); } else { for (i=0; i<n; i++) { if (*(oName+i)) { @@ -268,6 +264,10 @@ JNIEXPORT jint JNICALL Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lget_1li } /* for (i=0; i<n; i++)*/ h5str_array_free(oName, n); } + +done: + if (gName != NULL) + UNPIN_JAVA_STRING(ENVONLY, group_name, gName); return (jint)status; @@ -277,11 +277,11 @@ JNIEXPORT jint JNICALL Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lget_1li herr_t link_info_all(hid_t loc_id, const char *name, const H5L_info_t *link_info, void *opdata) { link_info_all_t* info = (link_info_all_t*)opdata; - H5O_info_t obj_info; + H5O_info1_t obj_info; char *linkval_buf; const char *filename; const char *obj_path; - *(info->name+info->count) = (char *) malloc(strlen(name)+1); + *(info->name+info->count) = (char *) HDmalloc(strlen(name)+1); if (*(info->name+info->count) == NULL) { h5outOfMemory(info->env, "H5Lget_link_info_all: malloc failed"); @@ -306,7 +306,7 @@ herr_t link_info_all(hid_t loc_id, const char *name, const H5L_info_t *link_info *(info->type+info->count) = H5O_TYPE_NTYPES + link_info->type; if (info->linkname != NULL) { - linkval_buf = (char*) malloc(link_info->u.val_size); + linkval_buf = (char*) HDmalloc(link_info->u.val_size); if (linkval_buf == NULL) { h5outOfMemory(info->env, "H5Lget_link_info_all: malloc failed"); @@ -337,7 +337,7 @@ herr_t link_info_all(hid_t loc_id, const char *name, const H5L_info_t *link_info return 0; } -herr_t H5Lget_link_info_all( JNIEnv *env, hid_t loc_id, char *group_name, char **names, int *linktypes, char **linknames, char **linkfnames, void **buf ) +herr_t H5Lget_link_info_all( JNIEnv *env, hid_t loc_id, const char *group_name, char **names, int *linktypes, const char **linknames, const char **linkfnames, char **buf ) { link_info_all_t info; info.env = env; @@ -362,18 +362,17 @@ JNIEXPORT jint JNICALL Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lget_1li (JNIEnv *env, jclass clss, jlong loc_id, jstring group_name, jobjectArray oname, jintArray otype, jobjectArray lname, jobjectArray lfname, jint n) { - herr_t status; - char *gName=NULL; - char **oName=NULL; - char **lName=NULL; - char **lfName=NULL; - void **buf=NULL; - jboolean isCopy; + herr_t status = FAIL; + const char *gName = NULL; + char **oName = NULL; + char **lName = NULL; + char **lfName = NULL; + char **buf = NULL; jstring str; jint *tarr; int i; - PIN_JAVA_STRING(group_name, gName); + PIN_JAVA_STRING(ENVONLY, group_name, gName, NULL, "H5Lget_link_info_all: group_name not pinned"); if (oname == NULL) { h5nullArgument( env, "H5Lget_link_info_all: oname is NULL"); @@ -390,19 +389,17 @@ JNIEXPORT jint JNICALL Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lget_1li return -1; } - tarr = (*env)->GetIntArrayElements(env,otype,&isCopy); + tarr = (*env)->GetIntArrayElements(env,otype, NULL); if (tarr == NULL) { (*env)->ReleaseStringUTFChars(env,group_name,gName); h5JNIFatalError( env, "H5Lget_link_info_all: type not pinned"); return -1; } - oName = malloc(n * sizeof (*oName)); + oName = HDmalloc(n * sizeof (*oName)); if (oName == NULL) { - UNPIN_JAVA_STRING(group_name, gName); (*env)->ReleaseIntArrayElements(env,otype,tarr,0); - h5outOfMemory(env, "H5Lget_link_info_all: malloc failed"); - return -1; + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Lget_link_info_all: malloc failed"); } for (i=0; i<n; i++) { @@ -412,30 +409,24 @@ JNIEXPORT jint JNICALL Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lget_1li { lName = malloc(n * sizeof (*lName)); if (lName == NULL) { - UNPIN_JAVA_STRING(group_name, gName); (*env)->ReleaseIntArrayElements(env,otype,tarr,0); h5str_array_free(oName, n); - h5outOfMemory(env, "H5Lget_link_info_all: malloc failed"); - return -1; + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Lget_link_info_all: malloc failed"); } lfName = malloc(n * sizeof (*lfName)); if (lfName == NULL) { - UNPIN_JAVA_STRING(group_name, gName); (*env)->ReleaseIntArrayElements(env,otype,tarr,0); h5str_array_free(oName, n); free(lName); - h5outOfMemory(env, "H5Lget_link_info_all: malloc failed"); - return -1; + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Lget_link_info_all: malloc failed"); } buf = malloc(n * sizeof (*buf)); if (buf == NULL) { - UNPIN_JAVA_STRING(group_name, gName); (*env)->ReleaseIntArrayElements(env,otype,tarr,0); h5str_array_free(oName, n); free(lName); free(lfName); - h5outOfMemory(env, "H5Lget_link_info_all: malloc failed"); - return -1; + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Lget_link_info_all: malloc failed"); } for (i=0; i<n; i++) { lName[i] = NULL; @@ -443,9 +434,8 @@ JNIEXPORT jint JNICALL Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lget_1li buf[i] = NULL; } /* for (i=0; i<n; i++)*/ } - status = H5Lget_link_info_all( env, (hid_t) loc_id, gName, oName, (int *)tarr, lName, lfName, buf ); + status = H5Lget_link_info_all( env, (hid_t) loc_id, gName, oName, (int *)tarr, (const char **)lName, (const char **)lfName, buf ); - UNPIN_JAVA_STRING(group_name, gName); if (status < 0) { (*env)->ReleaseIntArrayElements(env,otype,tarr,JNI_ABORT); h5str_array_free(oName, n); @@ -455,7 +445,7 @@ JNIEXPORT jint JNICALL Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lget_1li h5str_array_free(lfName, n); h5str_array_free(buf, n); } - h5libraryError(env); + H5_LIBRARY_ERROR(ENVONLY); } else { (*env)->ReleaseIntArrayElements(env,otype,tarr,0); @@ -486,6 +476,10 @@ JNIEXPORT jint JNICALL Java_ch_systemsx_cisd_hdf5_hdf5lib_HDFHelper__1H5Lget_1li } h5str_array_free(oName, n); } + +done: + if (gName != NULL) + UNPIN_JAVA_STRING(ENVONLY, group_name, gName); return (jint)status; diff --git a/source/c/version.sh b/source/c/version.sh index cd88f74e43466772f49d15c5601c37aa9c686f47..5621bc4eac058c6c6bc44e04f2a344769712100a 100755 --- a/source/c/version.sh +++ b/source/c/version.sh @@ -1,2 +1,2 @@ -VERSION=1.10.5 +VERSION=1.12.0 POSTFIX= diff --git a/source/java/ch/systemsx/cisd/hdf5/HDF5.java b/source/java/ch/systemsx/cisd/hdf5/HDF5.java index 7c5d57f5ab077c7e966a9fab600a9c1937859ea1..abba0527860a145976089b538cca43e5c67309e0 100644 --- a/source/java/ch/systemsx/cisd/hdf5/HDF5.java +++ b/source/java/ch/systemsx/cisd/hdf5/HDF5.java @@ -279,9 +279,7 @@ class HDF5 public long openObject(long fileId, String path, ICleanUpRegistry registry) { checkMaxLength(path); - final long objectId = - isReference(path) ? H5Oopen_by_addr(fileId, Long.parseLong(path.substring(1))) - : H5Oopen(fileId, path, H5P_DEFAULT); + final long objectId = H5Oopen(fileId, path, H5P_DEFAULT); registry.registerCleanUp(new Runnable() { @Override @@ -372,8 +370,7 @@ class HDF5 public long openGroup(long fileId, String path, ICleanUpRegistry registry) { checkMaxLength(path); - final long groupId = isReference(path) ? H5Oopen_by_addr(fileId, Long.parseLong(path.substring(1))) - : H5Gopen(fileId, path, H5P_DEFAULT); + final long groupId = H5Gopen(fileId, path, H5P_DEFAULT); registry.registerCleanUp(new Runnable() { @Override @@ -932,8 +929,7 @@ class HDF5 public long openDataSet(long fileId, String path, ICleanUpRegistry registry) { checkMaxLength(path); - final long dataSetId = isReference(path) ? H5Oopen_by_addr(fileId, Long.parseLong(path.substring(1))) - : H5Dopen(fileId, path, H5P_DEFAULT); + final long dataSetId = H5Dopen(fileId, path, H5P_DEFAULT); if (registry != null) { registry.registerCleanUp(new Runnable() @@ -948,6 +944,7 @@ class HDF5 return dataSetId; } + // TODO: remove! boolean isReference(String path) { return autoDereference && (path.charAt(0) == '\0'); @@ -1778,8 +1775,7 @@ class HDF5 public long openDataType(long fileId, String name, ICleanUpRegistry registry) { checkMaxLength(name); - final long dataTypeId = isReference(name) ? H5Oopen_by_addr(fileId, Long.parseLong(name.substring(1))) - : H5Topen(fileId, name, H5P_DEFAULT); + final long dataTypeId = H5Topen(fileId, name, H5P_DEFAULT); registry.registerCleanUp(new Runnable() { @Override diff --git a/source/java/ch/systemsx/cisd/hdf5/HDF5ObjectInformation.java b/source/java/ch/systemsx/cisd/hdf5/HDF5ObjectInformation.java index 8f5b98449909197e6a155e044a93de7e739d7c80..3c1d2215fa011687b0eec9a143e50ec98b39e93f 100644 --- a/source/java/ch/systemsx/cisd/hdf5/HDF5ObjectInformation.java +++ b/source/java/ch/systemsx/cisd/hdf5/HDF5ObjectInformation.java @@ -16,7 +16,10 @@ package ch.systemsx.cisd.hdf5; +import java.util.Arrays; + import hdf.hdf5lib.structs.H5O_info_t; +import hdf.hdf5lib.structs.H5O_token_t; /** * Information about an object in an HDF5 file. @@ -28,7 +31,7 @@ public final class HDF5ObjectInformation extends HDF5CommonInformation private final long fileNumber; - private final long address; + private final H5O_token_t token; private final int referenceCount; @@ -40,7 +43,7 @@ public final class HDF5ObjectInformation extends HDF5CommonInformation { super(path, objectType); this.fileNumber = info.fileno; - this.address = info.addr; + this.token = info.token; this.referenceCount = info.rc; this.creationTime = info.ctime; this.numberOfAttributes = info.num_attrs; @@ -59,9 +62,9 @@ public final class HDF5ObjectInformation extends HDF5CommonInformation * Returns the address of the object in the file. If the address of two links is the same, then * they point to the same object. Can be used to spot hard or soft links. */ - public long getAddress() + public H5O_token_t getToken() { - return address; + return token; } /** @@ -96,7 +99,7 @@ public final class HDF5ObjectInformation extends HDF5CommonInformation final int prime = 31; int result = 1; result = prime * result + ((path == null) ? 0 : path.hashCode()); - result = prime * result + ((int) address); + result = prime * result + Arrays.hashCode(token.data); return result; } @@ -126,7 +129,7 @@ public final class HDF5ObjectInformation extends HDF5CommonInformation { return false; } - if (other.address != address) + if (other.token.equals(token) == false) { return false; } diff --git a/source/java/ch/systemsx/cisd/hdf5/hdf5lib/HDFHelper.java b/source/java/ch/systemsx/cisd/hdf5/hdf5lib/HDFHelper.java index b04c43b55d78d19c710332d1b66a2d6feb124185..d3ed9299f0a8596c9d7e0712e2abeec2947499d6 100644 --- a/source/java/ch/systemsx/cisd/hdf5/hdf5lib/HDFHelper.java +++ b/source/java/ch/systemsx/cisd/hdf5/hdf5lib/HDFHelper.java @@ -101,7 +101,7 @@ public class HDFHelper } } - return new H5O_info_t(-1, -1, -1, -1, -1, -1, -1, -1, -1, null, null, null); + return new H5O_info_t(-1, null, -1, -1, -1, -1, -1, -1, -1); } /** diff --git a/source/java/hdf/CMakeLists.txt b/source/java/hdf/CMakeLists.txt index 161ddf1bef326ef333f22b4dadede1f268f1b8b6..5660158d25348832e7aae6e29ec3d3e79e0b8335 100644 --- a/source/java/hdf/CMakeLists.txt +++ b/source/java/hdf/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.10) +cmake_minimum_required (VERSION 3.12) project (HDF5_JAVA_HDF C) add_subdirectory (hdf5lib) diff --git a/source/java/hdf/hdf5lib/CMakeLists.txt b/source/java/hdf/hdf5lib/CMakeLists.txt index c171ea89cdea828b410ee1e27fe11a52992a99c7..f3d9b8de8054378ceb02c73e6de47ce74e9fea68 100644 --- a/source/java/hdf/hdf5lib/CMakeLists.txt +++ b/source/java/hdf/hdf5lib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.10) +cmake_minimum_required (VERSION 3.12) project (HDF5_JAVA_HDF_HDF5 Java) set (CMAKE_VERBOSE_MAKEFILE 1) @@ -18,10 +18,10 @@ set (HDF5_JAVA_HDF_HDF5_CALLBACKS_SOURCES callbacks/H5D_iterate_t.java callbacks/H5E_walk_cb.java callbacks/H5E_walk_t.java - callbacks/H5L_iterate_cb.java callbacks/H5L_iterate_t.java - callbacks/H5O_iterate_cb.java + callbacks/H5L_iterate_opdata_t.java callbacks/H5O_iterate_t.java + callbacks/H5O_iterate_opdata_t.java callbacks/H5P_cls_close_func_cb.java callbacks/H5P_cls_close_func_t.java callbacks/H5P_cls_copy_func_cb.java @@ -73,10 +73,14 @@ set (HDF5_JAVA_HDF_HDF5_STRUCTS_SOURCES structs/H5AC_cache_config_t.java structs/H5E_error2_t.java structs/H5F_info2_t.java + structs/H5FD_ros3_fapl_t.java + structs/H5FD_hdfs_fapl_t.java structs/H5G_info_t.java structs/H5L_info_t.java structs/H5O_hdr_info_t.java structs/H5O_info_t.java + structs/H5O_native_info_t.java + structs/H5O_token_t.java ) set (HDF5_JAVA_HDF_HDF5_SOURCES diff --git a/source/java/hdf/hdf5lib/H5.java b/source/java/hdf/hdf5lib/H5.java index eaa8de81aad51e2fec7605b1543783a973b633c7..1f1dd848fd5f90f669e0a434e5f0e8c4b4a10ffc 100644 --- a/source/java/hdf/hdf5lib/H5.java +++ b/source/java/hdf/hdf5lib/H5.java @@ -23,9 +23,9 @@ import hdf.hdf5lib.callbacks.H5D_iterate_cb; import hdf.hdf5lib.callbacks.H5D_iterate_t; import hdf.hdf5lib.callbacks.H5E_walk_cb; import hdf.hdf5lib.callbacks.H5E_walk_t; -import hdf.hdf5lib.callbacks.H5L_iterate_cb; +import hdf.hdf5lib.callbacks.H5L_iterate_opdata_t; import hdf.hdf5lib.callbacks.H5L_iterate_t; -import hdf.hdf5lib.callbacks.H5O_iterate_cb; +import hdf.hdf5lib.callbacks.H5O_iterate_opdata_t; import hdf.hdf5lib.callbacks.H5O_iterate_t; import hdf.hdf5lib.callbacks.H5P_iterate_cb; import hdf.hdf5lib.callbacks.H5P_iterate_t; @@ -34,10 +34,14 @@ import hdf.hdf5lib.exceptions.HDF5JavaException; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.structs.H5AC_cache_config_t; import hdf.hdf5lib.structs.H5A_info_t; +import hdf.hdf5lib.structs.H5FD_hdfs_fapl_t; +import hdf.hdf5lib.structs.H5FD_ros3_fapl_t; import hdf.hdf5lib.structs.H5F_info2_t; import hdf.hdf5lib.structs.H5G_info_t; import hdf.hdf5lib.structs.H5L_info_t; import hdf.hdf5lib.structs.H5O_info_t; +import hdf.hdf5lib.structs.H5O_native_info_t; +import hdf.hdf5lib.structs.H5O_token_t; /** * This class is the Java interface for the HDF5 library. @@ -55,8 +59,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * In general, arguments to the HDF Java API are straightforward translations from the 'C' API described in the HDF * Reference Manual. * - * <center> - * <table border=2 cellpadding=2> + * <table border=1> * <caption><b>HDF-5 C types to Java types</b> </caption> * <tr> * <td><b>HDF-5</b></td> @@ -92,8 +95,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * <td>Special -- see HDFArray</td> * </tr> * </table> - * </center> - * <center> <b>General Rules for Passing Arguments and Results</b> </center> + * <b>General Rules for Passing Arguments and Results</b> * <p> * In general, arguments passed <b>IN</b> to Java are the analogous basic types, as above. The exception is for arrays, * which are discussed below. @@ -128,7 +130,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * <p> * All the routines where this convention is used will have specific documentation of the details, given below. * <p> - * <a NAME="ARRAYS"> <b>Arrays</b> </a> + * <b>Arrays</b> * <p> * HDF5 needs to read and write multi-dimensional arrays of any number type (and records). The HDF5 API describes the * layout of the source and destination, and the data for the array passed as a block of bytes, for instance, @@ -161,7 +163,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * and the parameter <i>data</i> can be any multi-dimensional array of numbers, such as float[][], or int[][][], or * Double[][]. * <p> - * <a NAME="CONSTANTS"> <b>HDF-5 Constants</b></a> + * <b>HDF-5 Constants</b> * <p> * The HDF-5 API defines a set of constants and enumerated values. Most of these values are available to Java programs * via the class <a href="./hdf.hdf5lib.HDF5Constants.html"> <b>HDF5Constants</b></a>. For example, the parameters for @@ -181,7 +183,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * The Java application uses both types of constants the same way, the only difference is that the * <b><i>HDF5CDataTypes</i></b> may have different values on different platforms. * <p> - * <a NAME="ERRORS"> <b>Error handling and Exceptions</b></a> + * <b>Error handling and Exceptions</b> * <p> * The HDF5 error API (H5E) manages the behavior of the error stack in the HDF-5 library. This API is omitted from the * JHI5. Errors are converted into Java exceptions. This is totally different from the C interface, but is very natural @@ -199,7 +201,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * exception handlers to print out the HDF-5 error stack. * <hr> * - * @version HDF5 1.10.3 <BR> + * @version HDF5 1.12.0 <BR> * <b>See also: <a href ="./hdf.hdf5lib.HDFArray.html"> hdf.hdf5lib.HDFArray</a> </b><BR> * <a href ="./hdf.hdf5lib.HDF5Constants.html"> hdf.hdf5lib.HDF5Constants</a><BR> * <a href ="./hdf.hdf5lib.HDF5CDataTypes.html"> hdf.hdf5lib.HDF5CDataTypes</a><BR> @@ -220,12 +222,19 @@ public class H5 implements java.io.Serializable { * * Make sure to update the versions number when a different library is used. */ - public final static int LIB_VERSION[] = { 1, 10, 3 }; + public final static int LIB_VERSION[] = { 1, 12, 0 }; - private static boolean isLibraryLoaded = false; + public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib"; + // add system property to load library by name from library path, via + // System.loadLibrary() + public final static String H5_LIBRARY_NAME_PROPERTY_KEY = "hdf.hdf5lib.H5.loadLibraryName"; + private static String s_libraryName; + private static boolean isLibraryLoaded = false; private static int openFileCount = 0; - + + private final static boolean IS_CRITICAL_PINNING = true; + static { loadH5Lib(); } @@ -419,9 +428,9 @@ public class H5 implements java.io.Serializable { private synchronized static native boolean H5is_library_threadsafe(); // /////// unimplemented //////// - // H5_DLL herr_t H5free_memory(void *mem); - // H5_DLL void *H5allocate_memory(size_t size, hbool_t clear); - // H5_DLL void *H5resize_memory(void *mem, size_t size); + // herr_t H5free_memory(void *mem); + // void *H5allocate_memory(size_t size, hbool_t clear); + // void *H5resize_memory(void *mem, size_t size); // //////////////////////////////////////////////////////////// // // @@ -759,7 +768,8 @@ public class H5 implements java.io.Serializable { * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public static long H5Aget_space(long attr_id) throws HDF5LibraryException { + public static long H5Aget_space(long attr_id) throws HDF5LibraryException + { long id = _H5Aget_space(attr_id); return id; } @@ -790,7 +800,8 @@ public class H5 implements java.io.Serializable { * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public static long H5Aget_type(long attr_id) throws HDF5LibraryException { + public static long H5Aget_type(long attr_id) throws HDF5LibraryException + { long id = _H5Aget_type(attr_id); return id; } @@ -815,8 +826,9 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - Name is null. **/ - public static long H5Aopen(long obj_id, String attr_name, long aapl_id) throws HDF5LibraryException, - NullPointerException { + public static long H5Aopen(long obj_id, String attr_name, long aapl_id) + throws HDF5LibraryException, NullPointerException + { long id = _H5Aopen(obj_id, attr_name, aapl_id); return id; } @@ -851,7 +863,8 @@ public class H5 implements java.io.Serializable { * - Name is null. **/ public static long H5Aopen_by_idx(long loc_id, String obj_name, int idx_type, int order, long n, long aapl_id, - long lapl_id) throws HDF5LibraryException, NullPointerException { + long lapl_id) throws HDF5LibraryException, NullPointerException + { long id = _H5Aopen_by_idx(loc_id, obj_name, idx_type, order, n, aapl_id, lapl_id); return id; } @@ -881,7 +894,8 @@ public class H5 implements java.io.Serializable { * - obj_name is null. **/ public static long H5Aopen_by_name(long loc_id, String obj_name, String attr_name, long aapl_id, long lapl_id) - throws HDF5LibraryException, NullPointerException { + throws HDF5LibraryException, NullPointerException + { long id = _H5Aopen_by_name(loc_id, obj_name, attr_name, aapl_id, lapl_id); return id; } @@ -897,8 +911,10 @@ public class H5 implements java.io.Serializable { * IN: Identifier of an attribute to read. * @param mem_type_id * IN: Identifier of the attribute datatype (in memory). - * @param buf - * IN: Buffer for data to be read. + * @param obj + * Buffer to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * * @return a non-negative value if successful * @@ -907,9 +923,19 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - data buffer is null. **/ - public synchronized static native int H5Aread(long attr_id, long mem_type_id, byte[] buf) + public synchronized static native int H5Aread(long attr_id, long mem_type_id, byte[] obj, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + public synchronized static int H5Aread(long attr_id, long mem_type_id, byte[] buf) throws HDF5LibraryException, NullPointerException + { + return H5Aread(attr_id, mem_type_id, buf, true); + } + + public synchronized static int H5Aread(long attr_id, long mem_type_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException + { + return H5Aread(attr_id, mem_type_id, obj, true); + } + /** * H5Aread reads an attribute, specified with attr_id. The attribute's memory datatype is specified with * mem_type_id. The entire attribute is read into data object from the file. @@ -920,31 +946,135 @@ public class H5 implements java.io.Serializable { * IN: Identifier of the attribute datatype (in memory). * @param obj * IN: Object for data to be read. + * @param isCriticalPinning + * request lock on data reference. * * @return a non-negative value if successful * + * @exception HDF5Exception + * - Failure in the data conversion. * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException * - data buffer is null. See public synchronized static native int H5Aread( ) **/ - public synchronized static int H5Aread(long attr_id, long mem_type_id, Object obj) throws HDF5Exception, - NullPointerException { - HDFArray theArray = new HDFArray(obj); - byte[] buf = theArray.emptyBytes(); + public synchronized static int H5Aread(long attr_id, long mem_type_id, Object obj, boolean isCriticalPinning) + throws HDF5Exception, HDF5LibraryException, NullPointerException + { + int status = -1; + boolean is1D = false; - // This will raise an exception if there is an error - int status = H5Aread(attr_id, mem_type_id, buf); + Class dataClass = obj.getClass(); + if (!dataClass.isArray()) { + throw (new HDF5JavaException("H5Aread: data is not an array")); + } - // No exception: status really ought to be OK - if (status >= 0) { - obj = theArray.arrayify(buf); + String cname = dataClass.getName(); + is1D = (cname.lastIndexOf('[') == cname.indexOf('[')); + char dname = cname.charAt(cname.lastIndexOf("[") + 1); + + if (is1D && (dname == 'B')) { + status = H5Aread(attr_id, mem_type_id, (byte[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'S')) { + status = H5Aread_short(attr_id, mem_type_id, (short[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'I')) { + status = H5Aread_int(attr_id, mem_type_id, (int[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'J')) { + status = H5Aread_long(attr_id, mem_type_id, (long[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'F')) { + status = H5Aread_float(attr_id, mem_type_id, (float[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'D')) { + status = H5Aread_double(attr_id, mem_type_id, (double[]) obj, isCriticalPinning); + } + else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) && + (is1D && (dataClass.getComponentType() == String.class))) || + H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) { + status = H5Aread_reg_ref(attr_id, mem_type_id, (String[]) obj); + } + else if (is1D && (dataClass.getComponentType() == String.class)) { + status = H5Aread_string(attr_id, mem_type_id, (String[]) obj); + } + else { + // Create a data buffer to hold the data into a Java Array + HDFArray theArray = new HDFArray(obj); + byte[] buf = theArray.emptyBytes(); + + // This will raise an exception if there is an error + status = H5Aread(attr_id, mem_type_id, buf, isCriticalPinning); + + // No exception: status really ought to be OK + if (status >= 0) { + obj = theArray.arrayify(buf); + } + + // clean up these: assign 'null' as hint to gc() + buf = null; + theArray = null; } return status; } - public synchronized static native int H5AreadVL(long attr_id, long mem_type_id, String[] buf) + public synchronized static native int H5Aread_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + public synchronized static int H5Aread_double(long attr_id, long mem_type_id, double[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Aread_double(attr_id, mem_type_id, buf, true); + } + + public synchronized static native int H5Aread_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + public synchronized static int H5Aread_float(long attr_id, long mem_type_id, float[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Aread_float(attr_id, mem_type_id, buf, true); + } + + public synchronized static native int H5Aread_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + public synchronized static int H5Aread_int(long attr_id, long mem_type_id, int[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Aread_int(attr_id, mem_type_id, buf, true); + } + + public synchronized static native int H5Aread_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + public synchronized static int H5Aread_long(long attr_id, long mem_type_id, long[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Aread_long(attr_id, mem_type_id, buf, true); + } + + public synchronized static native int H5Aread_reg_ref(long attr_id, long mem_type_id, String[] buf) + throws HDF5LibraryException, NullPointerException; + + public synchronized static native int H5Aread_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + public synchronized static int H5Aread_short(long attr_id, long mem_type_id, short[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Aread_short(attr_id, mem_type_id, buf, true); + } + + public synchronized static native int H5AreadVL(long attr_id, long mem_type_id, Object[] buf) + throws HDF5LibraryException, NullPointerException; + + public synchronized static native int H5Aread_string(long attr_id, long mem_type_id, String[] buf) + throws HDF5LibraryException, NullPointerException; + + public synchronized static native int H5Aread_VLStrings(long attr_id, long mem_type_id, Object[] buf) throws HDF5LibraryException, NullPointerException; public synchronized static native int H5AreadComplex(long attr_id, long mem_type_id, String[] buf) @@ -1005,7 +1135,9 @@ public class H5 implements java.io.Serializable { * @param mem_type_id * IN: Identifier of the attribute datatype (in memory). * @param buf - * IN: Data to be written. + * IN: Buffer with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. * * @return a non-negative value if successful * @@ -1014,9 +1146,21 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - data is null. **/ - public synchronized static native int H5Awrite(long attr_id, long mem_type_id, byte[] buf) + public synchronized static native int H5Awrite(long attr_id, long mem_type_id, byte[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + public synchronized static int H5Awrite(long attr_id, long mem_type_id, byte[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Awrite(attr_id, mem_type_id, buf, true); + } + + public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj) + throws HDF5Exception, HDF5LibraryException, NullPointerException + { + return H5Awrite(attr_id, mem_type_id, obj, true); + } + /** * H5Awrite writes an attribute, specified with attr_id. The attribute's memory datatype is specified with * mem_type_id. The entire attribute is written from data object to the file. @@ -1027,28 +1171,139 @@ public class H5 implements java.io.Serializable { * IN: Identifier of the attribute datatype (in memory). * @param obj * IN: Data object to be written. + * @param isCriticalPinning + * request lock on data reference. * * @return a non-negative value if successful * + * @exception HDF5Exception + * - Failure in the data conversion. * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - data object is null. See public synchronized static native int H5Awrite(int attr_id, int - * mem_type_id, byte[] buf); + * - data object is null **/ - public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj) - throws HDF5Exception, NullPointerException + public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj, boolean isCriticalPinning) + throws HDF5Exception, HDF5LibraryException, NullPointerException { - HDFArray theArray = new HDFArray(obj); - byte[] buf = theArray.byteify(); + int status = -1; + boolean is1D = false; - int retVal = H5Awrite(attr_id, mem_type_id, buf); - buf = null; - theArray = null; - return retVal; + Class dataClass = obj.getClass(); + if (!dataClass.isArray()) { + throw (new HDF5JavaException("H5Dwrite: data is not an array")); + } + + String cname = dataClass.getName(); + is1D = (cname.lastIndexOf('[') == cname.indexOf('[')); + char dname = cname.charAt(cname.lastIndexOf("[") + 1); + + if (is1D && (dname == 'B')) { + status = H5Awrite(attr_id, mem_type_id, (byte[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'S')) { + status = H5Awrite_short(attr_id, mem_type_id, (short[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'I')) { + status = H5Awrite_int(attr_id, mem_type_id, (int[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'J')) { + status = H5Awrite_long(attr_id, mem_type_id, (long[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'F')) { + status = H5Awrite_float(attr_id, mem_type_id, (float[]) obj, isCriticalPinning); + } + else if (is1D && (dname == 'D')) { + status = H5Awrite_double(attr_id, mem_type_id, (double[]) obj, isCriticalPinning); + } + else if (is1D && (dataClass.getComponentType() == String.class)) { + status = H5Awrite_string(attr_id, mem_type_id, (String[]) obj); + } + else { + HDFArray theArray = new HDFArray(obj); + byte[] buf = theArray.byteify(); + + status = H5Awrite(attr_id, mem_type_id, buf); + buf = null; + theArray = null; + } + + return status; + } + + public synchronized static native int H5Awrite_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + public synchronized static int H5Awrite_double(long attr_id, long mem_type_id, double[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Awrite_double(attr_id, mem_type_id, buf, true); + } + + public synchronized static native int H5Awrite_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + public synchronized static int H5Awrite_float(long attr_id, long mem_type_id, float[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Awrite_float(attr_id, mem_type_id, buf, true); + } + + public synchronized static native int H5Awrite_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + public synchronized static int H5Awrite_int(long attr_id, long mem_type_id, int[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Awrite_int(attr_id, mem_type_id, buf, true); + } + + public synchronized static native int H5Awrite_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + public synchronized static int H5Awrite_long(long attr_id, long mem_type_id, long[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Awrite_long(attr_id, mem_type_id, buf, true); + } + + public synchronized static native int H5Awrite_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + public synchronized static int H5Awrite_short(long attr_id, long mem_type_id, short[] buf) + throws HDF5LibraryException, NullPointerException + { + return H5Awrite_short(attr_id, mem_type_id, buf, true); } - public synchronized static native int H5AwriteVL(long attr_id, long mem_type_id, String[] buf) + public synchronized static native int H5Awrite_string(long attr_id, long mem_type_id, String[] buf) + throws HDF5LibraryException, NullPointerException; + + public synchronized static native int H5AwriteVL(long attr_id, long mem_type_id, Object[] buf) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Awrite_VLStrings writes a variable length String dataset, specified by its identifier attr_id, from + * the application memory buffer buf into the file. + * + * ---- contributed by Rosetta Biosoftware + * + * @param attr_id + * Identifier of the attribute read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param buf + * Buffer with data to be written to the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ + + public synchronized static native int H5Awrite_VLStrings(long attr_id, long mem_type_id, Object[] buf) throws HDF5LibraryException, NullPointerException; /** @@ -1463,8 +1718,8 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - name is null. **/ - public static long H5Dopen(long loc_id, String name, long dapl_id) throws HDF5LibraryException, - NullPointerException { + public static long H5Dopen(long loc_id, String name, long dapl_id) throws HDF5LibraryException, NullPointerException + { long id = _H5Dopen2(loc_id, name, dapl_id); return id; } @@ -1508,12 +1763,14 @@ public class H5 implements java.io.Serializable { NullPointerException; public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, - long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException { + long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException + { return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, - long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException { + long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException + { return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, obj, true); } @@ -1547,11 +1804,12 @@ public class H5 implements java.io.Serializable { **/ public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object obj, boolean isCriticalPinning) throws HDF5Exception, HDF5LibraryException, - NullPointerException { + NullPointerException + { int status = -1; boolean is1D = false; - Class<? extends Object> dataClass = obj.getClass(); + Class dataClass = obj.getClass(); if (!dataClass.isArray()) { throw (new HDF5JavaException("H5Dread: data is not an array")); } @@ -1573,7 +1831,8 @@ public class H5 implements java.io.Serializable { isCriticalPinning); } else if (is1D && (dname == 'J')) { - status = H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (long[]) obj); + status = H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (long[]) obj, + isCriticalPinning); } else if (is1D && (dname == 'F')) { status = H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (float[]) obj, @@ -1583,7 +1842,9 @@ public class H5 implements java.io.Serializable { status = H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (double[]) obj, isCriticalPinning); } - else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) && (is1D && (dataClass.getComponentType() == String.class))) || H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) { + else if ((H5.H5Tdetect_class(mem_type_id, HDF5Constants.H5T_REFERENCE) && + (is1D && (dataClass.getComponentType() == String.class))) || + H5.H5Tequal(mem_type_id, HDF5Constants.H5T_STD_REF_DSETREG)) { status = H5Dread_reg_ref(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (String[]) obj); } @@ -1617,7 +1878,8 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, NullPointerException; public synchronized static int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException { + long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException + { return H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } @@ -1626,7 +1888,8 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, NullPointerException; public synchronized static int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException { + long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException + { return H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } @@ -1635,7 +1898,8 @@ public class H5 implements java.io.Serializable { NullPointerException; public synchronized static int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException { + long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException + { return H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } @@ -1644,22 +1908,21 @@ public class H5 implements java.io.Serializable { NullPointerException; public synchronized static int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException { + long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException + { return H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } public synchronized static native int H5Dread_reg_ref(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; - public synchronized static native int H5Dread_reg_ref_data(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; - public synchronized static native int H5Dread_short(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, short[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; public synchronized static int H5Dread_short(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, short[] buf) throws HDF5LibraryException, NullPointerException { + long file_space_id, long xfer_plist_id, short[] buf) throws HDF5LibraryException, NullPointerException + { return H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } @@ -1728,7 +1991,10 @@ public class H5 implements java.io.Serializable { * - Error from the HDF-5 Library. * @exception NullPointerException * - buf is null. + * + * @deprecated As of HDF5 1.12.0 in favor of H5Treclaim **/ + @Deprecated public synchronized static native int H5Dvlen_reclaim(long type_id, long space_id, long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException; @@ -1763,12 +2029,14 @@ public class H5 implements java.io.Serializable { NullPointerException; public synchronized static int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, - long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException { + long xfer_plist_id, byte[] buf) throws HDF5LibraryException, NullPointerException + { return H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } public synchronized static int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, - long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException { + long xfer_plist_id, Object obj) throws HDF5Exception, HDF5LibraryException, NullPointerException + { return H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, obj, true); } @@ -1802,11 +2070,12 @@ public class H5 implements java.io.Serializable { **/ public synchronized static int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object obj, boolean isCriticalPinning) throws HDF5Exception, HDF5LibraryException, - NullPointerException { + NullPointerException + { int status = -1; boolean is1D = false; - Class<? extends Object> dataClass = obj.getClass(); + Class dataClass = obj.getClass(); if (!dataClass.isArray()) { throw (new HDF5JavaException("H5Dwrite: data is not an array")); } @@ -1864,7 +2133,8 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, NullPointerException; public synchronized static int H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException { + long file_space_id, long xfer_plist_id, double[] buf) throws HDF5LibraryException, NullPointerException + { return H5Dwrite_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } @@ -1873,7 +2143,8 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, NullPointerException; public synchronized static int H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException { + long file_space_id, long xfer_plist_id, float[] buf) throws HDF5LibraryException, NullPointerException + { return H5Dwrite_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } @@ -1882,7 +2153,8 @@ public class H5 implements java.io.Serializable { NullPointerException; public synchronized static int H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException { + long file_space_id, long xfer_plist_id, int[] buf) throws HDF5LibraryException, NullPointerException + { return H5Dwrite_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } @@ -1891,7 +2163,8 @@ public class H5 implements java.io.Serializable { NullPointerException; public synchronized static int H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException { + long file_space_id, long xfer_plist_id, long[] buf) throws HDF5LibraryException, NullPointerException + { return H5Dwrite_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } @@ -1900,7 +2173,8 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, NullPointerException; public synchronized static int H5Dwrite_short(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, short[] buf) throws HDF5LibraryException, NullPointerException { + long file_space_id, long xfer_plist_id, short[] buf) throws HDF5LibraryException, NullPointerException + { return H5Dwrite_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } @@ -1966,10 +2240,10 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Drefresh(long dset_id) throws HDF5LibraryException; // /////// unimplemented //////// - // H5_DLL herr_t H5Ddebug(hid_t dset_id); - // H5_DLL herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_bytes); - // H5_DLL herr_t H5Dformat_convert(hid_t dset_id); - // H5_DLL herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type); + // herr_t H5Ddebug(hid_t dset_id); + // herr_t H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_bytes); + // herr_t H5Dformat_convert(hid_t dset_id); + // herr_t H5Dget_chunk_index_type(hid_t did, H5D_chunk_index_t *idx_type); // herr_t H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, // size_t dst_buf_size, void *dst_buf, H5D_gather_func_t op, void *op_data); @@ -2315,7 +2589,7 @@ public class H5 implements java.io.Serializable { * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public static synchronized int H5Fclose(long file_id) throws HDF5LibraryException { + public static int H5Fclose(long file_id) throws HDF5LibraryException { if (file_id < 0) return 0; // throw new HDF5LibraryException("Negative ID");; --openFileCount; @@ -2342,7 +2616,7 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - name is null. **/ - public static synchronized long H5Fopen(String name, int flags, long access_id) throws HDF5LibraryException, + public static long H5Fopen(String name, int flags, long access_id) throws HDF5LibraryException, NullPointerException { long id = _H5Fopen(name, flags, access_id); ++openFileCount; @@ -2362,7 +2636,7 @@ public class H5 implements java.io.Serializable { * - Error from the HDF-5 Library. * @return a new file identifier if successful **/ - public static synchronized long H5Freopen(long file_id) throws HDF5LibraryException { + public static long H5Freopen(long file_id) throws HDF5LibraryException { long id = _H5Freopen(file_id); ++openFileCount; return id; @@ -2509,6 +2783,19 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5Fget_intent(long file_id) throws HDF5LibraryException; + /** + * H5Fget_fileno retrieves the "file number" for an open file. + * + * @param file_id + * IN: File identifier for a currently-open HDF5 file + * + * @return the unique file number for the file. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Fget_fileno(long file_id) throws HDF5LibraryException; + /** * H5Fget_mdc_hit_rate queries the metadata cache of the target file to obtain its hit rate (cache hits / (cache * hits + cache misses)) since the last time hit rate statistics were reset. @@ -2617,9 +2904,29 @@ public class H5 implements java.io.Serializable { * - Error from the HDF-5 Library. * @exception NullPointerException * - name is null. + * + * @deprecated As of HDF5 1.10.5 in favor of H5Fis_accessible. **/ + @Deprecated public synchronized static native boolean H5Fis_hdf5(String name) throws HDF5LibraryException, NullPointerException; + /** + * H5Fis_accessible determines if the file can be opened with the given fapl. + * + * @param name + * IN: File name to check. + * @param file_id + * IN: File identifier for a currently-open HDF5 file + * + * @return true if file is accessible, false if not. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ + public synchronized static native boolean H5Fis_accessible(String name, long file_id) throws HDF5LibraryException, NullPointerException; + /** * H5Fmount mounts the file specified by child_id onto the group specified by loc_id and name using the mount * properties plist_id. @@ -2750,21 +3057,66 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Fget_mdc_logging_status(long file_id, boolean[] mdc_logging_status) throws HDF5LibraryException, NullPointerException; + /** + * H5Fget_dset_no_attrs_hint gets the file-level setting to create minimized dataset object headers. + * + * @param file_id + * IN: Identifier of the target file. + * + * @return true if the file-level is set to create minimized dataset object headers, false if not. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native boolean H5Fget_dset_no_attrs_hint(long file_id) + throws HDF5LibraryException; + + + /** + * H5Fset_dset_no_attrs_hint sets the file-level setting to create minimized dataset object headers. + * + * @param file_id + * IN: Identifier of the target file. + * @param minimize + * the minimize hint setting + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Fset_dset_no_attrs_hint(long file_id, boolean minimize) + throws HDF5LibraryException; + + + /** + * H5Fset_libver_bounds sets a different low and high bounds while a file is open. + * + * @param file_id + * IN: Identifier of the target file. + * @param low + * IN: The earliest version of the library that will be used for writing objects + * @param high + * IN: The latest version of the library that will be used for writing objects. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Fset_libver_bounds(long file_id, int low, int high) + throws HDF5LibraryException; + // /////// unimplemented //////// - // H5_DLL herr_t H5Fget_eoa(hid_t file_id, haddr_t *eoa); - // H5_DLL herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment); + // herr_t H5Fget_eoa(hid_t file_id, haddr_t *eoa); + // herr_t H5Fincrement_filesize(hid_t file_id, hsize_t increment); // ssize_t H5Fget_file_image(hid_t file_id, void * buf_ptr, size_t buf_len); // herr_t H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info); // ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/); - // H5_DLL herr_t H5Fset_libver_bounds(hid_t file_id, H5F_libver_t low, H5F_libver_t high); - // H5_DLL herr_t H5Fformat_convert(hid_t fid); - // H5_DLL herr_t H5Freset_page_buffering_stats(hid_t file_id); - // H5_DLL herr_t H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], + // herr_t H5Fformat_convert(hid_t fid); + // herr_t H5Freset_page_buffering_stats(hid_t file_id); + // herr_t H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], // unsigned hits[2], unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]); - // H5_DLL herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_size); + // herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_size); // #ifdef H5_HAVE_PARALLEL - // H5_DLL herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag); - // H5_DLL herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag); + // herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag); + // herr_t H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag); // #endif /* H5_HAVE_PARALLEL */ // /** @@ -2824,25 +3176,25 @@ public class H5 implements java.io.Serializable { // //////////////////////////////////////////////////////////// // /////// unimplemented //////// - // H5_DLL hid_t H5FDregister(const H5FD_class_t *cls); - // H5_DLL herr_t H5FDunregister(hid_t driver_id); - // H5_DLL H5FD_t *H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); - // H5_DLL herr_t H5FDclose(H5FD_t *file); - // H5_DLL int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2); - // H5_DLL int H5FDquery(const H5FD_t *f, unsigned long *flags); - // H5_DLL haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); - // H5_DLL herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); - // H5_DLL haddr_t H5FDget_eoa(H5FD_t *file, H5FD_mem_t type); - // H5_DLL herr_t H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t eoa); - // H5_DLL haddr_t H5FDget_eof(H5FD_t *file, H5FD_mem_t type); - // H5_DLL herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void**file_handle); - // H5_DLL herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/); - // H5_DLL herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf); - // H5_DLL herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing); - // H5_DLL herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing); - // H5_DLL herr_t H5FDlock(H5FD_t *file, hbool_t rw); - // H5_DLL herr_t H5FDunlock(H5FD_t *file); - // H5_DLL herr_t H5FDdriver_query(hid_t driver_id, unsigned long *flags/*out*/); + // hid_t H5FDregister(const H5FD_class_t *cls); + // herr_t H5FDunregister(hid_t driver_id); + // H5FD_t *H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); + // herr_t H5FDclose(H5FD_t *file); + // int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2); + // int H5FDquery(const H5FD_t *f, unsigned long *flags); + // haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); + // herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); + // haddr_t H5FDget_eoa(H5FD_t *file, H5FD_mem_t type); + // herr_t H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t eoa); + // haddr_t H5FDget_eof(H5FD_t *file, H5FD_mem_t type); + // herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void**file_handle); + // herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/); + // herr_t H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf); + // herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing); + // herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing); + // herr_t H5FDlock(H5FD_t *file, hbool_t rw); + // herr_t H5FDunlock(H5FD_t *file); + // herr_t H5FDdriver_query(hid_t driver_id, unsigned long *flags/*out*/); // //////////////////////////////////////////////////////////// // // @@ -3019,8 +3371,8 @@ public class H5 implements java.io.Serializable { * OUT: Names of all objects under the group, name. * @param objTypes * OUT: Types of all objects under the group, name. - * @param objRef - * OUT: Reference number of all objects under the group, name. + * @param tokens + * OUT: Object token of all objects under the group, name. * * @return the number of items found * @@ -3030,26 +3382,26 @@ public class H5 implements java.io.Serializable { * - name is null. */ public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes, - long[] objRef) throws HDF5LibraryException, NullPointerException { + H5O_token_t[] tokens) throws HDF5LibraryException, NullPointerException { if (objNames == null) { throw new NullPointerException("H5Gget_obj_info_all(): name array is null"); } - return H5Gget_obj_info_all(loc_id, name, objNames, objTypes, null, null, objRef, HDF5Constants.H5_INDEX_NAME); + return H5Gget_obj_info_all(loc_id, name, objNames, objTypes, null, null, tokens, HDF5Constants.H5_INDEX_NAME); } public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype, - int[] ltype, long[] ref, int indx_type) throws HDF5LibraryException, NullPointerException { - return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, null, ref, indx_type, -1); + int[] ltype, H5O_token_t[] tokens, int indx_type) throws HDF5LibraryException, NullPointerException { + return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, null, tokens, indx_type, -1); } public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] oname, int[] otype, - int[] ltype, long[] fno, long[] ref, int indx_type) throws HDF5LibraryException, NullPointerException { - return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, ref, oname.length, indx_type, -1); + int[] ltype, long[] fno, H5O_token_t[] tokens, int indx_type) throws HDF5LibraryException, NullPointerException { + return H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, tokens, indx_type, -1); } public synchronized static int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype, - int[] ltype, long[] fno, long[] ref, int indx_type, int indx_order) throws HDF5LibraryException, + int[] ltype, long[] fno, H5O_token_t[] tokens, int indx_type, int indx_order) throws HDF5LibraryException, NullPointerException { if (oname == null) { throw new NullPointerException("H5Gget_obj_info_full(): name array is null"); @@ -3071,7 +3423,7 @@ public class H5 implements java.io.Serializable { ltype = new int[otype.length]; if (fno == null) - fno = new long[ref.length]; + fno = new long[tokens.length]; if (indx_type < 0) indx_type = HDF5Constants.H5_INDEX_NAME; @@ -3079,13 +3431,13 @@ public class H5 implements java.io.Serializable { if (indx_order < 0) indx_order = HDF5Constants.H5_ITER_INC; - int status = H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, ref, oname.length, indx_type, + int status = H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, tokens, oname.length, indx_type, indx_order); return status; } private synchronized static native int H5Gget_obj_info_full(long loc_id, String name, String[] oname, int[] otype, - int[] ltype, long[] fno, long[] ref, int n, int indx_type, int indx_order) throws HDF5LibraryException, + int[] ltype, long[] fno, H5O_token_t[] tokens, int n, int indx_type, int indx_order) throws HDF5LibraryException, NullPointerException; /** @@ -3140,8 +3492,8 @@ public class H5 implements java.io.Serializable { * OUT: Types of all objects under the group, name. * @param lnkTypes * OUT: Types of all links under the group, name. - * @param objRef - * OUT: Reference number of all objects under the group, name. + * @param objToken + * OUT: Object token of all objects under the group, name. * @param objMax * IN: Maximum number of all objects under the group, name. * @@ -3153,7 +3505,7 @@ public class H5 implements java.io.Serializable { * - name is null. */ public synchronized static int H5Gget_obj_info_max(long loc_id, String[] objNames, int[] objTypes, int[] lnkTypes, - long[] objRef, long objMax) throws HDF5LibraryException, NullPointerException { + H5O_token_t[] objToken, long objMax) throws HDF5LibraryException, NullPointerException { if (objNames == null) { throw new NullPointerException("H5Gget_obj_info_max(): name array is null"); } @@ -3178,11 +3530,11 @@ public class H5 implements java.io.Serializable { throw new HDF5LibraryException("H5Gget_obj_info_max(): name and type array sizes are different"); } - return H5Gget_obj_info_max(loc_id, objNames, objTypes, lnkTypes, objRef, objMax, objNames.length); + return H5Gget_obj_info_max(loc_id, objNames, objTypes, lnkTypes, objToken, objMax, objNames.length); } private synchronized static native int H5Gget_obj_info_max(long loc_id, String[] oname, int[] otype, int[] ltype, - long[] ref, long amax, int n) throws HDF5LibraryException, NullPointerException; + H5O_token_t[] tokens, long amax, int n) throws HDF5LibraryException, NullPointerException; /** * H5Gn_members report the number of objects in a Group. The 'objects' include everything that will be visited by @@ -3294,7 +3646,7 @@ public class H5 implements java.io.Serializable { // //////////////////////////////////////////////////////////// // // - // H5I: HDF5 1.8 Identifier Interface API Functions // + // H5I: HDF5 Identifier Interface API Functions // // // // //////////////////////////////////////////////////////////// @@ -3450,12 +3802,20 @@ public class H5 implements java.io.Serializable { // hid_t H5Iregister(H5I_type_t type, const void *object); + // typedef herr_t (*H5I_free_t)(void *); // H5I_type_t H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func); // void *H5Iremove_verify(hid_t id, H5I_type_t id_type); + // Type of the function to compare objects & keys + // typedef int (*H5I_search_func_t)(void *obj, hid_t id, void *key); // void *H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key); + // Type of the H5Iiterate callback function + // typedef herr_t (*H5I_iterate_func_t)(hid_t id, void *udata); + // herr_t H5Iiterate(H5I_type_t type, H5I_iterate_func_t op, void *op_data); + + // ////////////////////////////////////////////////////////////////// // H5L: Link Interface Functions // // ////////////////////////////////////////////////////////////////// @@ -3766,8 +4126,8 @@ public class H5 implements java.io.Serializable { * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native int H5Literate(long grp_id, int idx_type, int order, long idx, H5L_iterate_cb op, - H5L_iterate_t op_data) throws HDF5LibraryException; + public synchronized static native int H5Literate(long grp_id, int idx_type, int order, long idx, H5L_iterate_t op, + H5L_iterate_opdata_t op_data) throws HDF5LibraryException; /** * H5Literate_by_name iterates through links in a group. @@ -3798,7 +4158,7 @@ public class H5 implements java.io.Serializable { * - group_name is null. **/ public synchronized static native int H5Literate_by_name(long grp_id, String group_name, int idx_type, int order, - long idx, H5L_iterate_cb op, H5L_iterate_t op_data, long lapl_id) throws HDF5LibraryException, + long idx, H5L_iterate_t op, H5L_iterate_opdata_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException; /** @@ -3845,8 +4205,8 @@ public class H5 implements java.io.Serializable { * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native int H5Lvisit(long grp_id, int idx_type, int order, H5L_iterate_cb op, - H5L_iterate_t op_data) throws HDF5LibraryException; + public synchronized static native int H5Lvisit(long grp_id, int idx_type, int order, H5L_iterate_t op, + H5L_iterate_opdata_t op_data) throws HDF5LibraryException; /** * H5Lvisit_by_name recursively visits all links starting from a specified group. @@ -3875,7 +4235,7 @@ public class H5 implements java.io.Serializable { * - group_name is null. **/ public synchronized static native int H5Lvisit_by_name(long loc_id, String group_name, int idx_type, int order, - H5L_iterate_cb op, H5L_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException; + H5L_iterate_t op, H5L_iterate_opdata_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException; /** @@ -4088,6 +4448,52 @@ public class H5 implements java.io.Serializable { public synchronized static native H5O_info_t H5Oget_info(long loc_id, int fields) throws HDF5LibraryException, NullPointerException; + /** + * H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name. + * + * @param loc_id + * IN: File or group identifier specifying location of group in which object is located + * @param name + * IN: Relative name of group + * @param lapl_id + * IN: Access property list identifier for the link pointing to the object (Not currently used; pass as + * H5P_DEFAULT.) + * + * @return object information + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ + public static H5O_info_t H5Oget_info_by_name(long loc_id, String name, long lapl_id) + throws HDF5LibraryException, NullPointerException { + return H5Oget_info_by_name(loc_id, name, HDF5Constants.H5O_INFO_ALL, lapl_id); + } + + /** + * H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name. + * + * @param loc_id + * IN: File or group identifier specifying location of group in which object is located + * @param name + * IN: Relative name of group + * @param fields + * IN: Object fields to select + * @param lapl_id + * IN: Access property list identifier for the link pointing to the object (Not currently used; pass as + * H5P_DEFAULT.) + * + * @return object information + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ + public synchronized static native H5O_info_t H5Oget_info_by_name(long loc_id, String name, int fields, long lapl_id) + throws HDF5LibraryException, NullPointerException; + /** * H5Oget_info_by_idx retrieves the metadata for an object, identifying the object by an index position. * @@ -4147,7 +4553,47 @@ public class H5 implements java.io.Serializable { int order, long n, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException; /** - * H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name. + * H5Oget_native_info retrieves the native HDF5-specific metadata for an HDF5 object specified by an identifier. + * Native HDF5-specific metadata includes things like object header information and object storage layout information. + * + * @param loc_id + * IN: Identifier for target object + * + * @return object information + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ + public static H5O_native_info_t H5Oget_native_info(long loc_id) throws HDF5LibraryException, + NullPointerException { + return H5Oget_native_info(loc_id, HDF5Constants.H5O_NATIVE_INFO_ALL); + } + + /** + * H5Oget_native_info retrieves the native HDF5-specific metadata for an HDF5 object specified by an identifier. + * Native HDF5-specific metadata includes things like object header information and object storage layout information. + * + * @param loc_id + * IN: Identifier for target object + * @param fields + * IN: Object fields to select + * + * @return object information + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ + public synchronized static native H5O_native_info_t H5Oget_native_info(long loc_id, int fields) throws HDF5LibraryException, + NullPointerException; + + /** + * H5Oget_native_info_by_name retrieves the native HDF5-specific metadata for an HDF5 object, identifying the object + * by location and relative name. Native HDF5-specific metadata includes things like object header information and + * object storage layout information. * * @param loc_id * IN: File or group identifier specifying location of group in which object is located @@ -4164,13 +4610,15 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - name is null. **/ - public static H5O_info_t H5Oget_info_by_name(long loc_id, String name, long lapl_id) + public static H5O_native_info_t H5Oget_native_info_by_name(long loc_id, String name, long lapl_id) throws HDF5LibraryException, NullPointerException { - return H5Oget_info_by_name(loc_id, name, HDF5Constants.H5O_INFO_ALL, lapl_id); + return H5Oget_native_info_by_name(loc_id, name, HDF5Constants.H5O_NATIVE_INFO_ALL, lapl_id); } /** - * H5Oget_info_by_name retrieves the metadata for an object, identifying the object by location and relative name. + * H5Oget_native_info_by_name retrieves the native HDF5-specific metadata for an HDF5 object, identifying the object + * by location and relative name. Native HDF5-specific metadata includes things like object header information and + * object storage layout information. * * @param loc_id * IN: File or group identifier specifying location of group in which object is located @@ -4189,9 +4637,71 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - name is null. **/ - public synchronized static native H5O_info_t H5Oget_info_by_name(long loc_id, String name, int fields, long lapl_id) + public synchronized static native H5O_native_info_t H5Oget_native_info_by_name(long loc_id, String name, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Oget_native_info_by_idx retrieves the native HDF5-specific metadata for an HDF5 object, identifying the object + * by an index position. Native HDF5-specific metadata includes things like object header information and + * object storage layout information. + * + * @param loc_id + * IN: File or group identifier + * @param group_name + * IN: Name of group, relative to loc_id, in which object is located + * @param idx_type + * IN: Type of index by which objects are ordered + * @param order + * IN: Order of iteration within index + * @param n + * IN: Object to open + * @param lapl_id + * IN: Access property list identifier for the link pointing to the object (Not currently used; pass as + * H5P_DEFAULT.) + * + * @return object information + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ + public static H5O_native_info_t H5Oget_native_info_by_idx(long loc_id, String group_name, int idx_type, + int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException { + return H5Oget_native_info_by_idx(loc_id, group_name, idx_type, order, n, HDF5Constants.H5O_NATIVE_INFO_ALL, lapl_id); + } + + /** + * H5Oget_native_info_by_idx retrieves the native HDF5-specific metadata for an HDF5 object, identifying the object + * by an index position. Native HDF5-specific metadata includes things like object header information and + * object storage layout information. + * + * @param loc_id + * IN: File or group identifier + * @param group_name + * IN: Name of group, relative to loc_id, in which object is located + * @param idx_type + * IN: Type of index by which objects are ordered + * @param order + * IN: Order of iteration within index + * @param n + * IN: Object to open + * @param fields + * IN: Object fields to select + * @param lapl_id + * IN: Access property list identifier for the link pointing to the object (Not currently used; pass as + * H5P_DEFAULT.) + * + * @return object information + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ + public synchronized static native H5O_native_info_t H5Oget_native_info_by_idx(long loc_id, String group_name, int idx_type, + int order, long n, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException; + /** * H5Olink creates a new hard link to an object in an HDF5 file. * @@ -4261,7 +4771,7 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - name is null. **/ - public static int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_cb op, H5O_iterate_t op_data) + public static int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_t op, H5O_iterate_opdata_t op_data) throws HDF5LibraryException, NullPointerException { return H5Ovisit(obj_id, idx_type, order, op, op_data, HDF5Constants.H5O_INFO_ALL); } @@ -4290,8 +4800,8 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - name is null. **/ - public synchronized static native int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_cb op, - H5O_iterate_t op_data, int fields) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Ovisit(long obj_id, int idx_type, int order, H5O_iterate_t op, + H5O_iterate_opdata_t op_data, int fields) throws HDF5LibraryException, NullPointerException; /** * H5Ovisit_by_name recursively visits all objects starting from a specified object. @@ -4320,7 +4830,7 @@ public class H5 implements java.io.Serializable { * - name is null. **/ public static int H5Ovisit_by_name(long loc_id, String obj_name, int idx_type, int order, - H5O_iterate_cb op, H5O_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException { + H5O_iterate_t op, H5O_iterate_opdata_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException { return H5Ovisit_by_name(loc_id, obj_name, idx_type, order, op, op_data, HDF5Constants.H5O_INFO_ALL, lapl_id); } @@ -4353,7 +4863,7 @@ public class H5 implements java.io.Serializable { * - name is null. **/ public synchronized static native int H5Ovisit_by_name(long loc_id, String obj_name, int idx_type, int order, - H5O_iterate_cb op, H5O_iterate_t op_data, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException; + H5O_iterate_t op, H5O_iterate_opdata_t op_data, int fields, long lapl_id) throws HDF5LibraryException, NullPointerException; /** @@ -4395,21 +4905,22 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Oincr_refcount(long object_id) throws HDF5LibraryException; /** - * H5Oopen_by_addr opens a group, dataset, or named datatype using its address within an HDF5 file. + * H5Oopen_by_token opens a group, dataset, or named datatype using its object token within an HDF5 file. * * @param loc_id IN: File or group identifier - * @param addr IN: Object's address in the file + * @param token IN: Object's token in the file * * @return an object identifier for the opened object * * @exception HDF5LibraryException - Error from the HDF-5 Library. **/ - public static long H5Oopen_by_addr(long loc_id, long addr) throws HDF5LibraryException { - long id = _H5Oopen_by_addr(loc_id, addr); + public static long H5Oopen_by_token(long loc_id, H5O_token_t token) throws HDF5LibraryException { + long id = _H5Oopen_by_token(loc_id, token); + return id; } - private synchronized static native long _H5Oopen_by_addr(long loc_id, long addr) + private synchronized static native long _H5Oopen_by_token(long loc_id, H5O_token_t token) throws HDF5LibraryException, NullPointerException; /** @@ -4464,10 +4975,15 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Orefresh(long object_id) throws HDF5LibraryException; + public synchronized static native void H5Odisable_mdc_flushes(long object_id); + public synchronized static native void H5Oenable_mdc_flushes(long object_id); + public synchronized static native boolean H5Oare_mdc_flushes_disabled(long object_id); + // /////// unimplemented //////// - // H5_DLL herr_t H5Odisable_mdc_flushes(hid_t object_id); - // H5_DLL herr_t H5Oenable_mdc_flushes(hid_t object_id); - // H5_DLL herr_t H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled); + // herr_t H5Otoken_cmp(hid_t loc_id, const H5O_token_t *token1, const H5O_token_t *token2, + // int *cmp_value); + // herr_t H5Otoken_to_str(hid_t loc_id, const H5O_token_t *token, char **token_str); + // herr_t H5Otoken_from_str(hid_t loc_id, const char *token_str, H5O_token_t *token); // //////////////////////////////////////////////////////////// // // @@ -4736,6 +5252,27 @@ public class H5 implements java.io.Serializable { private synchronized static native long _H5Pcopy(long plist) throws HDF5LibraryException; + // Define property list class callback function pointer types + // typedef herr_t (*H5P_cls_create_func_t)(hid_t prop_id, void *create_data); + // typedef herr_t (*H5P_cls_copy_func_t)(hid_t new_prop_id, hid_t old_prop_id, void *copy_data); + // typedef herr_t (*H5P_cls_close_func_t)(hid_t prop_id, void *close_data); + + // Define property list callback function pointer types + // typedef herr_t (*H5P_prp_cb1_t)(const char *name, size_t size, void *value); + // typedef herr_t (*H5P_prp_cb2_t)(hid_t prop_id, const char *name, size_t size, void *value); + // typedef H5P_prp_cb1_t H5P_prp_create_func_t; + // typedef H5P_prp_cb2_t H5P_prp_set_func_t; + // typedef H5P_prp_cb2_t H5P_prp_get_func_t; + // typedef herr_t (*H5P_prp_encode_func_t)(const void *value, void **buf, size_t *size); + // typedef herr_t (*H5P_prp_decode_func_t)(const void **buf, void *value); + // typedef H5P_prp_cb2_t H5P_prp_delete_func_t; + // typedef H5P_prp_cb1_t H5P_prp_copy_func_t; + // typedef int (*H5P_prp_compare_func_t)(const void *value1, const void *value2, size_t size); + // typedef H5P_prp_cb1_t H5P_prp_close_func_t; + + // Define property list iteration function type + // typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); + public static long H5Pcreate_class_nocb(long parent_class, String name) throws HDF5LibraryException { long id = _H5Pcreate_class_nocb(parent_class, name); return id; @@ -5894,6 +6431,11 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_evict_on_close(long fapl_id, boolean evict_on_close) throws HDF5LibraryException; + // ///// unimplemented ///// + // herr_t H5Pset_vol(hid_t plist_id, hid_t new_vol_id, const void *new_vol_info); + // herr_t H5Pget_vol_id(hid_t plist_id, hid_t *vol_id); + // herr_t H5Pget_vol_info(hid_t plist_id, void **vol_info); + // Dataset creation property list (DCPL) routines // /** @@ -6349,8 +6891,6 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException, NullPointerException; - // /////// Dataset creation property list (DCPL) routines /////// - /** * H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list. * @@ -6379,6 +6919,38 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5Pget_chunk_opts(long dcpl_id) throws HDF5LibraryException; + /** + * H5Pget_dset_no_attrs_hint accesses the flag for whether or not datasets created by the given dcpl + * will be created with a "minimized" object header. + * + * @param dcpl_id + * IN: Dataset creation property list + * + * @return true if the given dcpl is set to create minimized dataset object headers, false if not. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native boolean H5Pget_dset_no_attrs_hint(long dcpl_id) + throws HDF5LibraryException; + + + /** + * H5Pset_dset_no_attrs_hint sets the dcpl to minimize (or explicitly to not minimized) dataset object + * headers upon creation. + * + * @param dcpl_id + * IN: Dataset creation property list + * + * @param minimize + * the minimize hint setting + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Pset_dset_no_attrs_hint(long dcpl_id, boolean minimize) + throws HDF5LibraryException; + // /////// Dataset access property list (DAPL) routines /////// /** @@ -7071,42 +7643,14 @@ public class H5 implements java.io.Serializable { * @param ocp_plist_id * IN: Object copy property list identifier * @param copy_options - * IN: Copy option(s) to be set - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * - **/ - public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options) - throws HDF5LibraryException; - - // /////// Other/Older property list routines /////// - - /** - * H5Pget_version retrieves the version information of various objects for a file creation property list. - * - * @param plist - * IN: Identifier of the file creation property list. - * @param version_info - * OUT: version information. - * - * <pre> - * version_info[0] = boot // boot block version number - * version_info[1] = freelist // global freelist version - * version_info[2] = stab // symbol tabl version number - * version_info[3] = shhdr // shared object header version - * </pre> - * @return a non-negative value, with the values of version_info initialized, if successful + * IN: Copy option(s) to be set * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - version_info is null. - * @exception IllegalArgumentException - * - version_info is illegal. + * **/ - public synchronized static native int H5Pget_version(long plist, int[] version_info) throws HDF5LibraryException, - NullPointerException, IllegalArgumentException; + public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options) + throws HDF5LibraryException; // /////// file drivers property list routines /////// @@ -7160,6 +7704,10 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fapl_family(long fapl_id, long memb_size, long memb_fapl_id) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Pset_fapl_hdfs(long fapl_id, H5FD_hdfs_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException; + + public synchronized static native H5FD_hdfs_fapl_t H5Pget_fapl_hdfs(long fapl_id) throws HDF5LibraryException, NullPointerException; + /** * H5Pget_fapl_multi Sets up use of the multi I/O driver. * @@ -7244,6 +7792,10 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fapl_windows(long fapl_id) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Pset_fapl_ros3(long fapl_id, H5FD_ros3_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException; + + public synchronized static native H5FD_ros3_fapl_t H5Pget_fapl_ros3(long fapl_id) throws HDF5LibraryException, NullPointerException; + // /////// unimplemented //////// // Generic property list routines // @@ -7267,13 +7819,13 @@ public class H5 implements java.io.Serializable { // herr_t H5Pget_core_write_tracking(hid_t fapl_id, hbool_t *is_enabled, size_t *page_size); // #ifdef H5_HAVE_PARALLEL // herr_t H5Pset_all_coll_metadata_ops(hid_t accpl_id, hbool_t is_collective); - // H5_DLL herr_t H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective); + // herr_t H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective); // herr_t H5Pset_coll_metadata_write(hid_t fapl_id, hbool_t is_collective); // herr_t H5Pget_coll_metadata_write(hid_t fapl_id, hbool_t *is_collective); // #endif /* H5_HAVE_PARALLEL */ - // H5_DLL herr_t H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr); - // H5_DLL herr_t H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr /*out*/); - // H5_DLL herr_t H5Pset_page_buffer_size(hid_t plist_id, size_t buf_size, unsigned min_meta_per, unsigned min_raw_per); + // herr_t H5Pset_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr); + // herr_t H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config_ptr /*out*/); + // herr_t H5Pset_page_buffer_size(hid_t plist_id, size_t buf_size, unsigned min_meta_per, unsigned min_raw_per); // herr_t H5Pget_page_buffer_size(hid_t fapl_id, size_t *buf_size, unsigned *min_meta_perc, unsigned *min_raw_perc); // herr_t H5Pset_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t func, void *user_data); // herr_t H5Pget_object_flush_cb (hid_t fapl_id, H5F_flush_cb_t *func, void **user_data); @@ -7296,9 +7848,9 @@ public class H5 implements java.io.Serializable { // herr_t H5Pget_type_conv_cb(hid_t plist, H5T_conv_except_func_t *func, void **op_data) // herr_t H5Pset_type_conv_cb( hid_t plist, H5T_conv_except_func_t func, void *op_data) // #ifdef H5_HAVE_PARALLEL - // H5_DLL herr_t H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode); - // H5_DLL herr_t H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode); - // H5_DLL herr_t H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_cause, uint32_t *global_no_collective_cause); + // herr_t H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, H5D_mpio_actual_chunk_opt_mode_t *actual_chunk_opt_mode); + // herr_t H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_mode); + // herr_t H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_cause, uint32_t *global_no_collective_cause); // #endif /* H5_HAVE_PARALLEL */ // Link creation property list (LCPL) routines // @@ -7444,6 +7996,331 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5PLsize() throws HDF5LibraryException; + // //////////////////////////////////////////////////////////// + // // + // H5R: HDF5 1.12 Reference API Functions // + // // + // //////////////////////////////////////////////////////////// + + // Constructors // + + /** + * H5Rcreate_object creates a reference pointing to the object named name located at loc id. + * + * @param loc_id + * IN: Location identifier used to locate the object being pointed to. + * @param name + * IN: Name of object at location loc_id. + * @param access_id + * IN: Object access identifier to the object being pointed to. + * + * @return the reference (byte[]) if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. + **/ + public synchronized static native byte[] H5Rcreate_object(long loc_id, String name, long access_id) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + /** + * H5Rcreate_region creates the reference, pointing to the region represented by + * space id within the object named name located at loc id. + * + * @param loc_id + * IN: Location identifier used to locate the object being pointed to. + * @param name + * IN: Name of object at location loc_id. + * @param space_id + * IN: Identifies the dataset region that a dataset region reference points to. + * @param access_id + * IN: Object access identifier to the object being pointed to. + * + * @return the reference (byte[]) if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. + **/ + public synchronized static native byte[] H5Rcreate_region(long loc_id, String name, long space_id, long access_id) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + /** + * H5Rcreate_attr creates the reference, pointing to the attribute named attr name + * and attached to the object named name located at loc id. + * + * @param loc_id + * IN: Location identifier used to locate the object being pointed to. + * @param name + * IN: Name of object at location loc_id. + * @param attr_name + * IN: Name of the attribute within the object. + * @param access_id + * IN: Object access identifier to the object being pointed to. + * + * @return the reference (byte[]) if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. + **/ + public synchronized static native byte[] H5Rcreate_attr(long loc_id, String name, String attr_name, long access_id) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + /** + * H5Rdestroy destroys a reference and releases resources. + * + * @param ref_ptr + * IN: Reference to an object, region or attribute attached to an object. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. + **/ + public synchronized static native void H5Rdestroy(byte[] ref_ptr) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + // Info // + + /** + * H5Rget_type retrieves the type of a reference. + * + * @param ref_ptr + * IN: Reference to an object, region or attribute attached to an object. + * + * @return a valid reference type if successful; otherwise returns H5R UNKNOWN. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. + **/ + public synchronized static native int H5Rget_type(byte[] ref_ptr) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + /** + * H5Requal determines whether two references point to the same object, region or attribute. + * + * @param ref1_ptr + * IN: Reference to an object, region or attribute attached to an object. + * @param ref2_ptr + * IN: Reference to an object, region or attribute attached to an object. + * + * @return true if equal, else false + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. + **/ + public synchronized static native boolean H5Requal(byte[] ref1_ptr, byte[] ref2_ptr) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + /** + * H5Rcopy creates a copy of an existing reference. + * + * @param src_ref_ptr + * IN: Reference to an object, region or attribute attached to an object. + * + * @return a valid copy of the reference (byte[]) if successful. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. + **/ + public synchronized static native byte[] H5Rcopy(byte[] src_ref_ptr) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + // Dereference // + + /** + * H5Ropen_object opens that object and returns an identifier. + * The object opened with this function should be closed when it is no longer needed + * so that resource leaks will not develop. Use the appropriate close function such + * as H5Oclose or H5Dclose for datasets. + * + * @param ref_ptr + * IN: Reference to an object, region or attribute attached to an object. + * @param rapl_id + * IN: A reference access property list identifier for the reference. The access property + * list can be used to access external files that the reference points + * to (through a file access property list). + * @param oapl_id + * IN: An object access property list identifier for the reference. The access property + * property list must be of the same type as the object being referenced, + * that is a group or dataset property list. + * + * @return a valid identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. + **/ + public synchronized static native long H5Ropen_object(byte[] ref_ptr, long rapl_id, long oapl_id) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + /** + * H5Ropen region creates a copy of the dataspace of the dataset pointed to by a region reference, + * ref ptr, and defines a selection matching the selection pointed to by ref ptr within the dataspace copy. + * Use H5Sclose to release the dataspace identifier returned by this function when the identifier is no longer needed. + * + * @param ref_ptr + * IN: Reference to an object, region or attribute attached to an object. + * @param rapl_id + * IN: A reference access property list identifier for the reference. The access property + * list can be used to access external files that the reference points + * to (through a file access property list). + * @param oapl_id + * IN: An object access property list identifier for the reference. The access property + * property list must be of the same type as the object being referenced, + * that is a group or dataset property list. + * + * @return a valid dataspace identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. + **/ + public synchronized static native long H5Ropen_region(byte[] ref_ptr, long rapl_id, long oapl_id) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + /** + * H5Ropen_attr opens the attribute attached to the object and returns an identifier. + * The attribute opened with this function should be closed with H5Aclose when it is no longer needed + * so that resource leaks will not develop. + * + * @param ref_ptr + * IN: Reference to an object, region or attribute attached to an object. + * @param rapl_id + * IN: A reference access property list identifier for the reference. The access property + * list can be used to access external files that the reference points + * to (through a file access property list). + * @param aapl_id + * IN: An attribute access property list identifier for the reference. The access property + * property list must be of the same type as the object being referenced, + * that is a group or dataset property list. + * + * @return a valid attribute identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - an input array is null. + * @exception IllegalArgumentException + * - an input array is invalid. + **/ + public synchronized static native long H5Ropen_attr(byte[] ref_ptr, long rapl_id, long aapl_id) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + // Get type // + + /** + * H5Rget obj type3 retrieves the type of the referenced object pointed to. + * + * @param ref_ptr + * IN: Reference to an object, region or attribute attached to an object. + * @param rapl_id + * IN: A reference access property list identifier for the reference. The access property + * list can be used to access external files that the reference points + * to (through a file access property list). + * + * @return Returns the object type + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - array is null. + * @exception IllegalArgumentException + * - array is invalid. + **/ + public synchronized static native int H5Rget_obj_type3(byte[] ref_ptr, long rapl_id) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + // Get name // + + /** + * H5Rget_file_name retrieves the file name for the object, region or attribute reference pointed to. + * + * @param ref_ptr + * IN: Reference to an object, region or attribute attached to an object. + * + * @return Returns the file name of the reference + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - array is null. + * @exception IllegalArgumentException + * - array is invalid. + **/ + public synchronized static native String H5Rget_file_name(byte[] ref_ptr) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + /** + * H5Rget_obj_name retrieves the object name for the object, region or attribute reference pointed to. + * + * @param ref_ptr + * IN: Reference to an object, region or attribute attached to an object. + * @param rapl_id + * IN: A reference access property list identifier for the reference. The access property + * list can be used to access external files that the reference points + * to (through a file access property list). + * + * @return Returns the object name of the reference + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - array is null. + * @exception IllegalArgumentException + * - array is invalid. + **/ + public synchronized static native String H5Rget_obj_name(byte[] ref_ptr, long rapl_id) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + /** + * H5Rget_attr_name retrieves the attribute name for the object, region or attribute reference pointed to. + * + * @param ref_ptr + * IN: Reference to an object, region or attribute attached to an object. + * + * @return Returns the attribute name of the reference + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - array is null. + * @exception IllegalArgumentException + * - array is invalid. + **/ + public synchronized static native String H5Rget_attr_name(byte[] ref_ptr) + throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + // //////////////////////////////////////////////////////////// // // // H5R: HDF5 1.8 Reference API Functions // @@ -8213,16 +9090,17 @@ public class H5 implements java.io.Serializable { // /////// unimplemented //////// // #ifdef NEW_HYPERSLAB_API - // H5_DLL hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, + // hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, // const hsize_t start[], // const hsize_t _stride[], // const hsize_t count[], // const hsize_t _block[]); - // H5_DLL herr_t H5Sselect_select(hid_t space1_id, H5S_seloper_t op, + // herr_t H5Sselect_select(hid_t space1_id, H5S_seloper_t op, // hid_t space2_id); - // H5_DLL hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op, + // hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op, // hid_t space2_id); // #endif /* NEW_HYPERSLAB_API */ + // herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id); @@ -9585,6 +10463,26 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5Tpack(long type_id) throws HDF5LibraryException; + /** + * H5Treclaim reclaims buffer used for VL data. + * + * @param type_id + * Identifier of the datatype. + * @param space_id + * Identifier of the dataspace. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer with data to be reclaimed. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native void H5Treclaim(long type_id, long space_id, long xfer_plist_id, byte[] buf) + throws HDF5LibraryException, NullPointerException; + /** * H5Tvlen_create creates a new variable-length (VL) dataype. * @@ -9641,6 +10539,28 @@ public class H5 implements java.io.Serializable { // H5T_conv_t func) // throws HDF5LibraryException, NullPointerException; + // //////////////////////////////////////////////////////////// + // // + // H5VL: VOL Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + /// VOL Connector Functionality + public synchronized static native long H5VLregister_connector_by_name(String connector_name, long vipl_id); + public synchronized static native long H5VLregister_connector_by_value(int connector_value, long vipl_id); + public synchronized static native boolean H5VLis_connector_registered_by_name(String name); + public synchronized static native boolean H5VLis_connector_registered_by_value(int connector_value); + public synchronized static native long H5VLget_connector_id(long object_id); + public synchronized static native long H5VLget_connector_id_by_name(String name); + public synchronized static native long H5VLget_connector_id_by_value(int connector_value); + public synchronized static native String H5VLget_connector_name(long object_id); + public synchronized static native void H5VLclose(long connector_id); + public synchronized static native void H5VLunregister_connector(long connector_id); + + // /////// unimplemented //////// + // hid_t H5VLregister_connector(const H5VL_class_t *cls, hid_t vipl_id); + + // //////////////////////////////////////////////////////////// // // // H5Z: Filter Interface Functions // @@ -9653,9 +10573,9 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Zunregister(int filter) throws HDF5LibraryException, NullPointerException; -} + // /////// unimplemented //////// -// /////// unimplemented //////// + // herr_t H5Zregister(const void *cls); -// herr_t H5Zregister(const void *cls); +} diff --git a/source/java/hdf/hdf5lib/HDF5Constants.java b/source/java/hdf/hdf5lib/HDF5Constants.java index 7eddac095dcb9c0b00b6fcf98b5aab69bd7f96cc..b3901836e2886e33bdab478866f032c0f3d67692 100644 --- a/source/java/hdf/hdf5lib/HDF5Constants.java +++ b/source/java/hdf/hdf5lib/HDF5Constants.java @@ -14,6 +14,8 @@ package hdf.hdf5lib; +import hdf.hdf5lib.structs.H5O_token_t; + /** * /** This class contains C constants and enumerated types of HDF5 library. The * values of these constants are obtained from the library by calling J2C(int @@ -121,6 +123,7 @@ public class HDF5Constants { public static final long H5E_CANTDEC = H5E_CANTDEC(); public static final long H5E_CANTDECODE = H5E_CANTDECODE(); public static final long H5E_CANTDELETE = H5E_CANTDELETE(); + public static final long H5E_CANTDELETEFILE = H5E_CANTDELETEFILE(); public static final long H5E_CANTENCODE = H5E_CANTENCODE(); public static final long H5E_CANTFLUSH = H5E_CANTFLUSH(); public static final long H5E_CANTFREE = H5E_CANTFREE(); @@ -190,10 +193,16 @@ public class HDF5Constants { public static final long H5E_UNSUPPORTED = H5E_UNSUPPORTED(); public static final long H5E_VERSION = H5E_VERSION(); public static final long H5E_VFL = H5E_VFL(); + public static final long H5E_VOL = H5E_VOL(); public static final long H5E_WALK_DOWNWARD = H5E_WALK_DOWNWARD(); public static final long H5E_WALK_UPWARD = H5E_WALK_UPWARD(); public static final long H5E_WRITEERROR = H5E_WRITEERROR(); + private static final int H5ES_STATUS_IN_PROGRESS = H5ES_STATUS_IN_PROGRESS(); + private static final int H5ES_STATUS_SUCCEED = H5ES_STATUS_SUCCEED(); + private static final int H5ES_STATUS_FAIL = H5ES_STATUS_FAIL(); + private static final int H5ES_STATUS_CANCELED = H5ES_STATUS_CANCELED(); + public static final int H5F_ACC_CREAT = H5F_ACC_CREAT(); public static final int H5F_ACC_EXCL = H5F_ACC_EXCL(); public static final int H5F_ACC_RDONLY = H5F_ACC_RDONLY(); @@ -210,6 +219,7 @@ public class HDF5Constants { public static final int H5F_LIBVER_EARLIEST = H5F_LIBVER_EARLIEST(); public static final int H5F_LIBVER_V18 = H5F_LIBVER_V18(); public static final int H5F_LIBVER_V110 = H5F_LIBVER_V110(); + public static final int H5F_LIBVER_V112 = H5F_LIBVER_V112(); public static final int H5F_LIBVER_NBOUNDS = H5F_LIBVER_NBOUNDS(); public static final int H5F_LIBVER_LATEST = H5F_LIBVER_LATEST(); public static final int H5F_OBJ_ALL = H5F_OBJ_ALL(); @@ -238,6 +248,8 @@ public class HDF5Constants { public static final long H5FD_SEC2 = H5FD_SEC2(); public static final long H5FD_STDIO = H5FD_STDIO(); public static final long H5FD_WINDOWS = H5FD_WINDOWS(); + public static final long H5FD_ROS3 = H5FD_ROS3(); + public static final long H5FD_HDFS = H5FD_HDFS(); public static final int H5FD_LOG_LOC_READ = H5FD_LOG_LOC_READ(); public static final int H5FD_LOG_LOC_WRITE = H5FD_LOG_LOC_WRITE(); public static final int H5FD_LOG_LOC_SEEK = H5FD_LOG_LOC_SEEK(); @@ -314,9 +326,9 @@ public class HDF5Constants { public static final int H5I_GROUP = H5I_GROUP(); public static final int H5I_INVALID_HID = H5I_INVALID_HID(); public static final int H5I_NTYPES = H5I_NTYPES(); - public static final int H5I_REFERENCE = H5I_REFERENCE(); public static final int H5I_UNINIT = H5I_UNINIT(); public static final int H5I_VFL = H5I_VFL(); + public static final int H5I_VOL = H5I_VOL(); public static final int H5L_TYPE_ERROR = H5L_TYPE_ERROR(); public static final int H5L_TYPE_HARD = H5L_TYPE_HARD(); @@ -333,9 +345,10 @@ public class HDF5Constants { public static final int H5O_INFO_BASIC = H5O_INFO_BASIC(); public static final int H5O_INFO_TIME = H5O_INFO_TIME(); public static final int H5O_INFO_NUM_ATTRS = H5O_INFO_NUM_ATTRS(); - public static final int H5O_INFO_HDR = H5O_INFO_HDR(); - public static final int H5O_INFO_META_SIZE = H5O_INFO_META_SIZE(); public static final int H5O_INFO_ALL = H5O_INFO_ALL(); + public static final int H5O_NATIVE_INFO_HDR = H5O_NATIVE_INFO_HDR(); + public static final int H5O_NATIVE_INFO_META_SIZE = H5O_NATIVE_INFO_META_SIZE(); + public static final int H5O_NATIVE_INFO_ALL = H5O_NATIVE_INFO_ALL(); public static final int H5O_SHMESG_NONE_FLAG = H5O_SHMESG_NONE_FLAG(); public static final int H5O_SHMESG_SDSPACE_FLAG = H5O_SHMESG_SDSPACE_FLAG(); public static final int H5O_SHMESG_DTYPE_FLAG = H5O_SHMESG_DTYPE_FLAG(); @@ -348,6 +361,8 @@ public class HDF5Constants { public static final int H5O_TYPE_DATASET = H5O_TYPE_DATASET(); public static final int H5O_TYPE_NAMED_DATATYPE = H5O_TYPE_NAMED_DATATYPE(); public static final int H5O_TYPE_NTYPES = H5O_TYPE_NTYPES(); + public static final int H5O_MAX_TOKEN_SIZE = H5O_MAX_TOKEN_SIZE(); + public static final H5O_token_t H5O_TOKEN_UNDEF = H5O_TOKEN_UNDEF(); public static final long H5P_ROOT = H5P_ROOT(); public static final long H5P_OBJECT_CREATE = H5P_OBJECT_CREATE(); @@ -367,6 +382,7 @@ public class HDF5Constants { public static final long H5P_OBJECT_COPY = H5P_OBJECT_COPY(); public static final long H5P_LINK_CREATE = H5P_LINK_CREATE(); public static final long H5P_LINK_ACCESS = H5P_LINK_ACCESS(); + public static final long H5P_VOL_INITIALIZE = H5P_VOL_INITIALIZE(); public static final long H5P_FILE_CREATE_DEFAULT = H5P_FILE_CREATE_DEFAULT(); public static final long H5P_FILE_ACCESS_DEFAULT = H5P_FILE_ACCESS_DEFAULT(); public static final long H5P_DATASET_CREATE_DEFAULT = H5P_DATASET_CREATE_DEFAULT(); @@ -382,20 +398,31 @@ public class HDF5Constants { public static final long H5P_OBJECT_COPY_DEFAULT = H5P_OBJECT_COPY_DEFAULT(); public static final long H5P_LINK_CREATE_DEFAULT = H5P_LINK_CREATE_DEFAULT(); public static final long H5P_LINK_ACCESS_DEFAULT = H5P_LINK_ACCESS_DEFAULT(); + public static final long H5P_VOL_INITIALIZE_DEFAULT = H5P_VOL_INITIALIZE_DEFAULT(); public static final int H5P_CRT_ORDER_TRACKED = H5P_CRT_ORDER_TRACKED(); public static final int H5P_CRT_ORDER_INDEXED = H5P_CRT_ORDER_INDEXED(); public static final long H5P_DEFAULT = H5P_DEFAULT(); public static final int H5PL_TYPE_ERROR = H5PL_TYPE_ERROR(); public static final int H5PL_TYPE_FILTER = H5PL_TYPE_FILTER(); + public static final int H5PL_TYPE_VOL = H5PL_TYPE_VOL(); + public static final int H5PL_TYPE_NONE = H5PL_TYPE_NONE(); public static final int H5PL_FILTER_PLUGIN = H5PL_FILTER_PLUGIN(); + public static final int H5PL_VOL_PLUGIN = H5PL_VOL_PLUGIN(); public static final int H5PL_ALL_PLUGIN = H5PL_ALL_PLUGIN(); + public static final int H5R_ATTR = H5R_ATTR(); public static final int H5R_BADTYPE = H5R_BADTYPE(); public static final int H5R_DATASET_REGION = H5R_DATASET_REGION(); + public static final int H5R_DATASET_REGION1 = H5R_DATASET_REGION1(); + public static final int H5R_DATASET_REGION2 = H5R_DATASET_REGION2(); public static final int H5R_MAXTYPE = H5R_MAXTYPE(); + public static final int H5R_REF_BUF_SIZE = H5R_REF_BUF_SIZE(); public static final int H5R_OBJ_REF_BUF_SIZE = H5R_OBJ_REF_BUF_SIZE(); public static final int H5R_OBJECT = H5R_OBJECT(); + public static final int H5R_OBJECT1 = H5R_OBJECT1(); + public static final int H5R_OBJECT2 = H5R_OBJECT2(); + public static final int H5S_ALL = H5S_ALL(); public static final int H5S_MAX_RANK = H5S_MAX_RANK(); public static final int H5S_NO_CLASS = H5S_NO_CLASS(); @@ -590,6 +617,7 @@ public class HDF5Constants { public static final long H5T_STD_I8LE = H5T_STD_I8LE(); public static final long H5T_STD_REF_DSETREG = H5T_STD_REF_DSETREG(); public static final long H5T_STD_REF_OBJ = H5T_STD_REF_OBJ(); + public static final long H5T_STD_REF = H5T_STD_REF(); public static final long H5T_STD_U16BE = H5T_STD_U16BE(); public static final long H5T_STD_U16LE = H5T_STD_U16LE(); public static final long H5T_STD_U32BE = H5T_STD_U32BE(); @@ -624,6 +652,18 @@ public class HDF5Constants { public static final long H5T_VARIABLE = H5T_VARIABLE(); public static final int H5T_VLEN = H5T_VLEN(); public static final int H5T_VL_T = H5T_VL_T(); + + public static final int H5VL_CAP_FLAG_NONE = H5VL_CAP_FLAG_NONE(); + public static final int H5VL_CAP_FLAG_THREADSAFE = H5VL_CAP_FLAG_THREADSAFE(); + public static final long H5VL_NATIVE = H5VL_NATIVE(); + public static final String H5VL_NATIVE_NAME = H5VL_NATIVE_NAME(); + public static final int H5VL_NATIVE_VALUE = H5VL_NATIVE_VALUE(); + public static final int H5VL_NATIVE_VERSION = H5VL_NATIVE_VERSION(); + public static final int H5_VOL_INVALID = H5_VOL_INVALID(); + public static final int H5_VOL_NATIVE = H5_VOL_NATIVE(); + public static final int H5_VOL_RESERVED = H5_VOL_RESERVED(); + public static final int H5_VOL_MAX = H5_VOL_MAX(); + public static final int H5Z_CB_CONT = H5Z_CB_CONT(); public static final int H5Z_CB_ERROR = H5Z_CB_ERROR(); public static final int H5Z_CB_FAIL = H5Z_CB_FAIL(); @@ -839,6 +879,8 @@ public class HDF5Constants { private static native final long H5E_CANTDELETE(); + private static native final long H5E_CANTDELETEFILE(); + private static native final long H5E_CANTENCODE(); private static native final long H5E_CANTFLUSH(); @@ -980,12 +1022,22 @@ public class HDF5Constants { private static native final long H5E_VFL(); + private static native final long H5E_VOL(); + private static native final long H5E_WALK_DOWNWARD(); private static native final long H5E_WALK_UPWARD(); private static native final long H5E_WRITEERROR(); + private static native final int H5ES_STATUS_IN_PROGRESS(); + + private static native final int H5ES_STATUS_SUCCEED(); + + private static native final int H5ES_STATUS_FAIL(); + + private static native final int H5ES_STATUS_CANCELED(); + private static native final int H5F_ACC_CREAT(); private static native final int H5F_ACC_EXCL(); @@ -1018,6 +1070,8 @@ public class HDF5Constants { private static native final int H5F_LIBVER_V110(); + private static native final int H5F_LIBVER_V112(); + private static native final int H5F_LIBVER_NBOUNDS(); private static native final int H5F_LIBVER_LATEST(); @@ -1072,6 +1126,10 @@ public class HDF5Constants { private static native final long H5FD_WINDOWS(); + private static native final long H5FD_ROS3(); + + private static native final long H5FD_HDFS(); + private static native final int H5FD_LOG_LOC_READ(); private static native final int H5FD_LOG_LOC_WRITE(); @@ -1218,12 +1276,12 @@ public class HDF5Constants { private static native final int H5I_NTYPES(); - private static native final int H5I_REFERENCE(); - private static native final int H5I_UNINIT(); private static native final int H5I_VFL(); + private static native final int H5I_VOL(); + private static native final int H5L_TYPE_ERROR(); private static native final int H5L_TYPE_HARD(); @@ -1252,11 +1310,13 @@ public class HDF5Constants { private static native final int H5O_INFO_NUM_ATTRS(); - private static native final int H5O_INFO_HDR(); + private static native final int H5O_INFO_ALL(); - private static native final int H5O_INFO_META_SIZE(); + private static native final int H5O_NATIVE_INFO_HDR(); - private static native final int H5O_INFO_ALL(); + private static native final int H5O_NATIVE_INFO_META_SIZE(); + + private static native final int H5O_NATIVE_INFO_ALL(); private static native final int H5O_SHMESG_NONE_FLAG(); @@ -1282,6 +1342,10 @@ public class HDF5Constants { private static native final int H5O_TYPE_NTYPES(); + private static native final int H5O_MAX_TOKEN_SIZE(); + + private static native final H5O_token_t H5O_TOKEN_UNDEF(); + private static native final long H5P_ROOT(); private static native final long H5P_OBJECT_CREATE(); @@ -1318,6 +1382,8 @@ public class HDF5Constants { private static native final long H5P_LINK_ACCESS(); + private static native final long H5P_VOL_INITIALIZE(); + private static native final long H5P_FILE_CREATE_DEFAULT(); private static native final long H5P_FILE_ACCESS_DEFAULT(); @@ -1348,6 +1414,8 @@ public class HDF5Constants { private static native final long H5P_LINK_ACCESS_DEFAULT(); + private static native final long H5P_VOL_INITIALIZE_DEFAULT(); + private static native final int H5P_CRT_ORDER_TRACKED(); private static native final int H5P_CRT_ORDER_INDEXED(); @@ -1358,20 +1426,38 @@ public class HDF5Constants { private static native final int H5PL_TYPE_FILTER(); + private static native final int H5PL_TYPE_VOL(); + + private static native final int H5PL_TYPE_NONE(); + private static native final int H5PL_FILTER_PLUGIN(); private static native final int H5PL_ALL_PLUGIN(); + private static native final int H5PL_VOL_PLUGIN(); + + private static native final int H5R_ATTR(); + private static native final int H5R_BADTYPE(); private static native final int H5R_DATASET_REGION(); + private static native final int H5R_DATASET_REGION1(); + + private static native final int H5R_DATASET_REGION2(); + private static native final int H5R_MAXTYPE(); + private static native final int H5R_REF_BUF_SIZE(); + private static native final int H5R_OBJ_REF_BUF_SIZE(); private static native final int H5R_OBJECT(); + private static native final int H5R_OBJECT1(); + + private static native final int H5R_OBJECT2(); + private static native final int H5S_ALL(); private static native final int H5S_MAX_RANK(); @@ -1760,6 +1846,8 @@ public class HDF5Constants { private static native final long H5T_STD_REF_OBJ(); + private static native final long H5T_STD_REF(); + private static native final long H5T_STD_U16BE(); private static native final long H5T_STD_U16LE(); @@ -1828,6 +1916,26 @@ public class HDF5Constants { private static native final int H5T_VL_T(); + private static native final int H5VL_CAP_FLAG_NONE(); + + private static native final int H5VL_CAP_FLAG_THREADSAFE(); + + private static native final long H5VL_NATIVE(); + + private static native final String H5VL_NATIVE_NAME(); + + private static native final int H5VL_NATIVE_VALUE(); + + private static native final int H5VL_NATIVE_VERSION(); + + private static native final int H5_VOL_INVALID(); + + private static native final int H5_VOL_NATIVE(); + + private static native final int H5_VOL_RESERVED(); + + private static native final int H5_VOL_MAX(); + private static native final int H5Z_CB_CONT(); private static native final int H5Z_CB_ERROR(); diff --git a/source/java/hdf/hdf5lib/callbacks/H5L_iterate_cb.java b/source/java/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java similarity index 80% rename from source/java/hdf/hdf5lib/callbacks/H5L_iterate_cb.java rename to source/java/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java index ec71911d8d580c858a1f316d61d03b0491e6f412..ad9ad8c719ceef2e178b3010b7ed788800921c05 100644 --- a/source/java/hdf/hdf5lib/callbacks/H5L_iterate_cb.java +++ b/source/java/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java @@ -13,9 +13,6 @@ package hdf.hdf5lib.callbacks; -import hdf.hdf5lib.structs.H5L_info_t; +public interface H5L_iterate_opdata_t { -//Information class for link callback(for H5Lvisit/H5Lvisit_by_name) -public interface H5L_iterate_cb extends Callbacks { - int callback(long group, String name, H5L_info_t info, H5L_iterate_t op_data); } diff --git a/source/java/hdf/hdf5lib/callbacks/H5L_iterate_t.java b/source/java/hdf/hdf5lib/callbacks/H5L_iterate_t.java index 28ffb8aa6bf4e69df5ccf33adb57f35d3ab9d335..f92fbc4f4401e1188db87b49f485ece149ead563 100644 --- a/source/java/hdf/hdf5lib/callbacks/H5L_iterate_t.java +++ b/source/java/hdf/hdf5lib/callbacks/H5L_iterate_t.java @@ -13,8 +13,9 @@ package hdf.hdf5lib.callbacks; -public interface H5L_iterate_t { -/** public ArrayList iterdata = new ArrayList(); - * Any derived interfaces must define the single public variable as above. - */ +import hdf.hdf5lib.structs.H5L_info_t; + +// Information class for link callback (for H5Lvisit/H5Lvisit_by_name). +public interface H5L_iterate_t extends Callbacks { + int callback(long group, String name, H5L_info_t info, H5L_iterate_opdata_t op_data); } diff --git a/source/java/hdf/hdf5lib/callbacks/H5O_iterate_cb.java b/source/java/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java similarity index 80% rename from source/java/hdf/hdf5lib/callbacks/H5O_iterate_cb.java rename to source/java/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java index 89cf2062c87d9b9908bc150c7e5e25c37b02e7c4..e1c47b57ba3b4d56c648bd493b38a9d4b295d16d 100644 --- a/source/java/hdf/hdf5lib/callbacks/H5O_iterate_cb.java +++ b/source/java/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java @@ -13,9 +13,6 @@ package hdf.hdf5lib.callbacks; -import hdf.hdf5lib.structs.H5O_info_t; +public interface H5O_iterate_opdata_t { -//Information class for link callback(for H5Ovisit/H5Ovisit_by_name) -public interface H5O_iterate_cb extends Callbacks { - int callback(long group, String name, H5O_info_t info, H5O_iterate_t op_data); } diff --git a/source/java/hdf/hdf5lib/callbacks/H5O_iterate_t.java b/source/java/hdf/hdf5lib/callbacks/H5O_iterate_t.java index 1491b09b854a338e405e2873a6fc6fd3d44c63a5..9a55106b103ab0fe99f2a13a5dbeb81b09a34925 100644 --- a/source/java/hdf/hdf5lib/callbacks/H5O_iterate_t.java +++ b/source/java/hdf/hdf5lib/callbacks/H5O_iterate_t.java @@ -13,8 +13,9 @@ package hdf.hdf5lib.callbacks; -public interface H5O_iterate_t { -/** public ArrayList iterdata = new ArrayList(); - * Any derived interfaces must define the single public variable as above. - */ +import hdf.hdf5lib.structs.H5O_info_t; + +// Information class for link callback(for H5Ovisit/H5Ovisit_by_name) +public interface H5O_iterate_t extends Callbacks { + int callback(long group, String name, H5O_info_t info, H5O_iterate_opdata_t op_data); } diff --git a/source/java/hdf/hdf5lib/exceptions/HDF5LibraryException.java b/source/java/hdf/hdf5lib/exceptions/HDF5LibraryException.java index 7756c2f3e72169e0456ed52b5ca14b6d5b46ef5c..f3a41d1d91c3e1430528377a807933f33a7b9531 100644 --- a/source/java/hdf/hdf5lib/exceptions/HDF5LibraryException.java +++ b/source/java/hdf/hdf5lib/exceptions/HDF5LibraryException.java @@ -40,7 +40,6 @@ public class HDF5LibraryException extends HDF5Exception { private final String hdf5ErrorStackLastElementString; private final long majorErrorNumber; - private final long minorErrorNumber; /** @@ -256,6 +255,9 @@ public class HDF5LibraryException extends HDF5Exception { else if (err_code == HDF5Constants.H5E_MOUNT) { return "file mount error"; } + else if (err_code == HDF5Constants.H5E_CANTDELETEFILE) { + return "Unable to delete file"; + } else if (err_code == HDF5Constants.H5E_SEEKERROR) { return "seek failed"; } @@ -347,7 +349,7 @@ public class HDF5LibraryException extends HDF5Exception { return "unrecognized message"; } else if (err_code == HDF5Constants.H5E_CANTDELETE) { - return " Can't delete message"; + return "Can't delete message"; } else if (err_code == HDF5Constants.H5E_CANTOPENOBJ) { return "Can't open object"; diff --git a/source/java/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java b/source/java/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java new file mode 100644 index 0000000000000000000000000000000000000000..9fcff2e80a0d81171c7ab8e6e720e4a649b45124 --- /dev/null +++ b/source/java/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java @@ -0,0 +1,102 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Read-Only HDFS Virtual File Driver (VFD) * + * Copyright (c) 2018, The HDF Group. * + * * + * All rights reserved. * + * * + * NOTICE: * + * All information contained herein is, and remains, the property of The HDF * + * Group. The intellectual and technical concepts contained herein are * + * proprietary to The HDF Group. Dissemination of this information or * + * reproduction of this material is strictly forbidden unless prior written * + * permission is obtained from The HDF Group. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +package hdf.hdf5lib.structs; + +import java.io.Serializable; + +/* + * Java representation of the HDFS VFD file access property list (fapl) + * structure. + * + * Used for the access of files hosted on the Hadoop Distributed File System. + */ + +public class H5FD_hdfs_fapl_t implements Serializable { + private static final long serialVersionUID = 2072473407027648309L; + + private int version; + private String namenode_name; + private int namenode_port; + private String user_name; + private String kerberos_ticket_cache; + private int stream_buffer_size; + + /* + * Create a fapl_t structure with the specified components. + */ + public H5FD_hdfs_fapl_t( + String namenode_name, + int namenode_port, + String user_name, + String kerberos_ticket_cache, + int stream_buffer_size) + { + this.version = 1; + this.namenode_name = namenode_name; + this.namenode_port = namenode_port; + this.user_name = user_name; + this.kerberos_ticket_cache = kerberos_ticket_cache; + this.stream_buffer_size = stream_buffer_size; + } + + @Override + public boolean equals(Object o) { + if (o == null) + return false; + if (!(o instanceof H5FD_hdfs_fapl_t)) + return false; + + H5FD_hdfs_fapl_t other = (H5FD_hdfs_fapl_t)o; + if (this.version != other.version) + return false; + if (!this.namenode_name.equals(other.namenode_name)) + return false; + if (this.namenode_port != other.namenode_port) + return false; + if (!this.user_name.equals(other.user_name)) + return false; + if (!this.kerberos_ticket_cache.equals(other.kerberos_ticket_cache)) + return false; + if (this.stream_buffer_size != other.stream_buffer_size) + return false; + return true; + } + + @Override + public int hashCode() { + /* this is a _very bad_ hash algorithm for purposes of hashing! */ + /* implemented to satisfy the "contract" regarding equality */ + int k = (int)this.version; + k += this.namenode_name.length(); + k += this.user_name.length(); + k += this.kerberos_ticket_cache.length(); + k += namenode_port; + k += stream_buffer_size; + return k; + } + + @Override + public String toString() { + return "H5FD_hdfs_fapl_t (Version: " + this.version + ") {" + + "\n namenode_name: '" + this.namenode_name + + "'\n namenode_port: " + this.namenode_port + + "\n user_name: '" + this.user_name + + "'\n kerberos_ticket_cache: '" + this.kerberos_ticket_cache + + "'\n stream_buffer_size: " + this.stream_buffer_size + + "\n}\n"; + } +} + + diff --git a/source/java/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java b/source/java/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java new file mode 100644 index 0000000000000000000000000000000000000000..a899e10704a4519c949cf37b4e90adb68c701266 --- /dev/null +++ b/source/java/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java @@ -0,0 +1,123 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Read-Only S3 Virtual File Driver (VFD) * + * Copyright (c) 2017-2018, The HDF Group. * + * * + * All rights reserved. * + * * + * NOTICE: * + * All information contained herein is, and remains, the property of The HDF * + * Group. The intellectual and technical concepts contained herein are * + * proprietary to The HDF Group. Dissemination of this information or * + * reproduction of this material is strictly forbidden unless prior written * + * permission is obtained from The HDF Group. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +package hdf.hdf5lib.structs; + +import java.io.Serializable; + +/* + * Java representation of the ROS3 VFD file access property list (fapl) + * structure. + * + * Used for the access of files hosted remotely on S3 by Amazon. + * + * For simplicity, implemented assuming that all ROS3 fapls have components: + * - version + * - authenticate + * - aws_region + * - secret_id + * - secret_key + * + * Future implementations may be created to enable different fapl "shapes" + * depending on provided version. + * + * proposed: + * + * H5FD_ros3_fapl_t (super class, has only version field) + * H5FD_ros3_fapl_v1_t (extends super with Version 1 components) + * H5FD_ros3_fapl_v2_t (extends super with Version 2 components) + * and so on, for each version + * + * "super" is passed around, and is version-checked and re-cast as + * appropriate + */ + +public class H5FD_ros3_fapl_t implements Serializable { + private static final long serialVersionUID = 8985533001471224030L; + + private int version; + private boolean authenticate; + private String aws_region; + private String secret_id; + private String secret_key; + + /** + * Create a "default" fapl_t structure, for anonymous access. + */ + public H5FD_ros3_fapl_t () { + /* H5FD_ros3_fapl_t("", "", ""); */ /* defer */ + this.version = 1; + this.aws_region = ""; + this.secret_id = ""; + this.secret_key = ""; + } + + /** + * Create a fapl_t structure with the specified components. + * If all are the empty string, is anonymous (non-authenticating). + * Region and ID must both be supplied for authentication. + * + * @param region "aws region" for authenticating request + * @param id "secret id" or "access id" for authenticating request + * @param key "secret key" or "access key" for authenticating request + */ + public H5FD_ros3_fapl_t (String region, String id, String key) { + this.version = 1; /* must equal H5FD_CURR_ROS3_FAPL_T_VERSION */ + /* as found in H5FDros3.h */ + this.aws_region = region; + this.secret_id = id; + this.secret_key = key; + } + + @Override + public boolean equals(Object o) { + if (o == null) + return false; + if (!(o instanceof H5FD_ros3_fapl_t)) + return false; + + H5FD_ros3_fapl_t other = (H5FD_ros3_fapl_t)o; + if (this.version != other.version) + return false; + if (!this.aws_region.equals(other.aws_region)) + return false; + if (!this.secret_key.equals(other.secret_key)) + return false; + if (!this.secret_id.equals(other.secret_id)) + return false; + return true; + } + + @Override + public int hashCode() { + /* this is a _very bad_ hash algorithm for purposes of hashing! */ + /* implemented to satisfy the "contract" regarding equality */ + int k = (int)this.version; + k += this.aws_region.length(); + k += this.secret_id.length(); + k += this.secret_key.length(); + return k; + } + + @Override + public String toString() { + return "H5FD_ros3_fapl_t (Version:" + this.version + ") {" + + "\n aws_region : " + this.aws_region + + "\n secret_id : " + this.secret_id + + "\n secret_key : " + this.secret_key + + "\n}\n"; + } +} + + diff --git a/source/java/hdf/hdf5lib/structs/H5L_info_t.java b/source/java/hdf/hdf5lib/structs/H5L_info_t.java index 3bbb189b6b407234df7a4acf959490769d3b9bf0..377e6175c0b1054cb793942134a128d8c386b867 100644 --- a/source/java/hdf/hdf5lib/structs/H5L_info_t.java +++ b/source/java/hdf/hdf5lib/structs/H5L_info_t.java @@ -15,22 +15,39 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for link (for H5Lget_info/H5Lget_info_by_idx) -public class H5L_info_t implements Serializable{ +import hdf.hdf5lib.HDF5Constants; + +// Information struct for link (for H5Lget_info/H5Lget_info_by_idx) +public class H5L_info_t implements Serializable { private static final long serialVersionUID = -4754320605310155033L; - public int type; - public boolean corder_valid; - public long corder; - public int cset; - public long address_val_size; + public int type; + public boolean corder_valid; + public long corder; + public int cset; + public H5O_token_t token; + public long val_size; + + // Constructor for using object token portion of C union + H5L_info_t (int type, boolean corder_valid, long corder, + int cset, H5O_token_t token) + { + this.type = type; + this.corder_valid = corder_valid; + this.corder = corder; + this.cset = cset; + this.token = token; + this.val_size = -1; + } + // Constructor for using val_size portion of C union H5L_info_t (int type, boolean corder_valid, long corder, - int cset, long address_val_size) + int cset, long val_size) { this.type = type; this.corder_valid = corder_valid; this.corder = corder; this.cset = cset; - this.address_val_size = address_val_size; + this.token = HDF5Constants.H5O_TOKEN_UNDEF; + this.val_size = val_size; } } diff --git a/source/java/hdf/hdf5lib/structs/H5O_hdr_info_t.java b/source/java/hdf/hdf5lib/structs/H5O_hdr_info_t.java index a39c1edbb497cac9ae6c6d8b8abfde336f071dda..8d0cc2472e668bc8f15824e9e340b764d7052853 100644 --- a/source/java/hdf/hdf5lib/structs/H5O_hdr_info_t.java +++ b/source/java/hdf/hdf5lib/structs/H5O_hdr_info_t.java @@ -16,7 +16,7 @@ package hdf.hdf5lib.structs; import java.io.Serializable; // Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) -public class H5O_hdr_info_t implements Serializable{ +public class H5O_hdr_info_t implements Serializable { private static final long serialVersionUID = 7883826382952577189L; public int version; /* Version number of header format in file */ public int nmesgs; /* Number of object header messages */ @@ -44,4 +44,38 @@ public class H5O_hdr_info_t implements Serializable{ this.mesg_present = mesg_present; this.mesg_shared = mesg_shared; } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (!(o instanceof H5O_hdr_info_t)) + return false; + + H5O_hdr_info_t info = (H5O_hdr_info_t) o; + + if (this.version != info.version) + return false; + if (this.nmesgs != info.nmesgs) + return false; + if (this.nchunks != info.nchunks) + return false; + if (this.flags != info.flags) + return false; + if (this.space_total != info.space_total) + return false; + if (this.space_meta != info.space_meta) + return false; + if (this.space_mesg != info.space_mesg) + return false; + if (this.space_free != info.space_free) + return false; + if (this.mesg_present != info.mesg_present) + return false; + if (this.mesg_shared != info.mesg_shared) + return false; + + return true; + } } diff --git a/source/java/hdf/hdf5lib/structs/H5O_info_t.java b/source/java/hdf/hdf5lib/structs/H5O_info_t.java index ac32f6adfba4b0fd9f40bf4e23ca38659f80e393..6a26a102c8f0b79d28fe6071c1e8294f1e9aa26c 100644 --- a/source/java/hdf/hdf5lib/structs/H5O_info_t.java +++ b/source/java/hdf/hdf5lib/structs/H5O_info_t.java @@ -15,38 +15,30 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) -public class H5O_info_t implements Serializable{ +// Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) +public class H5O_info_t implements Serializable { private static final long serialVersionUID = 4691681163544054518L; - public long fileno; /* File number that object is located in */ - public long addr; /* Object address in file */ - public int type; /* Basic object type (group, dataset, etc.) */ - public int rc; /* Reference count of object */ - public long atime; /* Access time */ - public long mtime; /* Modification time */ - public long ctime; /* Change time */ - public long btime; /* Birth time */ - public long num_attrs; /* # of attributes attached to object */ - public H5O_hdr_info_t hdr; /* Object header information */ - /* Extra metadata storage for obj & attributes */ - public H5_ih_info_t meta_size_obj; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */ - public H5_ih_info_t meta_size_attr; /* v2 B-tree & heap for attributes */ + public long fileno; /* File number that object is located in */ + public H5O_token_t token; /* Object token in file */ + public int type; /* Basic object type (group, dataset, etc.) */ + public int rc; /* Reference count of object */ + public long atime; /* Access time */ + public long mtime; /* Modification time */ + public long ctime; /* Change time */ + public long btime; /* Birth time */ + public long num_attrs; /* # of attributes attached to object */ - public H5O_info_t (long fileno, long addr, int type, - int rc, long num_attrs, long atime, long mtime, long ctime, long btime, - H5O_hdr_info_t hdr, H5_ih_info_t meta_size_obj, H5_ih_info_t meta_size_attr) + public H5O_info_t (long fileno, H5O_token_t token, int type, + int rc, long atime, long mtime, long ctime, long btime, long num_attrs) { this.fileno = fileno; - this.addr = addr; + this.token = token; this.type = type; this.rc = rc; - this.num_attrs = num_attrs; this.atime = atime; this.mtime = mtime; this.ctime = ctime; this.btime = btime; - this.hdr = hdr; - this.meta_size_obj = meta_size_obj; - this.meta_size_attr = meta_size_attr; + this.num_attrs = num_attrs; } } diff --git a/source/java/hdf/hdf5lib/structs/H5O_native_info_t.java b/source/java/hdf/hdf5lib/structs/H5O_native_info_t.java new file mode 100644 index 0000000000000000000000000000000000000000..4e808494119e7237b0718b8c415f8f396f8fd0bf --- /dev/null +++ b/source/java/hdf/hdf5lib/structs/H5O_native_info_t.java @@ -0,0 +1,52 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +package hdf.hdf5lib.structs; + +import java.io.Serializable; + +// Information struct for native HDF5 object info, such as object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx). +public class H5O_native_info_t implements Serializable { + private static final long serialVersionUID = 7883826382952577189L; + + public H5O_hdr_info_t hdr_info; /* Object header information */ + + /* Extra metadata storage for obj & attributes */ + public H5_ih_info_t obj_info; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */ + public H5_ih_info_t attr_info; /* v2 B-tree & heap for attributes */ + + H5O_native_info_t (H5O_hdr_info_t oheader_info, H5_ih_info_t obj_info, H5_ih_info_t attr_info) + { + this.hdr_info = oheader_info; + this.obj_info = obj_info; + this.attr_info = attr_info; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (!(o instanceof H5O_native_info_t)) + return false; + + H5O_native_info_t info = (H5O_native_info_t) o; + + if (!this.hdr_info.equals(info.hdr_info) + || !this.obj_info.equals(info.obj_info) + || !this.attr_info.equals(info.attr_info)) + return false; + + return true; + } +} \ No newline at end of file diff --git a/source/java/hdf/hdf5lib/structs/H5O_token_t.java b/source/java/hdf/hdf5lib/structs/H5O_token_t.java new file mode 100644 index 0000000000000000000000000000000000000000..8ec0b7f8d033b454f6d33bac1f7363715e514d00 --- /dev/null +++ b/source/java/hdf/hdf5lib/structs/H5O_token_t.java @@ -0,0 +1,45 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +package hdf.hdf5lib.structs; + +import java.io.Serializable; +import java.util.Arrays; + +import hdf.hdf5lib.HDF5Constants; + +// Object token, which is a unique and permanent identifier, for an HDF5 object within a container. +public class H5O_token_t implements Serializable { + private static final long serialVersionUID = -4754320605310155032L; + public byte[] data; + + H5O_token_t (byte[] data) { + this.data = data; + } + + public boolean isUndefined() { + return this.equals(HDF5Constants.H5O_TOKEN_UNDEF); + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (!(o instanceof H5O_token_t)) + return false; + + H5O_token_t token = (H5O_token_t) o; + + return Arrays.equals(this.data, token.data); + } +} \ No newline at end of file diff --git a/source/java/hdf/hdf5lib/structs/H5_ih_info_t.java b/source/java/hdf/hdf5lib/structs/H5_ih_info_t.java index ea36d85e5479a17c7d54090a661e0109b89ce324..7159f0223e35d3aba44f26417c70058d60178a33 100644 --- a/source/java/hdf/hdf5lib/structs/H5_ih_info_t.java +++ b/source/java/hdf/hdf5lib/structs/H5_ih_info_t.java @@ -26,4 +26,22 @@ public class H5_ih_info_t implements Serializable { this.index_size = index_size; this.heap_size = heap_size; } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (!(o instanceof H5_ih_info_t)) + return false; + + H5_ih_info_t info = (H5_ih_info_t) o; + + if (this.index_size != info.index_size) + return false; + if (this.heap_size != info.heap_size) + return false; + + return true; + } } diff --git a/source/java/hdf/overview.html b/source/java/hdf/overview.html index 9c19442a11d7b604452b3f7d7f45f0347b661756..f181510ff75d8b5609b0ab5fb5f4183eb87ba0c0 100644 --- a/source/java/hdf/overview.html +++ b/source/java/hdf/overview.html @@ -6,18 +6,19 @@ The <b>Java HD5 Interface (JHI5)</b> is a Java package (<a href="../../hdf-java-html/javadocs/hdf/hdf5lib/package-summary.html">hdf.hdf5lib</a>) that ``wraps around'' the HDF5 library. -<p />There are a large number of functions in the HDF5 -library (version 1.10). Some of the functions are not supported in JHI5. Most +<p>There are a large number of functions in the HDF5 +library (version 1.12). Some of the functions are not supported in JHI5. Most of the unsupported functions have C function pointers, which is not currently -implemented in JHI5. +implemented in JHI5.</p> -<center><table BORDER=1 COLS=1 WIDTH="71%" BGCOLOR="#dbeaf5" > +<table style="width:71%;text-align:center;background-color:#dbeaf5" border="1"> +<caption>Java HDF5 Interface (JHI5)</caption> <tr> -<td> -<center>Note: The JHI5 does not support HDF4 or earlier.</center> +<td style="text-align:center;"> +Note: The JHI5 does not support HDF4 or earlier. </td> </tr> -</table></center> +</table> <p>The JHI5 may be used by any Java application that needs to access HDF5 files. It is extremely important to emphasize that <i>this package is not @@ -89,8 +90,7 @@ like this: The <i><b>H5</b> </i>class automatically loads the native method implementations and the HDF5 library. -<h3> -<a NAME="DOWNLOAD"></a>To Obtain</h3> -The JHI5 is included with the <a href="http://www.hdfgroup.org/HDF5/index.html">HDF5</a> library. +<h3>To Obtain</h3> +The JHI5 is included with the <a href="https://portal.hdfgroup.org/display/support/Downloads">HDF5</a> library. </body>