From bfae4648751129b1a8ce827f415b20b7c3943b1a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 3 Nov 2020 16:56:16 -0600 Subject: HDFFV-10868 merge java changes from develop --- java/src/hdf/hdf5lib/H5.java | 4543 +++++++++++++++----- java/src/hdf/hdf5lib/HDF5Constants.java | 489 ++- java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java | 25 +- java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java | 4 + java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java | 22 +- java/src/hdf/hdf5lib/callbacks/H5D_append_t.java | 4 + java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java | 24 +- java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java | 4 + java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java | 22 +- java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java | 4 + java/src/hdf/hdf5lib/callbacks/H5L_iterate_cb.java | 25 +- java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java | 8 +- java/src/hdf/hdf5lib/callbacks/H5O_iterate_cb.java | 25 +- java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java | 8 +- .../hdf5lib/callbacks/H5P_cls_close_func_cb.java | 21 +- .../hdf5lib/callbacks/H5P_cls_close_func_t.java | 4 + .../hdf5lib/callbacks/H5P_cls_copy_func_cb.java | 22 +- .../hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java | 4 + .../hdf5lib/callbacks/H5P_cls_create_func_cb.java | 21 +- .../hdf5lib/callbacks/H5P_cls_create_func_t.java | 4 + java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java | 22 +- java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java | 4 + .../hdf5lib/callbacks/H5P_prp_close_func_cb.java | 22 +- .../hdf5lib/callbacks/H5P_prp_compare_func_cb.java | 22 +- .../hdf5lib/callbacks/H5P_prp_copy_func_cb.java | 22 +- .../hdf5lib/callbacks/H5P_prp_create_func_cb.java | 22 +- .../hdf5lib/callbacks/H5P_prp_delete_func_cb.java | 23 +- .../hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java | 23 +- .../hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java | 23 +- java/src/hdf/hdf5lib/exceptions/HDF5Exception.java | 3 + .../hdf5lib/exceptions/HDF5ReferenceException.java | 6 + .../hdf/hdf5lib/structs/H5AC_cache_config_t.java | 5 +- java/src/hdf/hdf5lib/structs/H5A_info_t.java | 5 +- java/src/hdf/hdf5lib/structs/H5E_error2_t.java | 5 +- java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java | 2 +- java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java | 2 +- java/src/hdf/hdf5lib/structs/H5F_info2_t.java | 5 +- java/src/hdf/hdf5lib/structs/H5G_info_t.java | 5 +- java/src/hdf/hdf5lib/structs/H5L_info_t.java | 5 +- java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java | 25 +- java/src/hdf/hdf5lib/structs/H5O_info_t.java | 5 +- java/src/hdf/hdf5lib/structs/H5_ih_info_t.java | 9 +- java/src/jni/h5Constants.c | 374 +- java/src/jni/h5sImp.c | 383 ++ java/src/jni/h5sImp.h | 59 + java/test/TestH5Sbasic.java | 138 + java/test/testfiles/JUnit-TestH5Sbasic.txt | 16 +- 47 files changed, 5436 insertions(+), 1082 deletions(-) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 1242947..58c1e14 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -239,10 +239,14 @@ public class H5 implements java.io.Serializable { */ public final static int LIB_VERSION[] = { 1, 10, 8 }; + /** + * add system property to load library by path + */ 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() + /** + * 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; @@ -255,6 +259,9 @@ public class H5 implements java.io.Serializable { loadH5Lib(); } + /** + * load native library + */ public static void loadH5Lib() { // Make sure that the library is loaded only once if (isLibraryLoaded) @@ -466,6 +473,35 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5get_libversion(int[] libversion) throws HDF5LibraryException; + /** + * H5set_free_list_limits + * Sets limits on the different kinds of free lists. Setting a value + * of -1 for a limit means no limit of that type. These limits are global + * for the entire library. Each "global" limit only applies to free lists + * of that type, so if an application sets a limit of 1 MB on each of the + * global lists, up to 3 MB of total storage might be allocated (1MB on + * each of regular, array and block type lists). + * + * The settings for block free lists are duplicated to factory free lists. + * Factory free list limits cannot be set independently currently. + * + * @param reg_global_lim + * The limit on all "regular" free list memory used + * @param reg_list_lim + * The limit on memory used in each "regular" free list + * @param arr_global_lim + * The limit on all "array" free list memory used + * @param arr_list_lim + * The limit on memory used in each "array" free list + * @param blk_global_lim + * The limit on all "block" free list memory used + * @param blk_list_lim + * The limit on memory used in each "block" free list + * @return a non-negative value if successful, along with the version information. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + */ public synchronized static native int H5set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim) throws HDF5LibraryException; @@ -1014,7 +1050,7 @@ public class H5 implements java.io.Serializable { /** * 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 buf from the file. + * mem_type_id. The entire attribute is read into buffer from the file. * * @param attr_id * IN: Identifier of an attribute to read. @@ -1035,11 +1071,47 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Aread(long attr_id, long mem_type_id, byte[] obj, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * 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 buffer from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ 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); } + /** + * 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 buffer from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param obj + * Buffer to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ 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); @@ -1139,211 +1211,1491 @@ public class H5 implements java.io.Serializable { return status; } + /** + * 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 buffer of double from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of double to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Aread_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * 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 buffer of double from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of double to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ 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); } + /** + * 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 buffer of float from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of float to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ public synchronized static native int H5Aread_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; + /** + * 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 buffer of float from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of float to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ 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) - throws HDF5LibraryException, NullPointerException; - /** - * H5Arename changes the name of attribute that is attached to the object specified by loc_id. The attribute named - * old_attr_name is renamed new_attr_name. + * 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 buffer of int from the file. * - * @param loc_id - * IN: Location or object identifier; may be dataset or group - * @param old_attr_name - * IN: Prior attribute name - * @param new_attr_name - * IN: New attribute name + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of int to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * - * @return A non-negative value if successful; otherwise returns a negative value. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - Name is null. + * - data buffer is null. **/ - public synchronized static native int H5Arename(long loc_id, String old_attr_name, String new_attr_name) + public synchronized static native int H5Aread_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; /** - * H5Arename_by_name changes the name of attribute that is attached to the object specified by loc_id and obj_name. - * The attribute named old_attr_name is renamed new_attr_name. + * 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 buffer of int from the file. * - * @param loc_id - * IN: Location or object identifier; may be dataset or group - * @param obj_name - * IN: Name of object, relative to location, whose attribute is to be renamed - * @param old_attr_name - * IN: Prior attribute name - * @param new_attr_name - * IN: New attribute name - * @param lapl_id - * IN: Link access property list + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of int to store data read from the file. * - * @return A non-negative value if successful; otherwise returns a negative value. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - Name is null. + * - data buffer is null. **/ - public synchronized static native int H5Arename_by_name(long loc_id, String obj_name, String old_attr_name, - String new_attr_name, long lapl_id) 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); + } /** - * 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 buf to the file. + * 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 buffer of long from the file. * * @param attr_id - * IN: Identifier of an attribute to write. + * IN: Identifier of an attribute to read. * @param mem_type_id * IN: Identifier of the attribute datatype (in memory). * @param buf - * IN: Buffer with data to be written to the file. + * Buffer of long to store data read from the file. * @param isCriticalPinning - * IN: request lock on data reference. + * request lock on data reference. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - data is null. + * - data buffer is null. **/ - public synchronized static native int H5Awrite(long attr_id, long mem_type_id, byte[] buf, boolean isCriticalPinning) + 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 H5Awrite(long attr_id, long mem_type_id, byte[] buf) + /** + * 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 buffer of long from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of long to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + public synchronized static int H5Aread_long(long attr_id, long mem_type_id, long[] 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); + return H5Aread_long(attr_id, mem_type_id, buf, 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. + * 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 buffer of String from the file. * * @param attr_id - * IN: Identifier of an attribute to write. + * IN: Identifier of an attribute to read. * @param mem_type_id * IN: Identifier of the attribute datatype (in memory). - * @param obj - * IN: Data object to be written. - * @param isCriticalPinning - * request lock on data reference. + * @param buf + * Buffer of String to store data read from the file. * * @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 + * - data buffer is null. **/ - public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj, boolean isCriticalPinning) + public synchronized static native int H5Aread_reg_ref(long attr_id, long mem_type_id, String[] buf) + throws HDF5LibraryException, NullPointerException; + + /** + * 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 buffer of short from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of short to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + public synchronized static native int H5Aread_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * 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 buffer of shortfrom the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of short to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + 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); + } + + /** + * 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 buffer of variable-lenght from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of variable-lenght to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + public synchronized static native int H5AreadVL(long attr_id, long mem_type_id, Object[] buf) + throws HDF5LibraryException, NullPointerException; + + /** + * 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 buffer of String from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of String to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + public synchronized static native int H5Aread_string(long attr_id, long mem_type_id, String[] buf) + throws HDF5LibraryException, NullPointerException; + + /** + * 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 buffer of variable-lenght strings from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of variable-lenght strings to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + public synchronized static native int H5Aread_VLStrings(long attr_id, long mem_type_id, Object[] buf) + throws HDF5LibraryException, NullPointerException; + + /** + * 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 buffer of string from the file. + * + * @param attr_id + * IN: Identifier of an attribute to read. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * Buffer of string to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + public synchronized static native int H5AreadComplex(long attr_id, long mem_type_id, String[] buf) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Arename changes the name of attribute that is attached to the object specified by loc_id. The attribute named + * old_attr_name is renamed new_attr_name. + * + * @param loc_id + * IN: Location or object identifier; may be dataset or group + * @param old_attr_name + * IN: Prior attribute name + * @param new_attr_name + * IN: New attribute name + * + * @return A non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - Name is null. + **/ + public synchronized static native int H5Arename(long loc_id, String old_attr_name, String new_attr_name) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Arename_by_name changes the name of attribute that is attached to the object specified by loc_id and obj_name. + * The attribute named old_attr_name is renamed new_attr_name. + * + * @param loc_id + * IN: Location or object identifier; may be dataset or group + * @param obj_name + * IN: Name of object, relative to location, whose attribute is to be renamed + * @param old_attr_name + * IN: Prior attribute name + * @param new_attr_name + * IN: New attribute name + * @param lapl_id + * IN: Link access property list + * + * @return A non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - Name is null. + **/ + public synchronized static native int H5Arename_by_name(long loc_id, String obj_name, String old_attr_name, + String new_attr_name, long lapl_id) throws HDF5LibraryException, NullPointerException; + + /** + * 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 buf to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * 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 + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite(long attr_id, long mem_type_id, byte[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * 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 buf to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: 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 + * - data is null. + **/ + 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); + } + + /** + * 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 buf to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param obj + * IN: 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 + * - data is null. + **/ + 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. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * 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 + **/ + public synchronized static int H5Awrite(long attr_id, long mem_type_id, Object obj, boolean isCriticalPinning) + throws HDF5Exception, HDF5LibraryException, NullPointerException + { + int status = -1; + boolean is1D = false; + + 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)) { + log.trace("H5Dwrite_string type"); + 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; + } + + /** + * 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 buffer of double to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of double with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite_double(long attr_id, long mem_type_id, double[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * 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 buffer of double to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of double 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 + * - data is null. + **/ + 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); + } + + /** + * 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 buffer of float to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of float with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite_float(long attr_id, long mem_type_id, float[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * 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 buffer of float to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of float 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 + * - data is null. + **/ + 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); + } + + /** + * 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 buffer of int to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of int with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite_int(long attr_id, long mem_type_id, int[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * 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 buffer of int to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of int 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 + * - data is null. + **/ + 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); + } + + /** + * 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 buffer of long to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of long with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite_long(long attr_id, long mem_type_id, long[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * 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 buffer of long to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of long 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 + * - data is null. + **/ + 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); + } + + /** + * 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 buffer of short to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of short with data to be written to the file. + * @param isCriticalPinning + * IN: request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data is null. + **/ + public synchronized static native int H5Awrite_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; + + /** + * 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 buffer of short to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of short 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 + * - data is null. + **/ + 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); + } + + /** + * 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 buffer of string to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of string 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 + * - data is null. + **/ + public synchronized static native int H5Awrite_string(long attr_id, long mem_type_id, String[] buf) + throws HDF5LibraryException, NullPointerException; + + /** + * 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 buffer of variable-lenght to the file. + * + * @param attr_id + * IN: Identifier of an attribute to write. + * @param mem_type_id + * IN: Identifier of the attribute datatype (in memory). + * @param buf + * IN: Buffer of variable-lenght 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 + * - data is null. + **/ + 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 buffer of variable-lenght strings 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 of variable-lenght strings 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; + + /** + * H5Aget_create_plist retrieves a copy of the attribute creation property list identifier. + * + * @param attr_id + * IN: Identifier of an attribute. + * + * @return identifier for the attribute's creation property list if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Aget_create_plist(long attr_id) + throws HDF5LibraryException + { + long id = _H5Aget_create_plist(attr_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Aget_create_plist add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Aget_create_plist(long attr_id) throws HDF5LibraryException; + + /** + * H5Aiterate2 iterates over the attributes attached to a dataset, named datatype, or group, as + * specified by obj_id. For each attribute, user-provided data, op_data, with additional information + * as defined below, is passed to a user-defined function, op, which operates on that attribute. + * + * @param loc_id + * IN: Identifier for object to which attributes are attached; may be group, dataset, or named datatype. + * @param idx_type + * IN: The type of index specified by idx_type can be one of the following: + * H5_INDEX_NAME An alpha-numeric index by attribute name. + * H5_INDEX_CRT_ORDER An index by creation order. + * @param order + * IN: The order in which the index is to be traversed, as specified by order, can be one of the following: + * H5_ITER_INC Iteration is from beginning to end, i.e., a top-down iteration + * incrementing the index position at each step. + * H5_ITER_DEC Iteration starts at the end of the index, i.e., a bottom-up iteration + * decrementing the index position at each step. + * H5_ITER_NATIVE HDF5 iterates in the fastest-available order. No information is provided + * as to the order, but HDF5 ensures that each element in the index will be + * visited if the iteration completes successfully. + * @param idx + * IN/OUT: Initial and returned offset within index. + * @param op + * IN: Callback function to operate on each value. + * @param op_data + * IN/OUT: Pointer to any user-efined data for use by operator function. + * + * @return returns the return value of the first operator that returns a positive value, or zero if all members were + * processed with no operator returning non-zero. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native int H5Aiterate(long loc_id, int idx_type, int order, long idx, + H5A_iterate_cb op, H5A_iterate_t op_data) throws HDF5LibraryException, NullPointerException; + + /** + * H5Aiterate_by_name iterates over the attributes attached to the dataset or group specified with loc_id + * and obj_name. For each attribute, user-provided data, op_data, with additional information as defined + * below, is passed to a user-defined function, op, which operates on that attribute. + * + * @param loc_id + * IN: Identifier for object to which attributes are attached; may be group, dataset, or named datatype. + * @param obj_name + * IN: Name of object, relative to location. + * @param idx_type + * IN: The type of index specified by idx_type can be one of the following: + * H5_INDEX_NAME An alpha-numeric index by attribute name. + * H5_INDEX_CRT_ORDER An index by creation order. + * @param order + * IN: The order in which the index is to be traversed, as specified by order, can be one of the following: + * H5_ITER_INC Iteration is from beginning to end, i.e., a top-down iteration + * incrementing the index position at each step. + * H5_ITER_DEC Iteration starts at the end of the index, i.e., a bottom-up iteration + * decrementing the index position at each step. + * H5_ITER_NATIVE HDF5 iterates in the fastest-available order. No information is provided + * as to the order, but HDF5 ensures that each element in the index will be + * visited if the iteration completes successfully. + * @param idx + * IN/OUT: Initial and returned offset within index. + * @param op + * IN: Callback function to operate on each value. + * @param op_data + * IN/OUT: Pointer to any user-efined data for use by operator function. + * @param lapl_id + * IN: Link access property list + * + * @return returns the return value of the first operator that returns a positive value, or zero if all members were + * processed with no operator returning non-zero. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native int H5Aiterate_by_name(long loc_id, String obj_name, int idx_type, + int order, long idx, H5A_iterate_cb op, H5A_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException; + + // //////////////////////////////////////////////////////////// + // // + // H5AC: Cache Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // No public Functions + + // //////////////////////////////////////////////////////////// + // // + // H5B: B-link-tree Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // No public Functions + + // //////////////////////////////////////////////////////////// + // // + // H5B2: v2 B-tree Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // No public Functions + + // //////////////////////////////////////////////////////////// + // // + // H5C: Cache Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + // No public Functions + + // //////////////////////////////////////////////////////////// + // // + // H5D: Datasets Interface Functions // + // // + // //////////////////////////////////////////////////////////// + + /** + * H5Dcopy copies the content of one dataset to another dataset. + * + * @param src_did + * the identifier of the source dataset + * @param dst_did + * the identifier of the destinaiton dataset + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + */ + public synchronized static native int H5Dcopy(long src_did, long dst_did) throws HDF5LibraryException; + + /** + * H5Dclose ends access to a dataset specified by dataset_id and releases resources used by it. + * + * @param dataset_id + * Identifier of the dataset to finish access to. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static int H5Dclose(long dataset_id) throws HDF5LibraryException { + if (dataset_id < 0) + return 0; // throw new HDF5LibraryException("Negative ID"); + + log.trace("OPEN_IDS: H5Dclose remove {}", dataset_id); + OPEN_IDS.remove(dataset_id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + return _H5Dclose(dataset_id); + } + + private synchronized static native int _H5Dclose(long dataset_id) throws HDF5LibraryException; + + /** + * H5Dcreate creates a new dataset named name at the location specified by loc_id. + * + * @param loc_id + * IN: Location identifier + * @param name + * IN: Dataset name + * @param type_id + * IN: Datatype identifier + * @param space_id + * IN: Dataspace identifier + * @param lcpl_id + * IN: Identifier of link creation property list. + * @param dcpl_id + * IN: Identifier of dataset creation property list. + * @param dapl_id + * IN: Identifier of dataset access property list. + * + * @return a dataset identifier + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ + public static long H5Dcreate(long loc_id, String name, long type_id, long space_id, long lcpl_id, long dcpl_id, + long dapl_id) throws HDF5LibraryException, NullPointerException { + long id = _H5Dcreate2(loc_id, name, type_id, space_id, lcpl_id, dcpl_id, dapl_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Dcreate add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + /** + * H5Dcreate2 creates a new dataset named name at the location specified by loc_id. + * + * @see public static int H5Dcreate(int loc_id, String name, int type_id, int space_id, int lcpl_id, int dcpl_id, + * int dapl_id) + **/ + private synchronized static native long _H5Dcreate2(long loc_id, String name, long type_id, long space_id, + long lcpl_id, long dcpl_id, long dapl_id) throws HDF5LibraryException, NullPointerException; + + /** + * H5Dcreate_anon creates a dataset in the file specified by loc_id. + * + * @param loc_id + * IN: Location identifier + * @param type_id + * IN: Datatype identifier + * @param space_id + * IN: Dataspace identifier + * @param dcpl_id + * IN: Identifier of dataset creation property list. + * @param dapl_id + * IN: Identifier of dataset access property list. + * + * @return a dataset identifier + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Dcreate_anon(long loc_id, long type_id, long space_id, long dcpl_id, long dapl_id) + throws HDF5LibraryException { + long id = _H5Dcreate_anon(loc_id, type_id, space_id, dcpl_id, dapl_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Dcreate_anon add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Dcreate_anon(long loc_id, long type_id, long space_id, long dcpl_id, + long dapl_id) throws HDF5LibraryException; + + /** + * H5Dfill explicitly fills the dataspace selection in memory, space_id, with the fill value specified in fill. + * + * @param fill + * IN: Pointer to the fill value to be used. + * @param fill_type + * IN: Fill value datatype identifier. + * @param buf + * IN/OUT: Pointer to the memory buffer containing the selection to be filled. + * @param buf_type + * IN: Datatype of dataspace elements to be filled. + * @param space_id + * IN: Dataspace describing memory buffer and containing the selection to be filled. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native void H5Dfill(byte[] fill, long fill_type, byte[] buf, long buf_type, long space_id) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Dget_access_plist returns an identifier for a copy of the dataset access property list for a dataset. + * + * @param dset_id + * IN: Identifier of the dataset to query. + * + * @return a dataset access property list identifier + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Dget_access_plist(long dset_id) throws HDF5LibraryException; + + /** + * H5Dget_create_plist returns an identifier for a copy of the dataset creation property list for a dataset. + * + * @param dataset_id + * Identifier of the dataset to query. + * @return a dataset creation property list identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Dget_create_plist(long dataset_id) throws HDF5LibraryException { + long id = _H5Dget_create_plist(dataset_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Dget_create_plist add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Dget_create_plist(long dataset_id) throws HDF5LibraryException; + + /** + * H5Dget_offset returns the address in the file of the dataset dset_id. + * + * @param dset_id + * IN: Identifier of the dataset in question + * + * @return the offset in bytes. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Dget_offset(long dset_id) throws HDF5LibraryException; + + /** + * H5Dget_space returns an identifier for a copy of the dataspace for a dataset. + * + * @param dataset_id + * Identifier of the dataset to query. + * + * @return a dataspace identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Dget_space(long dataset_id) throws HDF5LibraryException { + long id = _H5Dget_space(dataset_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Dget_space add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Dget_space(long dataset_id) throws HDF5LibraryException; + + /** + * H5Dget_space_status determines whether space has been allocated for the dataset dset_id. + * + * @param dset_id + * IN: Identifier of the dataset to query. + * + * @return the space allocation status + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Dget_space_status(long dset_id) throws HDF5LibraryException; + + /** + * H5Dget_storage_size returns the amount of storage that is required for the dataset. + * + * @param dataset_id + * Identifier of the dataset in question + * + * @return he amount of storage space allocated for the dataset. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Dget_storage_size(long dataset_id) throws HDF5LibraryException, + IllegalArgumentException; + + /** + * H5Dget_type returns an identifier for a copy of the datatype for a dataset. + * + * @param dataset_id + * Identifier of the dataset to query. + * + * @return a datatype identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Dget_type(long dataset_id) throws HDF5LibraryException { + long id = _H5Dget_type(dataset_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Dget_type add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Dget_type(long dataset_id) throws HDF5LibraryException; + + /** + * H5Diterate iterates over all the data elements in the memory buffer buf, executing the callback function operator + * once for each such data element. + * + * @param buf + * IN/OUT: Pointer to the memory containing the elements to iterate over. + * @param buf_type + * IN: Buffer datatype identifier. + * @param space_id + * IN: Dataspace describing memory buffer. + * @param op + * IN: Callback function to operate on each value. + * @param op_data + * IN/OUT: Pointer to any user-efined data for use by operator function. + * + * @return returns the return value of the first operator that returns a positive value, or zero if all members were + * processed with no operator returning non-zero. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native int H5Diterate(byte[] buf, long buf_type, long space_id, H5D_iterate_cb op, + H5D_iterate_t op_data) throws HDF5LibraryException, NullPointerException; + + /** + * H5Dopen opens the existing dataset specified by a location identifier and name, loc_id and name, respectively. + * + * @param loc_id + * IN: Location identifier + * @param name + * IN: Dataset name + * @param dapl_id + * IN: Identifier of dataset access property list. + * + * @return a dataset identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ + public static long H5Dopen(long loc_id, String name, long dapl_id) throws HDF5LibraryException, NullPointerException + { + long id = _H5Dopen2(loc_id, name, dapl_id); + if (id > 0) { + log.trace("OPEN_IDS: H5Dopen add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + /** + * H5Dopen2 opens the existing dataset specified by a location identifier and name, loc_id and name, respectively. + * + * @see public static int H5Dopen(int loc_id, String name, int dapl_id) + **/ + private synchronized static native long _H5Dopen2(long loc_id, String name, long dapl_id) + throws HDF5LibraryException, NullPointerException; + + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer buf. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param obj + * Buffer to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + public synchronized static native int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, byte[] obj, boolean isCriticalPinning) throws HDF5LibraryException, + NullPointerException; + + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer buf. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + 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 + { + return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); + } + + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer buf. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param obj + * Buffer to store data read from the file. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. + **/ + 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 + { + return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, obj, true); + } + + /** + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * data object. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param obj + * Object to store data read from the file. + * @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. + **/ + 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 + { int status = -1; boolean is1D = false; Class dataClass = obj.getClass(); if (!dataClass.isArray()) { - throw (new HDF5JavaException("H5Dwrite: data is not an array")); + throw (new HDF5JavaException("H5Dread: data is not an array")); } String cname = dataClass.getName(); is1D = (cname.lastIndexOf('[') == cname.indexOf('[')); char dname = cname.charAt(cname.lastIndexOf("[") + 1); + log.trace("H5Dread: cname={} is1D={} dname={}", cname, is1D, dname); if (is1D && (dname == 'B')) { - status = H5Awrite(attr_id, mem_type_id, (byte[]) obj, isCriticalPinning); + log.trace("H5Dread_dname_B"); + status = H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (byte[]) obj, + isCriticalPinning); } else if (is1D && (dname == 'S')) { - status = H5Awrite_short(attr_id, mem_type_id, (short[]) obj, isCriticalPinning); + log.trace("H5Dread_dname_S"); + status = H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (short[]) obj, + isCriticalPinning); } else if (is1D && (dname == 'I')) { - status = H5Awrite_int(attr_id, mem_type_id, (int[]) obj, isCriticalPinning); + log.trace("H5Dread_dname_I"); + status = H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (int[]) obj, + isCriticalPinning); } else if (is1D && (dname == 'J')) { - status = H5Awrite_long(attr_id, mem_type_id, (long[]) obj, isCriticalPinning); + log.trace("H5Dread_dname_J"); + 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 = H5Awrite_float(attr_id, mem_type_id, (float[]) obj, isCriticalPinning); + log.trace("H5Dread_dname_F"); + status = H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (float[]) obj, + isCriticalPinning); } else if (is1D && (dname == 'D')) { - status = H5Awrite_double(attr_id, mem_type_id, (double[]) obj, isCriticalPinning); + log.trace("H5Dread_dname_D"); + 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)) { + log.trace("H5Dread_reg_ref"); + status = H5Dread_reg_ref(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, + (String[]) obj); } else if (is1D && (dataClass.getComponentType() == String.class)) { - log.trace("H5Dwrite_string type"); - status = H5Awrite_string(attr_id, mem_type_id, (String[]) obj); + log.trace("H5Dread_string type"); + status = H5Dread_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, + (String[]) obj); } else { + // Create a data buffer to hold the data into a Java Array HDFArray theArray = new HDFArray(obj); - byte[] buf = theArray.byteify(); + byte[] buf = theArray.emptyBytes(); + log.trace("H5Dread_else"); - status = H5Awrite(attr_id, mem_type_id, buf); + // will raise exception if read fails + status = H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, + isCriticalPinning); + if (status >= 0) { + // convert the data into a Java Array + obj = theArray.arrayify(buf); + } + + // clean up these: assign 'null' as hint to gc() buf = null; theArray = null; } @@ -1351,548 +2703,537 @@ public class H5 implements java.io.Serializable { 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 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 + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of type double. * - * @param attr_id - * Identifier of the attribute read from. + * @param dataset_id + * Identifier of the dataset read from. * @param mem_type_id * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. * @param buf - * Buffer with data to be written to the file. + * Buffer of type double to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - name is null. + * - data buffer is null. **/ - - public synchronized static native int H5Awrite_VLStrings(long attr_id, long mem_type_id, Object[] buf) - throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; /** - * H5Aget_create_plist retrieves a copy of the attribute creation property list identifier. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of type double. * - * @param attr_id - * IN: Identifier of an attribute. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of double to store data read from the file. * - * @return identifier for the attribute's creation property list if successful + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public static long H5Aget_create_plist(long attr_id) - throws HDF5LibraryException + 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 id = _H5Aget_create_plist(attr_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Aget_create_plist add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; + return H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } - private synchronized static native long _H5Aget_create_plist(long attr_id) throws HDF5LibraryException; - - /** - * H5Aiterate2 iterates over the attributes attached to a dataset, named datatype, or group, as - * specified by obj_id. For each attribute, user-provided data, op_data, with additional information - * as defined below, is passed to a user-defined function, op, which operates on that attribute. - * - * @param loc_id - * IN: Identifier for object to which attributes are attached; may be group, dataset, or named datatype. - * @param idx_type - * IN: The type of index specified by idx_type can be one of the following: - * H5_INDEX_NAME An alpha-numeric index by attribute name. - * H5_INDEX_CRT_ORDER An index by creation order. - * @param order - * IN: The order in which the index is to be traversed, as specified by order, can be one of the following: - * H5_ITER_INC Iteration is from beginning to end, i.e., a top-down iteration - * incrementing the index position at each step. - * H5_ITER_DEC Iteration starts at the end of the index, i.e., a bottom-up iteration - * decrementing the index position at each step. - * H5_ITER_NATIVE HDF5 iterates in the fastest-available order. No information is provided - * as to the order, but HDF5 ensures that each element in the index will be - * visited if the iteration completes successfully. - * @param idx - * IN/OUT: Initial and returned offset within index. - * @param op - * IN: Callback function to operate on each value. - * @param op_data - * IN/OUT: Pointer to any user-efined data for use by operator function. - * - * @return returns the return value of the first operator that returns a positive value, or zero if all members were - * processed with no operator returning non-zero. - * - * @exception HDF5LibraryException - * - Error from the HDF-5 Library. - * @exception NullPointerException - * - buf is null. - **/ - public synchronized static native int H5Aiterate(long loc_id, int idx_type, int order, long idx, - H5A_iterate_cb op, H5A_iterate_t op_data) throws HDF5LibraryException, NullPointerException; - /** - * H5Aiterate_by_name iterates over the attributes attached to the dataset or group specified with loc_id - * and obj_name. For each attribute, user-provided data, op_data, with additional information as defined - * below, is passed to a user-defined function, op, which operates on that attribute. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of float. * - * @param loc_id - * IN: Identifier for object to which attributes are attached; may be group, dataset, or named datatype. - * @param obj_name - * IN: Name of object, relative to location. - * @param idx_type - * IN: The type of index specified by idx_type can be one of the following: - * H5_INDEX_NAME An alpha-numeric index by attribute name. - * H5_INDEX_CRT_ORDER An index by creation order. - * @param order - * IN: The order in which the index is to be traversed, as specified by order, can be one of the following: - * H5_ITER_INC Iteration is from beginning to end, i.e., a top-down iteration - * incrementing the index position at each step. - * H5_ITER_DEC Iteration starts at the end of the index, i.e., a bottom-up iteration - * decrementing the index position at each step. - * H5_ITER_NATIVE HDF5 iterates in the fastest-available order. No information is provided - * as to the order, but HDF5 ensures that each element in the index will be - * visited if the iteration completes successfully. - * @param idx - * IN/OUT: Initial and returned offset within index. - * @param op - * IN: Callback function to operate on each value. - * @param op_data - * IN/OUT: Pointer to any user-efined data for use by operator function. - * @param lapl_id - * IN: Link access property list + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of float to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * - * @return returns the return value of the first operator that returns a positive value, or zero if all members were - * processed with no operator returning non-zero. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - buf is null. + * - data buffer is null. **/ - public synchronized static native int H5Aiterate_by_name(long loc_id, String obj_name, int idx_type, - int order, long idx, H5A_iterate_cb op, H5A_iterate_t op_data, long lapl_id) throws HDF5LibraryException, NullPointerException; - - // //////////////////////////////////////////////////////////// - // // - // H5AC: Cache Interface Functions // - // // - // //////////////////////////////////////////////////////////// - - // No public Functions - - // //////////////////////////////////////////////////////////// - // // - // H5B: B-link-tree Interface Functions // - // // - // //////////////////////////////////////////////////////////// - - // No public Functions - - // //////////////////////////////////////////////////////////// - // // - // H5B2: v2 B-tree Interface Functions // - // // - // //////////////////////////////////////////////////////////// - - // No public Functions - - // //////////////////////////////////////////////////////////// - // // - // H5C: Cache Interface Functions // - // // - // //////////////////////////////////////////////////////////// - - // No public Functions - - // //////////////////////////////////////////////////////////// - // // - // H5D: Datasets Interface Functions // - // // - // //////////////////////////////////////////////////////////// + public synchronized static native int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning) + throws HDF5LibraryException, NullPointerException; /** - * H5Dcopy copies the content of one dataset to another dataset. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of float. * - * @param src_did - * the identifier of the source dataset - * @param dst_did - * the identifier of the destinaiton dataset + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of float to store data read from the file. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - */ - public synchronized static native int H5Dcopy(long src_did, long dst_did) throws HDF5LibraryException; + * @exception NullPointerException + * - data buffer is null. + **/ + 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 + { + return H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); + } /** - * H5Dclose ends access to a dataset specified by dataset_id and releases resources used by it. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of int. * * @param dataset_id - * Identifier of the dataset to finish access to. + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of int to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public static int H5Dclose(long dataset_id) throws HDF5LibraryException { - if (dataset_id < 0) - return 0; // throw new HDF5LibraryException("Negative ID"); - - log.trace("OPEN_IDS: H5Dclose remove {}", dataset_id); - OPEN_IDS.remove(dataset_id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - return _H5Dclose(dataset_id); - } - - private synchronized static native int _H5Dclose(long dataset_id) throws HDF5LibraryException; + public synchronized static native int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, + NullPointerException; /** - * H5Dcreate creates a new dataset named name at the location specified by loc_id. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of int. * - * @param loc_id - * IN: Location identifier - * @param name - * IN: Dataset name - * @param type_id - * IN: Datatype identifier - * @param space_id - * IN: Dataspace identifier - * @param lcpl_id - * IN: Identifier of link creation property list. - * @param dcpl_id - * IN: Identifier of dataset creation property list. - * @param dapl_id - * IN: Identifier of dataset access property list. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of int to store data read from the file. * - * @return a dataset identifier + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - name is null. + * - data buffer is null. **/ - public static long H5Dcreate(long loc_id, String name, long type_id, long space_id, long lcpl_id, long dcpl_id, - long dapl_id) throws HDF5LibraryException, NullPointerException { - long id = _H5Dcreate2(loc_id, name, type_id, space_id, lcpl_id, dcpl_id, dapl_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Dcreate add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; + 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 + { + return H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } /** - * H5Dcreate2 creates a new dataset named name at the location specified by loc_id. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of long. * - * @see public static int H5Dcreate(int loc_id, String name, int type_id, int space_id, int lcpl_id, int dcpl_id, - * int dapl_id) + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of long to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - private synchronized static native long _H5Dcreate2(long loc_id, String name, long type_id, long space_id, - long lcpl_id, long dcpl_id, long dapl_id) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException, + NullPointerException; /** - * H5Dcreate_anon creates a dataset in the file specified by loc_id. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of long. * - * @param loc_id - * IN: Location identifier - * @param type_id - * IN: Datatype identifier - * @param space_id - * IN: Dataspace identifier - * @param dcpl_id - * IN: Identifier of dataset creation property list. - * @param dapl_id - * IN: Identifier of dataset access property list. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of long to store data read from the file. * - * @return a dataset identifier + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public static long H5Dcreate_anon(long loc_id, long type_id, long space_id, long dcpl_id, long dapl_id) - throws HDF5LibraryException { - long id = _H5Dcreate_anon(loc_id, type_id, space_id, dcpl_id, dapl_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Dcreate_anon add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; + 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 + { + return H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } - private synchronized static native long _H5Dcreate_anon(long loc_id, long type_id, long space_id, long dcpl_id, - long dapl_id) throws HDF5LibraryException; - /** - * H5Dfill explicitly fills the dataspace selection in memory, space_id, with the fill value specified in fill. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of string. * - * @param fill - * IN: Pointer to the fill value to be used. - * @param fill_type - * IN: Fill value datatype identifier. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. * @param buf - * IN/OUT: Pointer to the memory buffer containing the selection to be filled. - * @param buf_type - * IN: Datatype of dataspace elements to be filled. - * @param space_id - * IN: Dataspace describing memory buffer and containing the selection to be filled. + * Buffer of string to store data read from the file. + * + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - buf is null. + * - data buffer is null. **/ - public synchronized static native void H5Dfill(byte[] fill, long fill_type, byte[] buf, long buf_type, long space_id) - throws HDF5LibraryException, NullPointerException; + 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; /** - * H5Dget_access_plist returns an identifier for a copy of the dataset access property list for a dataset. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of short. * - * @param dset_id - * IN: Identifier of the dataset to query. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of short to store data read from the file. + * @param isCriticalPinning + * request lock on data reference. * - * @return a dataset access property list identifier + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public synchronized static native long H5Dget_access_plist(long dset_id) throws HDF5LibraryException; + 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; /** - * H5Dget_create_plist returns an identifier for a copy of the dataset creation property list for a dataset. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of short. * * @param dataset_id - * Identifier of the dataset to query. - * @return a dataset creation property list identifier if successful + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of short to store data read from the file. + * + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public static long H5Dget_create_plist(long dataset_id) throws HDF5LibraryException { - long id = _H5Dget_create_plist(dataset_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Dget_create_plist add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; + 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 + { + return H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } - private synchronized static native long _H5Dget_create_plist(long dataset_id) throws HDF5LibraryException; - /** - * H5Dget_offset returns the address in the file of the dataset dset_id. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of variable-lenght. * - * @param dset_id - * IN: Identifier of the dataset in question + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of variable-lenght to store data read from the file. * - * @return the offset in bytes. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public synchronized static native long H5Dget_offset(long dset_id) throws HDF5LibraryException; + public synchronized static native int H5DreadVL(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; /** - * H5Dget_space returns an identifier for a copy of the dataspace for a dataset. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of string. * * @param dataset_id - * Identifier of the dataset to query. + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of string to store data read from the file. * - * @return a dataspace identifier if successful + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public static long H5Dget_space(long dataset_id) throws HDF5LibraryException { - long id = _H5Dget_space(dataset_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Dget_space add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; - } - - private synchronized static native long _H5Dget_space(long dataset_id) throws HDF5LibraryException; + public synchronized static native int H5Dread_string(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; /** - * H5Dget_space_status determines whether space has been allocated for the dataset dset_id. + * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application + * memory buffer of variable-lenght strings. * - * @param dset_id - * IN: Identifier of the dataset to query. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of variable-lenght strings to store data read from the file. * - * @return the space allocation status + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - data buffer is null. **/ - public synchronized static native int H5Dget_space_status(long dset_id) throws HDF5LibraryException; + public synchronized static native int H5Dread_VLStrings(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; /** - * H5Dget_storage_size returns the amount of storage that is required for the dataset. - * - * @param dataset_id - * Identifier of the dataset in question + * H5Dset_extent sets the current dimensions of the chunked dataset dset_id to the sizes specified in size. * - * @return he amount of storage space allocated for the dataset. + * @param dset_id + * IN: Chunked dataset identifier. + * @param size + * IN: Array containing the new magnitude of each dimension of the dataset. * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - size is null. **/ - public synchronized static native long H5Dget_storage_size(long dataset_id) throws HDF5LibraryException, - IllegalArgumentException; + public synchronized static native void H5Dset_extent(long dset_id, long size[]) throws HDF5LibraryException, + NullPointerException; /** - * H5Dget_type returns an identifier for a copy of the datatype for a dataset. + * H5Dvlen_get_buf_size determines the number of bytes required to store the VL data from the dataset, using the + * space_id for the selection in the dataset on disk and the type_id for the memory representation of the VL data in + * memory. * - * @param dataset_id - * Identifier of the dataset to query. + * @param dset_id + * IN: Identifier of the dataset read from. + * @param type_id + * IN: Identifier of the datatype. + * @param space_id + * IN: Identifier of the dataspace. * - * @return a datatype identifier if successful + * @return the size in bytes of the memory buffer required to store the VL data. * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. **/ - public static long H5Dget_type(long dataset_id) throws HDF5LibraryException { - long id = _H5Dget_type(dataset_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Dget_type add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; - } - - private synchronized static native long _H5Dget_type(long dataset_id) throws HDF5LibraryException; + public synchronized static native long H5Dvlen_get_buf_size(long dset_id, long type_id, long space_id) + throws HDF5LibraryException; /** - * H5Diterate iterates over all the data elements in the memory buffer buf, executing the callback function operator - * once for each such data element. + * H5Dvlen_reclaim reclaims buffer used for VL data. * - * @param buf - * IN/OUT: Pointer to the memory containing the elements to iterate over. - * @param buf_type - * IN: Buffer datatype identifier. + * @param type_id + * Identifier of the datatype. * @param space_id - * IN: Dataspace describing memory buffer. - * @param op - * IN: Callback function to operate on each value. - * @param op_data - * IN/OUT: Pointer to any user-efined data for use by operator function. + * 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. * - * @return returns the return value of the first operator that returns a positive value, or zero if all members were - * processed with no operator returning non-zero. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException * - buf is null. **/ - public synchronized static native int H5Diterate(byte[] buf, long buf_type, long space_id, H5D_iterate_cb op, - H5D_iterate_t op_data) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Dvlen_reclaim(long type_id, long space_id, long xfer_plist_id, byte[] buf) + throws HDF5LibraryException, NullPointerException; /** - * H5Dopen opens the existing dataset specified by a location identifier and name, loc_id and name, respectively. + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. * - * @param loc_id - * IN: Location identifier - * @param name - * IN: Dataset name - * @param dapl_id - * IN: Identifier of dataset access property list. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. * - * @return a dataset identifier if successful + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException * - name is null. **/ - public static long H5Dopen(long loc_id, String name, long dapl_id) throws HDF5LibraryException, NullPointerException - { - long id = _H5Dopen2(loc_id, name, dapl_id); - if (id > 0) { - log.trace("OPEN_IDS: H5Dopen add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; - } + public synchronized static native int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, byte[] buf, boolean isCriticalPinning) throws HDF5LibraryException, + NullPointerException; /** - * H5Dopen2 opens the existing dataset specified by a location identifier and name, loc_id and name, respectively. + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer with data to be written to the file. * - * @see public static int H5Dopen(int loc_id, String name, int dapl_id) + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. **/ - private synchronized static native long _H5Dopen2(long loc_id, String name, long dapl_id) - throws HDF5LibraryException, 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 + { + return H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); + } /** - * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application - * memory buffer buf. + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. * * @param dataset_id * Identifier of the dataset read from. @@ -1905,36 +3246,24 @@ public class H5 implements java.io.Serializable { * @param xfer_plist_id * Identifier of a transfer property list for this I/O operation. * @param obj - * Buffer to store data read from the file. - * @param isCriticalPinning - * request lock on data reference. + * 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 - * - data buffer is null. + * - name is null. **/ - public synchronized static native int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, byte[] obj, boolean isCriticalPinning) throws HDF5LibraryException, - 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 - { - 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, + 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 { - return H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, obj, true); + return H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, obj, true); } /** - * H5Dread reads a (partial) dataset, specified by its identifier dataset_id, from the file into the application - * data object. + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory data + * object into the file. * * @param dataset_id * Identifier of the dataset read from. @@ -1947,7 +3276,7 @@ public class H5 implements java.io.Serializable { * @param xfer_plist_id * Identifier of a transfer property list for this I/O operation. * @param obj - * Object to store data read from the file. + * Object with data to be written to the file. * @param isCriticalPinning * request lock on data reference. * @@ -1960,7 +3289,7 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - data object is null. **/ - public synchronized static int H5Dread(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, + 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 { @@ -1969,69 +3298,49 @@ public class H5 implements java.io.Serializable { Class dataClass = obj.getClass(); if (!dataClass.isArray()) { - throw (new HDF5JavaException("H5Dread: data is not an array")); + 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); - log.trace("H5Dread: cname={} is1D={} dname={}", cname, is1D, dname); if (is1D && (dname == 'B')) { - log.trace("H5Dread_dname_B"); - status = H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (byte[]) obj, + status = H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (byte[]) obj, isCriticalPinning); } else if (is1D && (dname == 'S')) { - log.trace("H5Dread_dname_S"); - status = H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (short[]) obj, + status = H5Dwrite_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (short[]) obj, isCriticalPinning); } else if (is1D && (dname == 'I')) { - log.trace("H5Dread_dname_I"); - status = H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (int[]) obj, + status = H5Dwrite_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (int[]) obj, isCriticalPinning); } else if (is1D && (dname == 'J')) { - log.trace("H5Dread_dname_J"); - status = H5Dread_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (long[]) obj, + status = H5Dwrite_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (long[]) obj, isCriticalPinning); } else if (is1D && (dname == 'F')) { - log.trace("H5Dread_dname_F"); - status = H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (float[]) obj, + status = H5Dwrite_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (float[]) obj, isCriticalPinning); } else if (is1D && (dname == 'D')) { - log.trace("H5Dread_dname_D"); - status = H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, + status = H5Dwrite_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)) { - log.trace("H5Dread_reg_ref"); - status = H5Dread_reg_ref(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, - (String[]) obj); - } else if (is1D && (dataClass.getComponentType() == String.class)) { - log.trace("H5Dread_string type"); - status = H5Dread_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, + log.trace("H5Dwrite_string type"); + status = H5Dwrite_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_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(); - log.trace("H5Dread_else"); + byte[] buf = theArray.byteify(); - // will raise exception if read fails - status = H5Dread(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, + // will raise exception on error + status = H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, isCriticalPinning); - if (status >= 0) { - // convert the data into a Java Array - obj = theArray.arrayify(buf); - } // clean up these: assign 'null' as hint to gc() buf = null; @@ -2041,131 +3350,219 @@ public class H5 implements java.io.Serializable { return status; } - public synchronized static native int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id, + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of double with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @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 H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; - public synchronized static int H5Dread_double(long dataset_id, long mem_type_id, long mem_space_id, + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of double 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 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 { - return H5Dread_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); + return H5Dwrite_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } - public synchronized static native int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id, + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of float with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @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 H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning) throws HDF5LibraryException, NullPointerException; - public synchronized static int H5Dread_float(long dataset_id, long mem_type_id, long mem_space_id, + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of float 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 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 { - return H5Dread_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); - } - - public synchronized static native int H5Dread_int(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, - 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 - { - return H5Dread_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); - } - - public synchronized static native int H5Dread_long(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException, - 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 - { - 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_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 - { - return H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); + return H5Dwrite_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } - public synchronized static native int H5DreadVL(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; - - public synchronized static native int H5Dread_string(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_VLStrings(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; - /** - * H5Dset_extent sets the current dimensions of the chunked dataset dset_id to the sizes specified in size. + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. * - * @param dset_id - * IN: Chunked dataset identifier. - * @param size - * IN: Array containing the new magnitude of each dimension of the dataset. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of int with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. + * + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - size is null. + * - name is null. **/ - public synchronized static native void H5Dset_extent(long dset_id, long size[]) throws HDF5LibraryException, - NullPointerException; + public synchronized static native int H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, + NullPointerException; /** - * H5Dvlen_get_buf_size determines the number of bytes required to store the VL data from the dataset, using the - * space_id for the selection in the dataset on disk and the type_id for the memory representation of the VL data in - * memory. + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. * - * @param dset_id - * IN: Identifier of the dataset read from. - * @param type_id - * IN: Identifier of the datatype. - * @param space_id - * IN: Identifier of the dataspace. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of int with data to be written to the file. * - * @return the size in bytes of the memory buffer required to store the VL data. + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - buf is null. + * - name is null. **/ - public synchronized static native long H5Dvlen_get_buf_size(long dset_id, long type_id, long space_id) - throws HDF5LibraryException; + 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 + { + return H5Dwrite_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); + } /** - * H5Dvlen_reclaim reclaims buffer used for VL data. + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. * - * @param type_id - * Identifier of the datatype. - * @param space_id - * Identifier of the dataspace. + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. * @param xfer_plist_id * Identifier of a transfer property list for this I/O operation. * @param buf - * Buffer with data to be reclaimed. + * Buffer of long with data to be written to the file. + * @param isCriticalPinning + * request lock on data reference. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - buf is null. + * - name is null. **/ - public synchronized static native int H5Dvlen_reclaim(long type_id, long space_id, long xfer_plist_id, byte[] buf) - throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException, + NullPointerException; /** * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer - * buf into the file. + * into the file. * * @param dataset_id * Identifier of the dataset read from. @@ -2178,9 +3575,7 @@ public class H5 implements java.io.Serializable { * @param xfer_plist_id * Identifier of a transfer property list for this I/O operation. * @param buf - * Buffer with data to be written to the file. - * @param isCriticalPinning - * request lock on data reference. + * Buffer of long with data to be written to the file. * * @return a non-negative value if successful * @@ -2189,25 +3584,15 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - name is null. **/ - public synchronized static native int H5Dwrite(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, byte[] buf, boolean isCriticalPinning) throws HDF5LibraryException, - 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 - { - 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 + 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 { - return H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, obj, true); + return H5Dwrite_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } /** - * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory data - * object into the file. + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. * * @param dataset_id * Identifier of the dataset read from. @@ -2219,134 +3604,103 @@ public class H5 implements java.io.Serializable { * Identifier of the dataset's dataspace in the file. * @param xfer_plist_id * Identifier of a transfer property list for this I/O operation. - * @param obj - * Object with data to be written to the file. + * @param buf + * Buffer of short with data to be written to the file. * @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. + * - name is null. **/ - 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 - { - int status = -1; - boolean is1D = false; - - 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 = H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (byte[]) obj, - isCriticalPinning); - } - else if (is1D && (dname == 'S')) { - status = H5Dwrite_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (short[]) obj, - isCriticalPinning); - } - else if (is1D && (dname == 'I')) { - status = H5Dwrite_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (int[]) obj, - isCriticalPinning); - } - else if (is1D && (dname == 'J')) { - status = H5Dwrite_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (long[]) obj, - isCriticalPinning); - } - else if (is1D && (dname == 'F')) { - status = H5Dwrite_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, (float[]) obj, - isCriticalPinning); - } - else if (is1D && (dname == 'D')) { - status = H5Dwrite_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, - (double[]) obj, isCriticalPinning); - } - else if (is1D && (dataClass.getComponentType() == String.class)) { - log.trace("H5Dwrite_string type"); - status = H5Dwrite_string(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, - (String[]) obj); - } - else { - HDFArray theArray = new HDFArray(obj); - byte[] buf = theArray.byteify(); - - // will raise exception on error - status = H5Dwrite(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, - isCriticalPinning); - - // clean up these: assign 'null' as hint to gc() - buf = null; - theArray = null; - } - - return status; - } - - public synchronized static native int H5Dwrite_double(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, double[] buf, boolean isCriticalPinning) - 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 - { - return H5Dwrite_double(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); - } - - public synchronized static native int H5Dwrite_float(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, float[] buf, boolean isCriticalPinning) - 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 - { - return H5Dwrite_float(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); - } - - public synchronized static native int H5Dwrite_int(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, int[] buf, boolean isCriticalPinning) throws HDF5LibraryException, - 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 - { - return H5Dwrite_int(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); - } - - public synchronized static native int H5Dwrite_long(long dataset_id, long mem_type_id, long mem_space_id, - long file_space_id, long xfer_plist_id, long[] buf, boolean isCriticalPinning) throws HDF5LibraryException, - 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 - { - return H5Dwrite_long(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); - } - public synchronized static native int H5Dwrite_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; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of short 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 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 { return H5Dwrite_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of string 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 H5Dwrite_string(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; + /** + * H5Dwrite writes a (partial) dataset, specified by its identifier dataset_id, from the application memory buffer + * into the file. + * + * @param dataset_id + * Identifier of the dataset read from. + * @param mem_type_id + * Identifier of the memory datatype. + * @param mem_space_id + * Identifier of the memory dataspace. + * @param file_space_id + * Identifier of the dataset's dataspace in the file. + * @param xfer_plist_id + * Identifier of a transfer property list for this I/O operation. + * @param buf + * Buffer of variable-length 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 H5DwriteVL(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; @@ -2623,7 +3977,7 @@ public class H5 implements java.io.Serializable { /** - * H5Epush2 pushes a new error record onto the error stack specified by estack_id. + * H5Epush pushes a new error record onto the error stack specified by estack_id. * * @param stack_id * IN: Error stack identifier. @@ -2652,6 +4006,31 @@ public class H5 implements java.io.Serializable { { H5Epush2(stack_id, file, func, line, cls_id, maj_id, min_id, msg); } + /** + * H5Epush2 pushes a new error record onto the error stack specified by estack_id. + * + * @param stack_id + * IN: Error stack identifier. + * @param file + * IN: Name of the file in which the error was detected. + * @param func + * IN: Name of the function in which the error was detected. + * @param line + * IN: Line number within the file at which the error was detected. + * @param cls_id + * IN: Error class identifier. + * @param maj_id + * IN: Major error identifier. + * @param min_id + * IN: Minor error identifier. + * @param msg + * IN: Error description string. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - file, func, or msg is null. + **/ public synchronized static native void H5Epush2(long stack_id, String file, String func, int line, long cls_id, long maj_id, long min_id, String msg) throws HDF5LibraryException, NullPointerException; @@ -2709,6 +4088,24 @@ public class H5 implements java.io.Serializable { { H5Ewalk2(stack_id, direction, func, client_data); } + /** + * H5Ewalk2 walks the error stack specified by estack_id for the current thread and calls the + * function specified in func for each error along the way. + * + * @param stack_id + * IN: Error stack identifier. + * @param direction + * IN: Direction in which the error stack is to be walked. + * @param func + * IN: Function to be called for each error encountered. + * @param client_data + * IN: Data to be passed with func. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - func is null. + **/ public synchronized static native void H5Ewalk2(long stack_id, long direction, H5E_walk_cb func, H5E_walk_t client_data) throws HDF5LibraryException, NullPointerException; @@ -2945,6 +4342,19 @@ public class H5 implements java.io.Serializable { private synchronized static native long _H5Fget_create_plist(long file_id) throws HDF5LibraryException; + /** + * H5Fget_filesize retrieves the file size of the HDF5 file. This function + * is called after an existing file is opened in order + * to learn the true size of the underlying file. + * + * @param file_id + * IN: File identifier for a currently-open HDF5 file + * + * @return the file size of the HDF5 file + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5Fget_filesize(long file_id) throws HDF5LibraryException; /** @@ -3560,40 +4970,121 @@ public class H5 implements java.io.Serializable { return H5Gget_obj_info_all(loc_id, name, objNames, objTypes, null, null, objRef, 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); + /** + * retrieves information of all objects under the group (name) located in the file or group specified by loc_id. + * + * @param loc_id + * IN: File or group identifier + * @param name + * IN: Name of group for which information is to be retrieved + * @param objNames + * OUT: Names of all objects under the group, name. + * @param objTypes + * OUT: Types of all objects under the group, name. + * @param ltype + * OUT: Link type + * @param objRef + * OUT: Reference number of all objects under the group, name. + * @param indx_type + * IN: Index type for iterate + * + * @return the number of items found + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + */ + public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes, + int[] ltype, long[] objRef, int indx_type) throws HDF5LibraryException, NullPointerException { + return H5Gget_obj_info_full(loc_id, name, objNames, objTypes, ltype, null, objRef, 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, indx_type, -1); + /** + * retrieves information of all objects under the group (name) located in the file or group specified by loc_id. + * + * @param loc_id + * IN: File or group identifier + * @param name + * IN: Name of group for which information is to be retrieved + * @param objNames + * OUT: Names of all objects under the group, name. + * @param objTypes + * OUT: Types of all objects under the group, name. + * @param ltype + * OUT: Link type + * @param fno + * OUT: File number + * @param objRef + * OUT: Reference number of all objects under the group, name. + * @param indx_type + * IN: Index type for iterate + * + * @return the number of items found + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + */ + public synchronized static int H5Gget_obj_info_all(long loc_id, String name, String[] objNames, int[] objTypes, + int[] ltype, long[] fno, long[] objRef, int indx_type) throws HDF5LibraryException, NullPointerException { + return H5Gget_obj_info_full(loc_id, name, objNames, objTypes, ltype, fno, objRef, 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, + /** + * retrieves information of all objects under the group (name) located in the file or group specified by loc_id. + * + * @param loc_id + * IN: File or group identifier + * @param name + * IN: Name of group for which information is to be retrieved + * @param objNames + * OUT: Names of all objects under the group, name. + * @param objTypes + * OUT: Types of all objects under the group, name. + * @param ltype + * OUT: Link type + * @param fno + * OUT: File number + * @param objRef + * OUT: Reference number of all objects under the group, name. + * @param indx_type + * IN: Index type for iterate + * @param indx_order + * IN: Index order for iterate + * + * @return the number of items found + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + */ + public synchronized static int H5Gget_obj_info_full(long loc_id, String name, String[] objNames, int[] objTypes, + int[] ltype, long[] fno, long[] objRef, int indx_type, int indx_order) throws HDF5LibraryException, NullPointerException { - if (oname == null) { + if (objNames == null) { throw new NullPointerException("H5Gget_obj_info_full(): name array is null"); } - if (otype == null) { + if (objTypes == null) { throw new NullPointerException("H5Gget_obj_info_full(): object type array is null"); } - if (oname.length == 0) { + if (objNames.length == 0) { throw new HDF5LibraryException("H5Gget_obj_info_full(): array size is zero"); } - if (oname.length != otype.length) { + if (objNames.length != objTypes.length) { throw new HDF5LibraryException("H5Gget_obj_info_full(): name and type array sizes are different"); } if (ltype == null) - ltype = new int[otype.length]; + ltype = new int[objTypes.length]; if (fno == null) - fno = new long[ref.length]; + fno = new long[objRef.length]; if (indx_type < 0) indx_type = HDF5Constants.H5_INDEX_NAME; @@ -3601,16 +5092,16 @@ public class H5 implements java.io.Serializable { if (indx_order < 0) indx_order = HDF5Constants.H5_ITER_INC; - log.trace("H5Gget_obj_info_full: oname_len={}", oname.length); - int status = H5Gget_obj_info_full(loc_id, name, oname, otype, ltype, fno, ref, oname.length, indx_type, + log.trace("H5Gget_obj_info_full: objNames_len={}", objNames.length); + int status = H5Gget_obj_info_full(loc_id, name, objNames, objTypes, ltype, fno, objRef, objNames.length, indx_type, indx_order); - for (int indx = 0; indx < oname.length; indx++) - log.trace("H5Gget_obj_info_full: oname={}", oname[indx]); + for (int indx = 0; indx < objNames.length; indx++) + log.trace("H5Gget_obj_info_full: objNames={}", objNames[indx]); 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, + private synchronized static native int H5Gget_obj_info_full(long loc_id, String name, String[] objNames, int[] objTypes, + int[] ltype, long[] fno, long[] objRef, int n, int indx_type, int indx_order) throws HDF5LibraryException, NullPointerException; /** @@ -3625,9 +5116,9 @@ public class H5 implements java.io.Serializable { * @param idx * IN: the index of the object to iterate. * @param oname - * the name of the object [OUT] + * OUT: the name of the object * @param type - * the type of the object [OUT] + * OUT: the type of the object * * @return non-negative if successful, -1 if not. * @@ -3828,13 +5319,40 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// + /** + * H5Iget_file_id obtains the file ID specified by the identifier, obj_id. + * + * @param obj_id + * IN: Identifier of the object. + * + * @return the file ID. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5Iget_file_id(long obj_id) throws HDF5LibraryException; + /** + * H5Iget_name_long retrieves the name of an object specified by the identifier, obj_id. + * @deprecated + * + * @param obj_id + * IN: Identifier of the object. + * @param name + * OUT: Attribute name buffer. + * @param size + * IN: Maximum length of the name to retrieve. + * + * @return the length of the name retrieved. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ @Deprecated public synchronized static native long H5Iget_name_long(long obj_id, String[] name, long size) throws HDF5LibraryException, NullPointerException; /** - * H5Iget_name_str retrieves the name of an object specified by the identifier, obj_id. + * H5Iget_name retrieves the name of an object specified by the identifier, obj_id. * * @param obj_id * IN: Identifier of the object. @@ -3847,10 +5365,44 @@ public class H5 implements java.io.Serializable { public synchronized static native String H5Iget_name(long obj_id) throws HDF5LibraryException; + /** + * H5Iget_ref obtains the number of references outstanding specified by the identifier, obj_id. + * + * @param obj_id + * IN: Identifier of the object. + * + * @return the reference count. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Iget_ref(long obj_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Idec_ref decrements the reference count specified by the identifier, obj_id. + * If the reference count for an ID reaches zero, the object will be closed. + * + * @param obj_id + * IN: Identifier of the object. + * + * @return the reference count. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Idec_ref(long obj_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Iinc_ref increments the reference count specified by the identifier, obj_id. + * + * @param obj_id + * IN: Identifier of the object. + * + * @return the reference count. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Iinc_ref(long obj_id) throws HDF5LibraryException, NullPointerException; /** @@ -4944,11 +6496,13 @@ public class H5 implements java.io.Serializable { **/ public static long H5Oopen_by_addr(long loc_id, long addr) throws HDF5LibraryException { long id = _H5Oopen_by_addr(loc_id, addr); + if (id > 0) { log.trace("OPEN_IDS: H5Oopen_by_addr add {}", id); OPEN_IDS.add(id); log.trace("OPEN_IDS: {}", OPEN_IDS.size()); } + return id; } @@ -4981,7 +6535,7 @@ public class H5 implements java.io.Serializable { return id; } - public synchronized static native long _H5Oopen_by_idx(long loc_id, String group_name, + private synchronized static native long _H5Oopen_by_idx(long loc_id, String group_name, int idx_type, int order, long n, long lapl_id) throws HDF5LibraryException, NullPointerException; /** @@ -5012,8 +6566,30 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Orefresh(long object_id) throws HDF5LibraryException; + /** + * H5Odisable_mdc_flushes corks an object, keeping dirty entries associated with the object in the metadata cache. + * + * @param object_id + * IN: Identifier of the object to be corked. + **/ public synchronized static native void H5Odisable_mdc_flushes(long object_id); + /** + * H5Oenable_mdc_flushes uncorks an object, keeping dirty entries associated with the object in the metadata cache. + * + * @param object_id + * IN: Identifier of the object to be uncorked. + **/ public synchronized static native void H5Oenable_mdc_flushes(long object_id); + /** + * H5Oare_mdc_flushes_disabled retrieve the object's "cork" status. + * + * @param object_id + * IN: Identifier of the object to be flushed. + * + * @return the cork status + * TRUE if mdc flushes for the object is disabled + * FALSE if mdc flushes for the object is not disabled + **/ public synchronized static native boolean H5Oare_mdc_flushes_disabled(long object_id); // //////////////////////////////////////////////////////////// @@ -5160,6 +6736,7 @@ public class H5 implements java.io.Serializable { * IN: First property object to be compared * @param plid2 * IN: Second property object to be compared + * * @return positive value if equal; zero if unequal, a negative value if failed * * @exception HDF5LibraryException @@ -5167,6 +6744,19 @@ public class H5 implements java.io.Serializable { */ public synchronized static native int H5Pequal(long plid1, long plid2) throws HDF5LibraryException; + /** + * H5Pequal determines if two property lists or classes are equal + * + * @param plid1 + * IN: First property object to be compared + * @param plid2 + * IN: Second property object to be compared + * + * @return TRUE if equal, FALSE if unequal + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + */ public static boolean H5P_equal(long plid1, long plid2) throws HDF5LibraryException { if (H5Pequal(plid1, plid2) == 1) return true; @@ -5252,7 +6842,7 @@ public class H5 implements java.io.Serializable { return _H5Pclose_class(plid); } - public synchronized static native int _H5Pclose_class(long plid) throws HDF5LibraryException; + private synchronized static native int _H5Pclose_class(long plid) throws HDF5LibraryException; /** * H5Pclose terminates access to a property list. @@ -5299,6 +6889,40 @@ 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); + + /** + * H5Pcreate_class_nocb creates an new property class with no callback functions. + * + * @param parent_class + * IN: Identifier of the parent property class. + * @param name + * IN: Name of the property class. + * + * @return a property list identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public static long H5Pcreate_class_nocb(long parent_class, String name) throws HDF5LibraryException { long id = _H5Pcreate_class_nocb(parent_class, name); if (id > 0) { @@ -5325,17 +6949,69 @@ public class H5 implements java.io.Serializable { // private synchronized static native long _H5Pcreate_class(long parent_class, String name, H5P_cls_create_func_cb create_op, H5P_cls_create_func_t create_data, // H5P_cls_copy_func_cb copy_op, H5P_cls_copy_func_t copy_data, H5P_cls_close_func_cb close_op, H5P_cls_close_func_t close_data) throws HDF5LibraryException; + /** + * H5Pregister2_nocb registers a property list with no callback functions. + * + * @param plist_class + * IN: Identifier of the property list. + * @param name + * IN: Name of the property. + * @param size + * IN: Size the property value. + * @param def_value + * IN: Defaul value of the property + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5Pregister2_nocb(long plist_class, String name, long size, byte[] def_value) throws HDF5LibraryException; // public synchronized static native void H5Pregister2(long plist_class, String name, long size, byte[] def_value, H5P_prp_create_func_cb prp_create, H5P_prp_set_func_cb prp_set, // H5P_prp_get_func_cb prp_get, H5P_prp_delete_func_cb prp_delete, H5P_prp_copy_func_cb prp_copy, H5P_prp_compare_func_cb prp_cmp, H5P_prp_close_func_cb prp_close) throws HDF5LibraryException; + /** + * H5Pinsert2_nocb inserts a property list with no callback functions. + * + * @param plist + * IN: Identifier of the property list. + * @param name + * IN: Name of the property. + * @param size + * IN: Size the property value. + * @param value + * IN: Defaul value of the property + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5Pinsert2_nocb(long plist, String name, long size, byte[] value) throws HDF5LibraryException; // public synchronized static native void H5Pinsert2(long plist, String name, long size, byte[] value, H5P_prp_set_func_cb prp_set, H5P_prp_get_func_cb prp_get, // H5P_prp_delete_func_cb prp_delete, H5P_prp_copy_func_cb prp_copy, H5P_prp_compare_func_cb prp_cmp, H5P_prp_close_func_cb prp_close) throws HDF5LibraryException; + /** + * H5Piterate iterates over the properties in a property list or class + * + * @param plist + * IN: ID of property object to iterate over + * @param idx + * IN/OUT: index of the property to begin with + * @param op + * IN: function to be called with each property iterated over. + * @param op_data + * IN: iteration data from user + * + * @return + * the return value of the last call to op if it was non-zero, + * zero if all properties have been processed + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - size is null. + * + **/ public synchronized static native int H5Piterate(long plist, int[] idx, H5P_iterate_cb op, H5P_iterate_t op_data) throws HDF5LibraryException; // /////// Object creation property list (OCPL) routines /////// @@ -5348,7 +7024,7 @@ public class H5 implements java.io.Serializable { * @param attributes * The maximun and minimum no. of attributes to be stored. * - *
+     * 
      *      attributes[0] =  The maximum number of attributes to be stored in compact storage
      *      attributes[1] =  The minimum number of attributes to be stored in dense storage
      * 
@@ -5438,16 +7114,61 @@ public class H5 implements java.io.Serializable { * @param ocpl_id * IN: Object creation property list identifier * - * @param track_times - * IN: TRUE or FALSE, specifying whether object times are to be tracked + * @param track_times + * IN: TRUE or FALSE, specifying whether object times are to be tracked + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native void H5Pset_obj_track_times(long ocpl_id, boolean track_times) + throws HDF5LibraryException; + + /** + * H5Pmodify_filter modifies the specified FILTER in the transient or permanent output filter pipeline + * depending on whether PLIST is a dataset creation or dataset + * transfer property list. The FLAGS argument specifies certain + * general properties of the filter and is documented below. + * The CD_VALUES is an array of CD_NELMTS integers which are + * auxiliary data for the filter. The integer vlues will be + * stored in the dataset object header as part of the filter + * information. + *

+ * The FLAGS argument is a bit vector of the following fields: + *

+ * H5Z_FLAG_OPTIONAL(0x0001) + * If this bit is set then the filter is optional. If the + * filter fails during an H5Dwrite() operation then the filter + * is just excluded from the pipeline for the chunk for which it + * failed; the filter will not participate in the pipeline + * during an H5Dread() of the chunk. If this bit is clear and + * the filter fails then the entire I/O operation fails. + * If this bit is set but encoding is disabled for a filter, + * attempting to write will generate an error. + *

+ * Note: This function currently supports only the permanent filter + * pipeline. That is, PLIST_ID must be a dataset creation + * property list. + * + * @param plist + * IN: Property list identifier. + * @param filter + * IN: Filter to be modified to the pipeline. + * @param flags + * IN: Bit vector specifying certain general properties of the filter. + * @param cd_nelmts + * IN: Number of elements in cd_values + * @param cd_values + * IN: Auxiliary data for the filter. + * + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name or an array is null. * **/ - public synchronized static native void H5Pset_obj_track_times(long ocpl_id, boolean track_times) - throws HDF5LibraryException; - public synchronized static native int H5Pmodify_filter(long plist, long filter, int flags, long cd_nelmts, int[] cd_values) throws HDF5LibraryException, NullPointerException; @@ -5619,9 +7340,37 @@ public class H5 implements java.io.Serializable { throws HDF5LibraryException, NullPointerException; + /** + * H5Pall_filters_avail query to verify that all the filters set + * in the dataset creation property list are available currently. + * + * @param dcpl_id + * IN: Property list identifier. + * + * @return + * TRUE if all filters available + * FALSE if one or more filters not currently available. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native boolean H5Pall_filters_avail(long dcpl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Premove_filter deletes a filter from the dataset creation property list; + * deletes all filters if filter is H5Z_FILTER_NONE + * + * @param obj_id + * IN: Property list identifier. + * @param filter + * IN: Filter identifier. + * + * @return a non-negative value and the size of the user block; if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Premove_filter(long obj_id, long filter) throws HDF5LibraryException; /** @@ -5639,6 +7388,18 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5Pset_deflate(long plist, int level) throws HDF5LibraryException; + /** + * H5Pset_fletcher32 sets Fletcher32 checksum of EDC for a dataset creation + * property list or group creation property list. + * + * @param plist + * IN: Property list identifier. + * + * @return a non-negative value and the size of the user block; if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Pset_fletcher32(long plist) throws HDF5LibraryException, NullPointerException; @@ -6109,11 +7870,35 @@ public class H5 implements java.io.Serializable { */ public synchronized static native long H5Pget_driver(long plid) throws HDF5LibraryException; - public synchronized static native long H5Pget_family_offset(long fapl_id) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pget_family_offset gets offset for family driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return the offset. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native long H5Pget_family_offset(long fapl_id) throws HDF5LibraryException; - public synchronized static native int H5Pset_family_offset(long fapl_id, long offset) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pset_family_offset sets the offset for family driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param offset + * IN: the offset value + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pset_family_offset(long fapl_id, long offset) throws HDF5LibraryException; /** * Retrieves the maximum possible number of elements in the meta data cache and the maximum possible number of bytes @@ -6164,9 +7949,8 @@ public class H5 implements java.io.Serializable { double rdcc_w0) throws HDF5LibraryException; /** - * H5Pget_mdc_config gets the initial metadata cache configuration contained in a file access property list and - * loads it into the instance of H5AC_cache_config_t pointed to by the config_ptr parameter. This configuration is - * used when the file is opened. + * H5Pget_mdc_config gets the initial metadata cache configuration contained in a file access property list. + * This configuration is used when the file is opened. * * @param plist_id * IN: Identifier of the file access property list. @@ -6178,6 +7962,19 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native H5AC_cache_config_t H5Pget_mdc_config(long plist_id) throws HDF5LibraryException; + /** + * H5Pset_mdc_config sets the initial metadata cache configuration contained in a file access property list and + * loads it into the instance of H5AC_cache_config_t pointed to by the config_ptr parameter. This configuration is + * used when the file is opened. + * + * @param plist_id + * IN: Identifier of the file access property list. + * @param config_ptr + * IN: H5AC_cache_config_t, the initial metadata cache configuration. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5Pset_mdc_config(long plist_id, H5AC_cache_config_t config_ptr) throws HDF5LibraryException; @@ -6212,10 +8009,35 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_gc_references(long fapl_id, boolean gc_ref) throws HDF5LibraryException; - public synchronized static native int H5Pget_fclose_degree(long plist_id) throws HDF5LibraryException, + /** + * H5Pget_fclose_degree returns the degree for the file close behavior for a file access + * property list. + * + * @param fapl_id + * IN File access property list + * + * @return the degree for the file close behavior + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Pget_fclose_degree(long fapl_id) throws HDF5LibraryException, NullPointerException; - public synchronized static native int H5Pset_fclose_degree(long plist, int degree) throws HDF5LibraryException, + /** + * H5Pset_fclose_degree sets the degree for the file close behavior. + * + * @param fapl_id + * IN File access property list + * @param degree + * IN the degree for the file close behavior + * + * @return non-negative if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Pset_fclose_degree(long fapl_id, int degree) throws HDF5LibraryException, NullPointerException; /** @@ -6246,8 +8068,40 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Pset_meta_block_size(long fapl_id, long size) throws HDF5LibraryException; + /** + * H5Pget_sieve_buf_size retrieves the current settings for the data sieve buffer size + * property from a file access property list. + * + * @param fapl_id + * IN: Identifier for property list to query. + * + * @return a non-negative value and the size of the user block; if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native long H5Pget_sieve_buf_size(long fapl_id) throws HDF5LibraryException; + /** + * H5Pset_sieve_buf_size Sets the maximum size of the data seive buffer used for file + * drivers which are capable of using data sieving. The data sieve + * buffer is used when performing I/O on datasets in the file. Using a + * buffer which is large anough to hold several pieces of the dataset + * being read in for hyperslab selections boosts performance by quite a + * bit. + *

+ * The default value is set to 64KB, indicating that file I/O for raw data + * reads and writes will occur in at least 64KB blocks. Setting the value to 0 + * with this function will turn off the data sieving + * + * @param fapl_id + * IN: Identifier of property list to modify. + * @param size + * IN: maximum size of the data seive buffer. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native void H5Pset_sieve_buf_size(long fapl_id, long size) throws HDF5LibraryException; /** @@ -6586,6 +8440,25 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_chunk(long plist, int ndims, byte[] dim) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + /** + * H5Pset_chunk sets the size of the chunks used to store a chunked layout dataset. + * + * @param plist + * IN: Identifier for property list to query. + * @param ndims + * IN: The number of dimensions of each chunk. + * @param dim + * IN: An array containing the size of each chunk. + * + * @return a non-negative value if successful + * + * @exception HDF5Exception + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - dims array is null. + * @exception IllegalArgumentException + * - dims <=0 + **/ public synchronized static int H5Pset_chunk(long plist, int ndims, long[] dim) throws HDF5Exception, NullPointerException, IllegalArgumentException { if (dim == null) { @@ -6821,9 +8694,37 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5Pget_external_count(long plist) throws HDF5LibraryException; + /** + * H5Pset_szip Sets up the use of the szip filter. + * + * @param plist + * IN: Dataset creation property list identifier. + * @param options_mask + * IN: Bit vector specifying certain general properties of the filter. + * @param pixels_per_block + * IN: Number of pixels in blocks + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_szip(long plist, int options_mask, int pixels_per_block) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_shuffle Sets up the use of the shuffle filter. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_shuffle(long plist_id) throws HDF5LibraryException, NullPointerException; @@ -6951,20 +8852,91 @@ public class H5 implements java.io.Serializable { return retVal; } + /** + * H5Pset_fill_value checks if the fill value is defined for a dataset creation property list. + * + * @param plist_id + * IN: Property list identifier. + * @param status + * IN: The fill value setting: + * H5D_FILL_VALUE_UNDEFINED + * H5D_FILL_VALUE_DEFAULT + * H5D_FILL_VALUE_USER_DEFINED + * H5D_FILL_VALUE_ERROR + * + * @return a non-negative value if successful + * + * @exception HDF5Exception + * - Error converting data array + **/ public synchronized static native int H5Pfill_value_defined(long plist_id, int[] status) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_alloc_time Gets space allocation time for dataset during creation. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * @param alloc_time + * OUT: allocation time. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pget_alloc_time(long plist_id, int[] alloc_time) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_alloc_time Sets space allocation time for dataset during creation. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * @param alloc_time + * IN: allocation time. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_alloc_time(long plist_id, int alloc_time) throws HDF5LibraryException, NullPointerException; - public synchronized static native int H5Pget_fill_time(long plist_id, int[] fill_time) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pset_fill_time Gets fill value writing time. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * @param fill_time + * OUT: fill time. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pget_fill_time(long plist_id, int[] fill_time) throws HDF5LibraryException; - public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException, - NullPointerException; + /** + * H5Pset_fill_time Sets the fill value writing time. + * + * @param plist_id + * IN: Dataset creation property list identifier. + * @param fill_time + * IN: fill time. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ + public synchronized static native int H5Pset_fill_time(long plist_id, int fill_time) throws HDF5LibraryException; /** * H5Pset_chunk_opts Sets the edge chunk option in a dataset creation property list. @@ -7264,6 +9236,20 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pget_buffer(long plist, byte[] tconv, byte[] bkg) throws HDF5LibraryException, IllegalArgumentException; + /** + * H5Pget_buffer_size gets type conversion and background buffer size, in bytes, if successful; + * otherwise 0 on failure. + * + * @param plist + * Identifier for the dataset transfer property list. + * + * @return buffer size, in bytes, if successful; otherwise 0 on failure + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception IllegalArgumentException + * - plist is invalid. + **/ public synchronized static native long H5Pget_buffer_size(long plist) throws HDF5LibraryException, IllegalArgumentException; @@ -7291,14 +9277,36 @@ public class H5 implements java.io.Serializable { * @exception IllegalArgumentException * - plist is invalid. **/ - public synchronized static native void H5Pset_buffer_size(long plist, long size) throws HDF5LibraryException, - IllegalArgumentException; - - public synchronized static native int H5Pget_edc_check(long plist) throws HDF5LibraryException, - NullPointerException; - - public synchronized static native int H5Pset_edc_check(long plist, int check) throws HDF5LibraryException, - NullPointerException; + public synchronized static native void H5Pset_buffer_size(long plist, long size) throws HDF5LibraryException, + IllegalArgumentException; + + /** + * H5Pget_edc_check gets the error-detecting algorithm in use. + * + * @param plist + * Identifier for the dataset transfer property list. + * + * @return the error-detecting algorithm + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Pget_edc_check(long plist) throws HDF5LibraryException; + + /** + * H5Pset_edc_check sets the error-detecting algorithm. + * + * @param plist + * Identifier for the dataset transfer property list. + * @param check + * the error-detecting algorithm to use. + * + * @return non-negative if succeed + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Pset_edc_check(long plist, int check) throws HDF5LibraryException; /** * H5Pget_btree_ratio Get the B-tree split ratios for a dataset transfer property list. @@ -7343,9 +9351,46 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_btree_ratios(long plist_id, double left, double middle, double right) throws HDF5LibraryException; + /** + * H5Pget_hyper_vector_size reads values previously set with H5Pset_hyper_vector_size. + * + * @param dxpl_id + * IN: Dataset transfer property list identifier. + * @param vector_size + * OUT: hyper vector size. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pget_hyper_vector_size(long dxpl_id, long[] vector_size) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_hyper_vector_size sets the number of + * "I/O vectors" (offset and length pairs) which are to be + * accumulated in memory before being issued to the lower levels + * of the library for reading or writing the actual data. + * Increasing the number should give better performance, but use + * more memory during hyperslab I/O. The vector size must be + * greater than 1. + *,p. + * The default is to use 1024 vectors for I/O during hyperslab + * reading/writing. + * + * @param dxpl_id + * IN: Dataset transfer property list identifier. + * @param vector_size + * IN: hyper vestor size. + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_hyper_vector_size(long dxpl_id, long vector_size) throws HDF5LibraryException, NullPointerException; @@ -7543,8 +9588,32 @@ public class H5 implements java.io.Serializable { // /////// String creation property list (STRCPL) routines /////// + /** + * H5Pget_char_encoding gets the character encoding of the string. + * + * @param plist_id + * IN: the property list identifier + * + * @return Returns the character encoding of the string. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pget_char_encoding(long plist_id) throws HDF5LibraryException; + /** + * H5Pset_char_encoding sets the character encoding of the string. + * + * @param plist_id + * IN: the property list identifier + * @param encoding + * IN: the character encoding of the string + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native void H5Pset_char_encoding(long plist_id, int encoding) throws HDF5LibraryException; @@ -7732,7 +9801,7 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_copy_object(long ocp_plist_id, int copy_options) throws HDF5LibraryException; - // /////// Other/Older property list routines /////// + // /////// file drivers property list routines /////// /** * H5Pget_version retrieves the version information of various objects for a file creation property list. @@ -7759,25 +9828,57 @@ public class H5 implements java.io.Serializable { * * @deprecated As of HDF5 1.10.0 in favor of H5Fget_info. **/ + @Deprecated public synchronized static native int H5Pget_version(long plist, int[] version_info) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; // /////// file drivers property list routines /////// + /** + * H5Pget_fapl_core retrieve H5FD_CORE I/O settings. + * + * @param fapl_id + * IN: File access property list identifier + * @param increment + * OUT: how much to grow the memory each time + * @param backing_store + * OUT: write to file name on flush setting + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native void H5Pget_fapl_core(long fapl_id, long[] increment, boolean[] backing_store) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_core modifies the file access property list to use the H5FD_CORE driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param increment + * IN: how much to grow the memory each time + * @param backing_store + * IN: write to file name on flush setting + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_core(long fapl_id, long increment, boolean backing_store) throws HDF5LibraryException, NullPointerException; /** - * H5Pget_fapl_direct Retrieve direct I/O settings. + * H5Pget_fapl_direct queries properties set by the H5Pset_fapl_direct. * * @param fapl_id * IN: File access property list identifier * @param info - * OUT: Returned property list information info[0] = alignment Required memory alignment boundary info[1] - * = block_size File system block size info[2] = cbuf_size Copy buffer size + * OUT: Returned property list information + * info[0] = increment -how much to grow the memory each time + * info[1] = backing_store - write to file name on flush setting * * @return a non-negative value if successful; otherwise returns a negative value. * @@ -7808,14 +9909,72 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Pset_fapl_direct(long fapl_id, long alignment, long block_size, long cbuf_size) throws HDF5LibraryException; + /** + * H5Pget_fapl_family Returns information about the family file access property list. + * + * @param fapl_id + * IN: File access property list identifier + * @param memb_size + * OUT: the size in bytes of each file member (used only when creating a new file) + * @param memb_fapl_id + * OUT: the file access property list to be used for each family member + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pget_fapl_family(long fapl_id, long[] memb_size, long[] memb_fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_family Sets up use of the direct I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param memb_size + * IN: the size in bytes of each file member (used only when creating a new file) + * @param memb_fapl_id + * IN: the file access property list to be used for each family member + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_family(long fapl_id, long memb_size, long memb_fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_hdfs Modify the file access property list to use the H5FD_HDFS driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param fapl_conf + * IN: the properties of the hdfs driver + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_hdfs(long fapl_id, H5FD_hdfs_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException; + /** + * H5Pget_fapl_hdfs gets the properties hdfs I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return the properties of the hdfs driver. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native H5FD_hdfs_fapl_t H5Pget_fapl_hdfs(long fapl_id) throws HDF5LibraryException, NullPointerException; /** @@ -7893,17 +10052,99 @@ public class H5 implements java.io.Serializable { public synchronized static native void H5Pset_fapl_log(long fapl_id, String logfile, long flags, long buf_size) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_sec2 Sets up use of the sec2 I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_sec2(long fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_split Sets up use of the split I/O driver. Makes the multi driver act like the + * old split driver which stored meta data in one file and raw + * data in another file + * + * @param fapl_id + * IN: File access property list identifier + * @param meta_ext + * IN: meta filename extension + * @param meta_plist_id + * IN: File access property list identifier for metadata + * @param raw_ext + * IN: raw data filename extension + * @param raw_plist_id + * IN: File access property list identifier raw data + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native void H5Pset_fapl_split(long fapl_id, String meta_ext, long meta_plist_id, String raw_ext, long raw_plist_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_stdio Sets up use of the stdio I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_stdio(long fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_windows Sets up use of the windows I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_windows(long fapl_id) throws HDF5LibraryException, NullPointerException; + /** + * H5Pset_fapl_ros3 Modify the file access property list to use the H5FD_ROS3 driver. + * + * @param fapl_id + * IN: File access property list identifier + * @param fapl_conf + * IN: the properties of the ros3 driver + * + * @return a non-negative value if successful; otherwise returns a negative value. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native int H5Pset_fapl_ros3(long fapl_id, H5FD_ros3_fapl_t fapl_conf) throws HDF5LibraryException, NullPointerException; + /** + * H5Pget_fapl_ros3 gets the properties of the ros3 I/O driver. + * + * @param fapl_id + * IN: File access property list identifier + * + * @return the properties of the ros3 driver. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * + **/ public synchronized static native H5FD_ros3_fapl_t H5Pget_fapl_ros3(long fapl_id) throws HDF5LibraryException, NullPointerException; // /////// unimplemented //////// @@ -8286,29 +10527,109 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// + /**************** Operations on dataspaces ********************/ + /** - * H5Sclose releases a dataspace. + * H5Screate creates a new dataspace of a particular type. + * + * @param type + * IN: The type of dataspace to be created. + * + * @return a dataspace identifier + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public static long H5Screate(int type) throws HDF5LibraryException { + long id = _H5Screate(type); + if (id > 0) { + log.trace("OPEN_IDS: H5Screate add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Screate(int type) throws HDF5LibraryException; + + /** + * H5Screate_simple creates a new simple data space and opens it for access. + * + * @param rank + * IN: Number of dimensions of dataspace. + * @param dims + * IN: An array of the size of each dimension. + * @param maxdims + * IN: An array of the maximum size of each dimension. + * + * @return a dataspace identifier + * + * @exception HDF5Exception + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - dims or maxdims is null. + **/ + public static long H5Screate_simple(int rank, long[] dims, long[] maxdims) throws HDF5Exception, + NullPointerException { + long id = _H5Screate_simple(rank, dims, maxdims); + if (id > 0) { + log.trace("OPEN_IDS: H5Screate_simple add {}", id); + OPEN_IDS.add(id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + } + return id; + } + + private synchronized static native long _H5Screate_simple(int rank, long[] dims, long[] maxdims) + throws HDF5Exception, NullPointerException; + + /** + * H5Sset_extent_simple sets or resets the size of an existing dataspace. * * @param space_id - * Identifier of dataspace to release. + * Dataspace identifier. + * @param rank + * Rank, or dimensionality, of the dataspace. + * @param current_size + * Array containing current size of dataspace. + * @param maximum_size + * Array containing maximum size of dataspace. + * + * @return a dataspace identifier if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sset_extent_simple(long space_id, int rank, long[] current_size, + long[] maximum_size) throws HDF5LibraryException, NullPointerException; + + /** + * H5Sset_extent_simple sets or resets the size of an existing dataspace. + * + * @param space_id + * Dataspace identifier. + * @param rank + * Rank, or dimensionality, of the dataspace. + * @param current_size + * Array containing current size of dataspace. + * @param maximum_size + * Array containing maximum size of dataspace. * - * @return a non-negative value if successful + * @return a dataspace identifier if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public static int H5Sclose(long space_id) throws HDF5LibraryException { - if (space_id < 0) - return 0; // throw new HDF5LibraryException("Negative ID");; + public synchronized static long H5Sset_extent_simple(long space_id, int rank, byte[] current_size, + byte[] maximum_size) throws HDF5LibraryException, NullPointerException { + ByteBuffer csbb = ByteBuffer.wrap(current_size); + long[] lacs = (csbb.asLongBuffer()).array(); + ByteBuffer maxsbb = ByteBuffer.wrap(maximum_size); + long[] lamaxs = (maxsbb.asLongBuffer()).array(); - log.trace("OPEN_IDS: H5Sclose remove {}", space_id); - OPEN_IDS.remove(space_id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - return _H5Sclose(space_id); + return H5Sset_extent_simple(space_id, rank, lacs, lamaxs); } - private synchronized static native int _H5Sclose(long space_id) throws HDF5LibraryException; - /** * H5Scopy creates a new dataspace which is an exact copy of the dataspace identified by space_id. * @@ -8332,58 +10653,40 @@ public class H5 implements java.io.Serializable { private synchronized static native long _H5Scopy(long space_id) throws HDF5LibraryException; /** - * H5Screate creates a new dataspace of a particular type. + * H5Sclose releases a dataspace. * - * @param type - * IN: The type of dataspace to be created. + * @param space_id + * Identifier of dataspace to release. * - * @return a dataspace identifier + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public static long H5Screate(int type) throws HDF5LibraryException { - long id = _H5Screate(type); - if (id > 0) { - log.trace("OPEN_IDS: H5Screate add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; + public static int H5Sclose(long space_id) throws HDF5LibraryException { + if (space_id < 0) + return 0; // throw new HDF5LibraryException("Negative ID");; + + log.trace("OPEN_IDS: H5Sclose remove {}", space_id); + OPEN_IDS.remove(space_id); + log.trace("OPEN_IDS: {}", OPEN_IDS.size()); + return _H5Sclose(space_id); } - private synchronized static native long _H5Screate(int type) throws HDF5LibraryException; + private synchronized static native int _H5Sclose(long space_id) throws HDF5LibraryException; /** - * H5Screate_simple creates a new simple data space and opens it for access. + * H5Sencode converts a data space description into binary form in a buffer. * - * @param rank - * IN: Number of dimensions of dataspace. - * @param dims - * IN: An array of the size of each dimension. - * @param maxdims - * IN: An array of the maximum size of each dimension. + * @param obj_id + * IN: Identifier of the object to be encoded. * - * @return a dataspace identifier + * @return the buffer for the object to be encoded into. * - * @exception HDF5Exception + * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - dims or maxdims is null. **/ - public static long H5Screate_simple(int rank, long[] dims, long[] maxdims) throws HDF5Exception, - NullPointerException { - long id = _H5Screate_simple(rank, dims, maxdims); - if (id > 0) { - log.trace("OPEN_IDS: H5Screate_simple add {}", id); - OPEN_IDS.add(id); - log.trace("OPEN_IDS: {}", OPEN_IDS.size()); - } - return id; - } - - private synchronized static native long _H5Screate_simple(int rank, long[] dims, long[] maxdims) - throws HDF5Exception, NullPointerException; + public synchronized static native byte[] H5Sencode(long obj_id) throws HDF5LibraryException, NullPointerException; /** * H5Sdecode reconstructs the HDF5 data space object and returns a new object handle for it. @@ -8401,154 +10704,137 @@ public class H5 implements java.io.Serializable { public synchronized static native long H5Sdecode(byte[] buf) throws HDF5LibraryException, NullPointerException; /** - * H5Sencode converts a data space description into binary form in a buffer. + * H5Sget_simple_extent_npoints determines the number of elements in a dataspace. * - * @param obj_id - * IN: Identifier of the object to be encoded. + * @param space_id + * ID of the dataspace object to query + * @return the number of elements in the dataspace if successful * - * @return the buffer for the object to be encoded into. + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sget_simple_extent_npoints(long space_id) throws HDF5LibraryException; + + /** + * H5Sget_simple_extent_ndims determines the dimensionality (or rank) of a dataspace. + * + * @param space_id + * IN: Identifier of the dataspace + * + * @return the number of dimensions in the dataspace if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native byte[] H5Sencode(long obj_id) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Sget_simple_extent_ndims(long space_id) throws HDF5LibraryException; /** - * H5Sextent_copy copies the extent from source_space_id to dest_space_id. This action may change the type of the - * dataspace. + * H5Sget_simple_extent_dims returns the size and maximum sizes of each dimension of a dataspace through the dims + * and maxdims parameters. * - * @param dest_space_id - * IN: The identifier for the dataspace from which the extent is copied. - * @param source_space_id - * IN: The identifier for the dataspace to which the extent is copied. + * @param space_id + * IN: Identifier of the dataspace object to query + * @param dims + * OUT: Pointer to array to store the size of each dimension. + * @param maxdims + * OUT: Pointer to array to store the maximum size of each dimension. * - * @return a non-negative value if successful + * @return the number of dimensions in the dataspace if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - dims or maxdims is null. **/ - public synchronized static native int H5Sextent_copy(long dest_space_id, long source_space_id) - throws HDF5LibraryException; + public synchronized static native int H5Sget_simple_extent_dims(long space_id, long[] dims, long[] maxdims) + throws HDF5LibraryException, NullPointerException; /** - * H5Sextent_equal determines whether the dataspace extents of two dataspaces, space1_id and space2_id, are equal. + * H5Sis_simple determines whether a dataspace is a simple dataspace. * - * @param first_space_id - * IN: The identifier for the first dataspace. - * @param second_space_id - * IN: The identifier for the seconddataspace. + * @param space_id + * Identifier of the dataspace to query * - * @return true if successful, else false + * @return true if is a simple dataspace * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native boolean H5Sextent_equal(long first_space_id, long second_space_id) - throws HDF5LibraryException; + public synchronized static native boolean H5Sis_simple(long space_id) throws HDF5LibraryException; /** - * H5Sget_select_bounds retrieves the coordinates of the bounding box containing the current selection and places - * them into user-supplied buffers. - *

- * The start and end buffers must be large enough to hold the dataspace rank number of coordinates. + * H5Sget_simple_extent_type queries a dataspace to determine the current class of a dataspace. * - * @param spaceid - * Identifier of dataspace to release. - * @param start - * coordinates of lowest corner of bounding box. - * @param end - * coordinates of highest corner of bounding box. + * @param space_id + * Dataspace identifier. * - * @return a non-negative value if successful,with start and end initialized. + * @return a dataspace class name if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - start or end is null. **/ - public synchronized static native int H5Sget_select_bounds(long spaceid, long[] start, long[] end) - throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Sget_simple_extent_type(long space_id) throws HDF5LibraryException; /** - * H5Sget_select_elem_npoints returns the number of element points in the current dataspace selection. + * H5Sset_extent_none removes the extent from a dataspace and sets the type to H5S_NONE. * - * @param spaceid - * Identifier of dataspace to release. + * @param space_id + * The identifier for the dataspace from which the extent is to be removed. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native long H5Sget_select_elem_npoints(long spaceid) throws HDF5LibraryException; + public synchronized static native int H5Sset_extent_none(long space_id) throws HDF5LibraryException; /** - * H5Sget_select_elem_pointlist returns an array of of element points in the current dataspace selection. The point - * coordinates have the same dimensionality (rank) as the dataspace they are located within, one coordinate per - * point. + * H5Sextent_copy copies the extent from source_space_id to dest_space_id. This action may change the type of the + * dataspace. * - * @param spaceid - * Identifier of dataspace to release. - * @param startpoint - * first point to retrieve - * @param numpoints - * number of points to retrieve - * @param buf - * returns points startblock to startblock+num-1, each points is rank longs. + * @param dest_space_id + * IN: The identifier for the dataspace from which the extent is copied. + * @param source_space_id + * IN: The identifier for the dataspace to which the extent is copied. * * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - buf is null. **/ - public synchronized static native int H5Sget_select_elem_pointlist(long spaceid, long startpoint, long numpoints, - long[] buf) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Sextent_copy(long dest_space_id, long source_space_id) + throws HDF5LibraryException; /** - * H5Sget_select_hyper_blocklist returns an array of hyperslab blocks. The block coordinates have the same - * dimensionality (rank) as the dataspace they are located within. The list of blocks is formatted as follows: - * - *

-     *    <"start" coordinate>, immediately followed by
-     *    <"opposite" corner coordinate>, followed by
-     *   the next "start" and "opposite" coordinates,
-     *   etc.
-     *   until all of the selected blocks have been listed.
-     * 
+ * H5Sextent_equal determines whether the dataspace extents of two dataspaces, space1_id and space2_id, are equal. * - * @param spaceid - * Identifier of dataspace to release. - * @param startblock - * first block to retrieve - * @param numblocks - * number of blocks to retrieve - * @param buf - * returns blocks startblock to startblock+num-1, each block is rank * 2 (corners) longs. + * @param first_space_id + * IN: The identifier for the first dataspace. + * @param second_space_id + * IN: The identifier for the seconddataspace. * - * @return a non-negative value if successful + * @return true if successful, else false * * @exception HDF5LibraryException * - Error from the HDF-5 Library. - * @exception NullPointerException - * - buf is null. **/ - public synchronized static native int H5Sget_select_hyper_blocklist(long spaceid, long startblock, long numblocks, - long[] buf) throws HDF5LibraryException, NullPointerException; + public synchronized static native boolean H5Sextent_equal(long first_space_id, long second_space_id) + throws HDF5LibraryException; + + /***************** Operations on dataspace selections *****************/ /** - * H5Sget_select_hyper_nblocks returns the number of hyperslab blocks in the current dataspace selection. + * H5Sget_select_type retrieves the type of selection currently defined for the dataspace space_id. * - * @param spaceid - * Identifier of dataspace to release. + * @param space_id + * IN: Identifier of the dataspace object to query * - * @return a non-negative value if successful + * @return the dataspace selection type if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native long H5Sget_select_hyper_nblocks(long spaceid) throws HDF5LibraryException; + public synchronized static native int H5Sget_select_type(long space_id) throws HDF5LibraryException; /** * H5Sget_select_npoints determines the number of elements in the current selection of a dataspace. @@ -8564,89 +10850,123 @@ public class H5 implements java.io.Serializable { public synchronized static native long H5Sget_select_npoints(long space_id) throws HDF5LibraryException; /** - * H5Sget_select_type retrieves the type of selection currently defined for the dataspace space_id. + * H5Sselect_copy copies all the selection information (including offset) from the source + * dataspace to the destination dataspace. + * @param dst_id ID of the destination dataspace + * @param src_id ID of the source dataspace + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5Sselect_copy(long dst_id, long src_id) throws HDF5LibraryException; + + /** + * H5Sselect_valid verifies that the selection for the dataspace. * * @param space_id - * IN: Identifier of the dataspace object to query + * The identifier for the dataspace in which the selection is being reset. * - * @return the dataspace selection type if successful + * @return true if the selection is contained within the extent and FALSE if it is not or is an error. * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native int H5Sget_select_type(long space_id) throws HDF5LibraryException; + public synchronized static native boolean H5Sselect_valid(long space_id) throws HDF5LibraryException; /** - * H5Sget_simple_extent_dims returns the size and maximum sizes of each dimension of a dataspace through the dims - * and maxdims parameters. + * H5Sselect_adjust moves a selection by subtracting an offset from it. * * @param space_id - * IN: Identifier of the dataspace object to query - * @param dims - * OUT: Pointer to array to store the size of each dimension. - * @param maxdims - * OUT: Pointer to array to store the maximum size of each dimension. - * - * @return the number of dimensions in the dataspace if successful + * ID of dataspace to adjust + * @param offset + * Offset to subtract * * @exception HDF5LibraryException * - Error from the HDF-5 Library. * @exception NullPointerException - * - dims or maxdims is null. + * - offset is null. **/ - public synchronized static native int H5Sget_simple_extent_dims(long space_id, long[] dims, long[] maxdims) - throws HDF5LibraryException, NullPointerException; + public synchronized static native void H5Sselect_adjust(long space_id, long[][] offset) + throws HDF5LibraryException, NullPointerException; /** - * H5Sget_simple_extent_ndims determines the dimensionality (or rank) of a dataspace. + * H5Sget_select_bounds retrieves the coordinates of the bounding box containing the current selection and places + * them into user-supplied buffers. + *

+ * The start and end buffers must be large enough to hold the dataspace rank number of coordinates. * * @param space_id - * IN: Identifier of the dataspace + * Identifier of dataspace to release. + * @param start + * coordinates of lowest corner of bounding box. + * @param end + * coordinates of highest corner of bounding box. * - * @return the number of dimensions in the dataspace if successful + * @return a non-negative value if successful,with start and end initialized. * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - start or end is null. **/ - public synchronized static native int H5Sget_simple_extent_ndims(long space_id) throws HDF5LibraryException; + public synchronized static native int H5Sget_select_bounds(long space_id, long[] start, long[] end) + throws HDF5LibraryException, NullPointerException; /** - * H5Sget_simple_extent_npoints determines the number of elements in a dataspace. + * H5Sselect_shape_same checks to see if the current selection in the dataspaces are the same + * dimensionality and shape. + * This is primarily used for reading the entire selection in one swoop. * - * @param space_id - * ID of the dataspace object to query - * @return the number of elements in the dataspace if successful + * @param space1_id ID of 1st Dataspace pointer to compare + * @param space2_id ID of 2nd Dataspace pointer to compare + * + * @return true if the selection is the same dimensionality and shape; + * false otherwise * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native long H5Sget_simple_extent_npoints(long space_id) throws HDF5LibraryException; + public synchronized static native boolean H5Sselect_shape_same(long space1_id, long space2_id) throws HDF5LibraryException; /** - * H5Sget_simple_extent_type queries a dataspace to determine the current class of a dataspace. + * H5Sselect_intersect_block checks to see if the current selection in the + * dataspace intersects with the block given. * * @param space_id - * Dataspace identifier. + * ID of dataspace pointer to compare + * @param start + * Starting coordinate of block + * @param end + * Opposite ("ending") coordinate of block * - * @return a dataspace class name if successful + * @return a TRUE if the current selection in the dataspace intersects with the block given + * FALSE otherwise * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - offset is null. **/ - public synchronized static native int H5Sget_simple_extent_type(long space_id) throws HDF5LibraryException; + public synchronized static native boolean H5Sselect_intersect_block(long space_id, long[] start, long[] end) + throws HDF5LibraryException, NullPointerException; /** - * H5Sis_simple determines whether a dataspace is a simple dataspace. + * H5Soffset_simple sets the offset of a simple dataspace space_id. * * @param space_id - * Identifier of the dataspace to query + * IN: The identifier for the dataspace object to reset. + * @param offset + * IN: The offset at which to position the selection. * - * @return true if is a simple dataspace + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - offset array is null. **/ - public synchronized static native boolean H5Sis_simple(long space_id) throws HDF5LibraryException; + public synchronized static native int H5Soffset_simple(long space_id, byte[] offset) throws HDF5LibraryException, + NullPointerException; /** * H5Soffset_simple sets the offset of a simple dataspace space_id. @@ -8663,9 +10983,6 @@ public class H5 implements java.io.Serializable { * @exception NullPointerException * - offset array is null. **/ - public synchronized static native int H5Soffset_simple(long space_id, byte[] offset) throws HDF5LibraryException, - NullPointerException; - public synchronized static int H5Soffset_simple(long space_id, long[] offset) throws HDF5Exception, NullPointerException { if (offset == null) { @@ -8696,6 +11013,18 @@ public class H5 implements java.io.Serializable { public synchronized static native int H5Sselect_all(long space_id) throws HDF5LibraryException; /** + * H5Sselect_none resets the selection region for the dataspace space_id to include no elements. + * + * @param space_id + * IN: The identifier of the dataspace to be reset. + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Sselect_none(long space_id) throws HDF5LibraryException; + + /** * H5Sselect_elements selects array elements to be included in the selection for the space_id dataspace. * * @param space_id @@ -8753,6 +11082,43 @@ public class H5 implements java.io.Serializable { } /** + * H5Sget_select_elem_npoints returns the number of element points in the current dataspace selection. + * + * @param spaceid + * Identifier of dataspace to release. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sget_select_elem_npoints(long spaceid) throws HDF5LibraryException; + + /** + * H5Sget_select_elem_pointlist returns an array of of element points in the current dataspace selection. The point + * coordinates have the same dimensionality (rank) as the dataspace they are located within, one coordinate per + * point. + * + * @param spaceid + * Identifier of dataspace to release. + * @param startpoint + * first point to retrieve + * @param numpoints + * number of points to retrieve + * @param buf + * returns points startblock to startblock+num-1, each points is rank longs. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. + **/ + public synchronized static native int H5Sget_select_elem_pointlist(long spaceid, long startpoint, long numpoints, + long[] buf) throws HDF5LibraryException, NullPointerException; + + /** * H5Sselect_hyperslab selects a hyperslab region to add to the current selected region for the dataspace specified * by space_id. The start, stride, count, and block arrays must be the same size as the rank of the dataspace. * @@ -8792,76 +11158,118 @@ public class H5 implements java.io.Serializable { return H5Sselect_hyperslab(space_id, op, lastart, lastride, lacount, lablock); } - public synchronized static native int H5Sselect_hyperslab(long space_id, int op, long[] start, long[] stride, - long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; - /** - * H5Sselect_none resets the selection region for the dataspace space_id to include no elements. + * H5Sselect_hyperslab selects a hyperslab region to add to the current selected region for the dataspace specified + * by space_id. The start, stride, count, and block arrays must be the same size as the rank of the dataspace. * * @param space_id - * IN: The identifier of the dataspace to be reset. + * IN: Identifier of dataspace selection to modify + * @param op + * IN: Operation to perform on current selection. + * @param start + * IN: Offset of start of hyperslab + * @param stride + * IN: Hyperslab stride. + * @param count + * IN: Number of blocks included in hyperslab. + * @param block + * IN: Size of block in hyperslab. + * * @return a non-negative value 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 int H5Sselect_none(long space_id) throws HDF5LibraryException; + public synchronized static native int H5Sselect_hyperslab(long space_id, int op, long[] start, long[] stride, + long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + /** - * H5Sselect_valid verifies that the selection for the dataspace. + * H5Scombine_hyperslab combines a hyperslab selection with the current selection for a dataspace, + * creating a new dataspace to return the generated selection. + * If the current selection is not a hyperslab, it is freed and the hyperslab + * parameters passed in are combined with the H5S_SEL_ALL hyperslab (ie. a + * selection composing the entire current extent). If STRIDE or BLOCK is + * NULL, they are assumed to be set to all '1'. * * @param space_id - * The identifier for the dataspace in which the selection is being reset. + * IN: Dataspace ID of selection to use + * @param op + * IN: Operation to perform on current selection. + * @param start + * IN: Offset of start of hyperslab + * @param stride + * IN: Hyperslab stride. + * @param count + * IN: Number of blocks included in hyperslab. + * @param block + * IN: Size of block in hyperslab. * - * @return true if the selection is contained within the extent and FALSE if it is not or is an error. + * @return a dataspace ID on success / H5I_INVALID_HID on failure + * + * @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 H5Scombine_hyperslab(long space_id, int op, long[] start, long[] stride, + long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + + /** + * H5Smodify_select refine an existing hyperslab selection with an operation, using a second + * hyperslab. The first selection is modified to contain the result of + * space1 operated on by space2. + * + * @param space1_id + * ID of the destination dataspace + * @param op + * Operation to perform on current selection. + * @param space2_id + * ID of the source dataspace * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native boolean H5Sselect_valid(long space_id) throws HDF5LibraryException; + public synchronized static native void H5Smodify_select(long space1_id, int op, long space2_id) throws HDF5LibraryException; /** - * H5Sset_extent_none removes the extent from a dataspace and sets the type to H5S_NONE. + * H5Scombine_select combines two existing hyperslab selections with an operation, returning + * a new dataspace with the resulting selection. The dataspace extent from + * space1 is copied for the dataspace extent of the newly created dataspace. * - * @param space_id - * The identifier for the dataspace from which the extent is to be removed. + * @param space1_id + * ID of the first dataspace + * @param op + * Operation to perform on current selection. + * @param space2_id + * ID of the second dataspace * - * @return a non-negative value if successful + * @return a dataspace ID on success / H5I_INVALID_HID on failure * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native int H5Sset_extent_none(long space_id) throws HDF5LibraryException; + public synchronized static native long H5Scombine_select(long space1_id, int op, long space2_id) throws HDF5LibraryException; /** - * H5Sset_extent_simple sets or resets the size of an existing dataspace. + * H5Sis_regular_hyperslab retrieves a regular hyperslab selection for the dataspace specified + * by space_id. * * @param space_id - * Dataspace identifier. - * @param rank - * Rank, or dimensionality, of the dataspace. - * @param current_size - * Array containing current size of dataspace. - * @param maximum_size - * Array containing maximum size of dataspace. + * IN: Identifier of dataspace selection to query * - * @return a dataspace identifier if successful + * @return a TRUE/FALSE for hyperslab selection if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ - public synchronized static native long H5Sset_extent_simple(long space_id, int rank, long[] current_size, - long[] maximum_size) throws HDF5LibraryException, NullPointerException; - - public synchronized static long H5Sset_extent_simple(long space_id, int rank, byte[] current_size, - byte[] maximum_size) throws HDF5LibraryException, NullPointerException { - ByteBuffer csbb = ByteBuffer.wrap(current_size); - long[] lacs = (csbb.asLongBuffer()).array(); - ByteBuffer maxsbb = ByteBuffer.wrap(maximum_size); - long[] lamaxs = (maxsbb.asLongBuffer()).array(); - - return H5Sset_extent_simple(space_id, rank, lacs, lamaxs); - } + public synchronized static native boolean H5Sis_regular_hyperslab(long space_id) throws HDF5LibraryException; /** * H5Sget_regular_hyperslab determines if a hyperslab selection is regular for the dataspace specified @@ -8887,32 +11295,71 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native void H5Sget_regular_hyperslab(long space_id, long[] start, long[] stride, long[] count, long[] block) throws HDF5LibraryException, NullPointerException, IllegalArgumentException; + /** + * H5Sget_select_hyper_nblocks returns the number of hyperslab blocks in the current dataspace selection. + * + * @param spaceid + * Identifier of dataspace to release. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sget_select_hyper_nblocks(long spaceid) throws HDF5LibraryException; + /** - * H5Sis_regular_hyperslab retrieves a regular hyperslab selection for the dataspace specified - * by space_id. + * H5Sget_select_hyper_blocklist returns an array of hyperslab blocks. The block coordinates have the same + * dimensionality (rank) as the dataspace they are located within. The list of blocks is formatted as follows: * - * @param space_id - * IN: Identifier of dataspace selection to query + *

+     *    <"start" coordinate>, immediately followed by
+     *    <"opposite" corner coordinate>, followed by
+     *   the next "start" and "opposite" coordinates,
+     *   etc.
+     *   until all of the selected blocks have been listed.
+     * 
* - * @return a TRUE/FALSE for hyperslab selection if successful + * @param spaceid + * Identifier of dataspace to release. + * @param startblock + * first block to retrieve + * @param numblocks + * number of blocks to retrieve + * @param buf + * returns blocks startblock to startblock+num-1, each block is rank * 2 (corners) longs. + * + * @return a non-negative value if successful * * @exception HDF5LibraryException * - Error from the HDF-5 Library. + * @exception NullPointerException + * - buf is null. **/ - public synchronized static native boolean H5Sis_regular_hyperslab(long space_id) throws HDF5LibraryException; + public synchronized static native int H5Sget_select_hyper_blocklist(long spaceid, long startblock, long numblocks, + long[] buf) throws HDF5LibraryException, NullPointerException; + + /** + * H5Sselect_project_intersection projects the intersection of the selections of src_space_id and + * src_intersect_space_id within the selection of src_space_id as a + * selection within the selection of dst_space_id. + * + * @param src_space_id + * Selection that is mapped to dst_space_id, and intersected with src_intersect_space_id + * @param dst_space_id + * Selection that is mapped to src_space_id + * @param src_intersect_space_id + * Selection whose intersection with src_space_id is projected to dst_space_id to obtain the result + * + * @return a dataspace with a selection equal to the intersection of + * src_intersect_space_id and src_space_id projected from src_space to dst_space on success + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native long H5Sselect_project_intersection(long src_space_id, long dst_space_id, + long src_intersect_space_id) throws HDF5LibraryException; - // /////// unimplemented //////// - // #ifdef NEW_HYPERSLAB_API - // 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[]); - // herr_t H5Sselect_select(hid_t space1_id, H5S_seloper_t op, - // hid_t space2_id); - // hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op, - // hid_t space2_id); - // #endif /* NEW_HYPERSLAB_API */ @@ -9260,6 +11707,23 @@ public class H5 implements java.io.Serializable { return H5Tenum_insert_int(type, name, value); } + /** + * H5Tenum_insert inserts a new enumeration datatype member into an enumeration datatype. + * + * @param type + * IN: Identifier of datatype. + * @param name + * IN: The name of the member + * @param value + * IN: The value of the member, data of the correct type + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + * @exception NullPointerException + * - name is null. + **/ public static int H5Tenum_insert(long type, String name, int value) throws HDF5LibraryException, NullPointerException { int[] val = { value }; @@ -10395,11 +12859,44 @@ public class H5 implements java.io.Serializable { // // // //////////////////////////////////////////////////////////// - public synchronized static native int H5Zfilter_avail(int filter) throws HDF5LibraryException, NullPointerException; + /** + * H5Zfilter_avail checks if a filter is available. + * + * @param filter + * IN: filter number. + * + * @return a non-negative(TRUE/FALSE) value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Zfilter_avail(int filter) throws HDF5LibraryException; + /** + * H5Zget_filter_info gets information about a pipeline data filter. + * + * @param filter + * IN: filter number. + * + * @return the filter information flags + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ public synchronized static native int H5Zget_filter_info(int filter) throws HDF5LibraryException; - public synchronized static native int H5Zunregister(int filter) throws HDF5LibraryException, NullPointerException; + /** + * H5Zunregister unregisters a filter. + * + * @param filter + * IN: filter number. + * + * @return a non-negative value if successful + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5Zunregister(int filter) throws HDF5LibraryException; // /////// unimplemented //////// diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 3f8e5d1..42b103d 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -35,10 +35,15 @@ public class HDF5Constants { public static final long H5_QUARTER_HADDR_MAX = H5_QUARTER_HADDR_MAX(); + /** Special parameters for szip compression */ public static final int H5_SZIP_MAX_PIXELS_PER_BLOCK = H5_SZIP_MAX_PIXELS_PER_BLOCK(); + /** Special parameters for szip compression */ public static final int H5_SZIP_NN_OPTION_MASK = H5_SZIP_NN_OPTION_MASK(); + /** Special parameters for szip compression */ public static final int H5_SZIP_EC_OPTION_MASK = H5_SZIP_EC_OPTION_MASK(); + /** Special parameters for szip compression */ public static final int H5_SZIP_ALLOW_K13_OPTION_MASK = H5_SZIP_ALLOW_K13_OPTION_MASK(); + /** Special parameters for szip compression */ public static final int H5_SZIP_CHIP_OPTION_MASK = H5_SZIP_CHIP_OPTION_MASK(); public static final int H5_INDEX_UNKNOWN = H5_INDEX_UNKNOWN(); public static final int H5_INDEX_NAME = H5_INDEX_NAME(); @@ -90,108 +95,353 @@ public class HDF5Constants { public static final int H5D_VDS_LAST_AVAILABLE = H5D_VDS_LAST_AVAILABLE(); public static final int H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS = H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS(); + /** Different kinds of error information - H5E_type_t */ public static final int H5E_MAJOR = H5E_MAJOR(); + /** Different kinds of error information - H5E_type_t */ public static final int H5E_MINOR = H5E_MINOR(); + /** Minor error codes - Object header related errors - Alignment error */ public static final long H5E_ALIGNMENT = H5E_ALIGNMENT(); + /** Minor error codes - Resource errors - Object already exists */ public static final long H5E_ALREADYEXISTS = H5E_ALREADYEXISTS(); + /** Minor error codes - Function entry/exit interface - Object already initialized */ public static final long H5E_ALREADYINIT = H5E_ALREADYINIT(); + /** Major error codes - Invalid arguments to routine */ public static final long H5E_ARGS = H5E_ARGS(); + /** Major error codes - Object atom */ public static final long H5E_ATOM = H5E_ATOM(); + /** Major error codes - Attribute */ public static final long H5E_ATTR = H5E_ATTR(); + /** Minor error codes - Object atom related errors - Unable to find atom information (already closed?) */ public static final long H5E_BADATOM = H5E_BADATOM(); + /** Minor error codes - File accessibility errors - Bad file ID accessed */ public static final long H5E_BADFILE = H5E_BADFILE(); + /** Minor error codes - Object atom related errors - Unable to find ID group information */ public static final long H5E_BADGROUP = H5E_BADGROUP(); + /** Minor error codes - Object header related errors - Iteration failed */ + public static final long H5E_BADITER = H5E_BADITER(); + /** Minor error codes - Object header related errors - Unrecognized message */ public static final long H5E_BADMESG = H5E_BADMESG(); + /** Minor error codes - Argument errors - Out of range */ public static final long H5E_BADRANGE = H5E_BADRANGE(); + /** Minor error codes - Dataspace errors - Invalid selection */ public static final long H5E_BADSELECT = H5E_BADSELECT(); + /** Datatype conversion errors - Bad size for object */ public static final long H5E_BADSIZE = H5E_BADSIZE(); + /** Minor error codes - Argument errors - Inappropriate type */ public static final long H5E_BADTYPE = H5E_BADTYPE(); + /** Minor error codes - Argument errors - Bad value */ public static final long H5E_BADVALUE = H5E_BADVALUE(); + /** Major error codes - B-Tree node */ public static final long H5E_BTREE = H5E_BTREE(); + /** Major error codes - Object cache */ public static final long H5E_CACHE = H5E_CACHE(); + /** I/O pipeline errors - Callback failed */ public static final long H5E_CALLBACK = H5E_CALLBACK(); + /** I/O pipeline errors - Error from filter 'can apply' callback */ public static final long H5E_CANAPPLY = H5E_CANAPPLY(); - // public static final long H5E_CANTALLOC = H5E_CANTALLOC(); + /** Minor error codes - Resource errors - Can't allocate space */ + public static final long H5E_CANTALLOC = H5E_CANTALLOC(); + /** Minor error codes - Dataspace errors - Can't append object */ + public static final long H5E_CANTAPPEND = H5E_CANTAPPEND(); + /** Minor error codes - Heap errors - Can't attach object */ + public static final long H5E_CANTATTACH = H5E_CANTATTACH(); + /** Minor error codes - Cache related errors - Unable to mark metadata as clean */ + public static final long H5E_CANTCLEAN = H5E_CANTCLEAN(); + /** Minor error codes - Dataspace errors - Can't clip hyperslab region */ public static final long H5E_CANTCLIP = H5E_CANTCLIP(); + /** Minor error codes - File accessibility errors - Unable to close file */ public static final long H5E_CANTCLOSEFILE = H5E_CANTCLOSEFILE(); + /** Minor error codes - Group related errors - Can't close object */ + public static final long H5E_CANTCLOSEOBJ = H5E_CANTCLOSEOBJ(); + /** Minor error codes - Dataspace errors - Can't compare objects */ + public static final long H5E_CANTCOMPARE = H5E_CANTCOMPARE(); + /** Minor error codes - Heap errors - Can't compute value */ + public static final long H5E_CANTCOMPUTE = H5E_CANTCOMPUTE(); + /** Datatype conversion errors - Can't convert datatypes */ public static final long H5E_CANTCONVERT = H5E_CANTCONVERT(); + /** Minor error codes - Resource errors - Unable to copy object */ public static final long H5E_CANTCOPY = H5E_CANTCOPY(); + /** Minor error codes - Cache related errors - Unable to cork an object */ + public static final long H5E_CANTCORK = H5E_CANTCORK(); + /** Minor error codes - Dataspace errors - Can't count elements */ public static final long H5E_CANTCOUNT = H5E_CANTCOUNT(); + /** Minor error codes - File accessibility errors - Unable to create file */ public static final long H5E_CANTCREATE = H5E_CANTCREATE(); + /** Minor error codes - Object atom related errors - Unable to decrement reference count */ public static final long H5E_CANTDEC = H5E_CANTDEC(); + /** Minor error codes - B-tree related errors - Unable to decode value */ public static final long H5E_CANTDECODE = H5E_CANTDECODE(); + /** Minor error codes - Object header related errors - Can't delete message */ public static final long H5E_CANTDELETE = H5E_CANTDELETE(); + /** Minor error codes - Cache related errors - Unable to create a flush dependency */ + public static final long H5E_CANTDEPEND = H5E_CANTDEPEND(); + /** Minor error codes - Cache related errors - Unable to mark metadata as dirty */ + public static final long H5E_CANTDIRTY = H5E_CANTDIRTY(); + /** Minor error codes - B-tree related errors - Unable to encode value */ public static final long H5E_CANTENCODE = H5E_CANTENCODE(); + /** Minor error codes - Cache related errors - Unable to expunge a metadata cache entry */ + public static final long H5E_CANTEXPUNGE = H5E_CANTEXPUNGE(); + /** Minor error codes - Heap errors - Can't extend heap's space */ + public static final long H5E_CANTEXTEND = H5E_CANTEXTEND(); + /** I/O pipeline errors - Filter operation failed */ + public static final long H5E_CANTFILTER = H5E_CANTFILTER(); + /** Minor error codes - Cache related errors - Unable to flush data from cache */ public static final long H5E_CANTFLUSH = H5E_CANTFLUSH(); + /** Minor error codes - Resource errors - Unable to free object */ public static final long H5E_CANTFREE = H5E_CANTFREE(); + /** Minor error codes - Parallel MPI - Can't gather data */ + public static final long H5E_CANTGATHER = H5E_CANTGATHER(); + /** Minor error codes - Resource errors - Unable to garbage collect */ + public static final long H5E_CANTGC = H5E_CANTGC(); + /** Minor error codes - Property list errors - Can't get value */ public static final long H5E_CANTGET = H5E_CANTGET(); + /** Minor error codes - Resource errors - Unable to compute size */ + public static final long H5E_CANTGETSIZE = H5E_CANTGETSIZE(); + /** Minor error codes - Object atom related errors - Unable to increment reference count */ public static final long H5E_CANTINC = H5E_CANTINC(); + /** Minor error codes - Function entry/exit interface - Unable to initialize object */ public static final long H5E_CANTINIT = H5E_CANTINIT(); + /** Minor error codes - Cache related errors - Unable to insert metadata into cache */ + public static final long H5E_CANTINS = H5E_CANTINS(); + /** Minor error codes - B-tree related errors - Unable to insert object */ public static final long H5E_CANTINSERT = H5E_CANTINSERT(); + /** Minor error codes - B-tree related errors - Unable to list node */ public static final long H5E_CANTLIST = H5E_CANTLIST(); + /** Minor error codes - Cache related errors - Unable to load metadata into cache */ public static final long H5E_CANTLOAD = H5E_CANTLOAD(); + /** Minor error codes - Resource errors - Unable to lock object */ public static final long H5E_CANTLOCK = H5E_CANTLOCK(); + /** Minor error codes - File accessibility errors Unable to lock file */ + public static final long H5E_CANTLOCKFILE = H5E_CANTLOCKFILE(); + /** Minor error codes - Cache related errors - Unable to mark a pinned entry as clean */ + public static final long H5E_CANTMARKCLEAN = H5E_CANTMARKCLEAN(); + /** Minor error codes - Cache related errors - Unable to mark a pinned entry as dirty */ + public static final long H5E_CANTMARKDIRTY = H5E_CANTMARKDIRTY(); + /** Minor error codes - Cache related errors - Unable to mark an entry as unserialized */ + public static final long H5E_CANTMARKSERIALIZED = H5E_CANTMARKSERIALIZED(); + /** Minor error codes - Cache related errors - Unable to mark an entry as serialized */ + public static final long H5E_CANTMARKUNSERIALIZED = H5E_CANTMARKUNSERIALIZED(); + /** Minor error codes - Free space errors - Can't merge objects */ + public static final long H5E_CANTMERGE = H5E_CANTMERGE(); + /** Minor error codes - B-tree related errors - Unable to modify record */ + public static final long H5E_CANTMODIFY = H5E_CANTMODIFY(); + /** Minor error codes - Link related errors - Can't move object */ + public static final long H5E_CANTMOVE = H5E_CANTMOVE(); + /** Minor error codes - Dataspace errors - Can't move to next iterator location */ public static final long H5E_CANTNEXT = H5E_CANTNEXT(); + /** Minor error codes - Cache related errors - Unable to notify object about action */ + public static final long H5E_CANTNOTIFY = H5E_CANTNOTIFY(); + /** Minor error codes - File accessibility errors - Unable to open file */ public static final long H5E_CANTOPENFILE = H5E_CANTOPENFILE(); + /** Minor error codes - Group related errors - Can't open object */ public static final long H5E_CANTOPENOBJ = H5E_CANTOPENOBJ(); - // public static final long H5E_CANTRECV = H5E_CANTRECV(); + /** Minor error codes - Heap errors - Can't operate on object */ + public static final long H5E_CANTOPERATE = H5E_CANTOPERATE(); + /** Minor error codes - Object header related errors - Can't pack messages */ + public static final long H5E_CANTPACK = H5E_CANTPACK(); + /** Minor error codes - Cache related errors - Unable to pin cache entry */ + public static final long H5E_CANTPIN = H5E_CANTPIN(); + /** Minor error codes - Cache related errors - Unable to protect metadata */ + public static final long H5E_CANTPROTECT = H5E_CANTPROTECT(); + /** Minor error codes - Parallel MPI - Can't receive data */ + public static final long H5E_CANTRECV = H5E_CANTRECV(); + /** Minor error codes - B-tree related errors - Unable to redistribute records */ + public static final long H5E_CANTREDISTRIBUTE = H5E_CANTREDISTRIBUTE(); + /** Minor error codes - Object atom related errors - Unable to register new atom */ public static final long H5E_CANTREGISTER = H5E_CANTREGISTER(); + /** Minor error codes - Function entry/exit interface - Unable to release object */ public static final long H5E_CANTRELEASE = H5E_CANTRELEASE(); + /** Minor error codes - B-tree related errors - Unable to remove object */ + public static final long H5E_CANTREMOVE = H5E_CANTREMOVE(); + /** Minor error codes - Object header related errors - Unable to rename object */ + public static final long H5E_CANTRENAME = H5E_CANTRENAME(); + /** Minor error codes - Object header related errors - Can't reset object */ + public static final long H5E_CANTRESET = H5E_CANTRESET(); + /** Minor error codes - Cache related errors - Unable to resize a metadata cache entry */ + public static final long H5E_CANTRESIZE = H5E_CANTRESIZE(); + /** Minor error codes - Heap errors - Can't restore condition */ + public static final long H5E_CANTRESTORE = H5E_CANTRESTORE(); + /** Minor error codes - Free space errors - Can't revive object */ + public static final long H5E_CANTREVIVE = H5E_CANTREVIVE(); + /** Minor error codes - Free space errors - Can't shrink container */ + public static final long H5E_CANTSHRINK = H5E_CANTSHRINK(); + /** Minor error codes - Dataspace errors - Can't select hyperslab */ public static final long H5E_CANTSELECT = H5E_CANTSELECT(); + /** Minor error codes - Cache related errors - Unable to serialize data from cache */ + public static final long H5E_CANTSERIALIZE = H5E_CANTSERIALIZE(); + /** Minor error codes - Property list errors - Can't set value */ public static final long H5E_CANTSET = H5E_CANTSET(); + /** Minor error codes - Link related errors - Can't sort objects */ + public static final long H5E_CANTSORT = H5E_CANTSORT(); + /** Minor error codes - B-tree related errors - Unable to split node */ public static final long H5E_CANTSPLIT = H5E_CANTSPLIT(); + /** Minor error codes - B-tree related errors - Unable to swap records */ + public static final long H5E_CANTSWAP = H5E_CANTSWAP(); + /** Minor error codes - Cache related errors - Unable to tag metadata in the cache */ + public static final long H5E_CANTTAG = H5E_CANTTAG(); + /** Minor error codes - Cache related errors - Unable to uncork an object */ + public static final long H5E_CANTUNCORK = H5E_CANTUNCORK(); + /** Minor error codes - Cache related errors - Unable to destroy a flush dependency */ + public static final long H5E_CANTUNDEPEND = H5E_CANTUNDEPEND(); + /** Minor error codes - Resource errors - Unable to unlock object */ public static final long H5E_CANTUNLOCK = H5E_CANTUNLOCK(); + /** Minor error codes - File accessibility errors Unable to unlock file */ + public static final long H5E_CANTUNLOCKFILE = H5E_CANTUNLOCKFILE(); + /** Minor error codes - Cache related errors - Unable to un-pin cache entry */ + public static final long H5E_CANTUNPIN = H5E_CANTUNPIN(); + /** Minor error codes - Cache related errors - Unable to unprotect metadata */ + public static final long H5E_CANTUNPROTECT = H5E_CANTUNPROTECT(); + /** Minor error codes - Cache related errors - Unable to mark metadata as unserialized */ + public static final long H5E_CANTUNSERIALIZE = H5E_CANTUNSERIALIZE(); + /** Minor error codes - Heap errors - Can't update object */ + public static final long H5E_CANTUPDATE = H5E_CANTUPDATE(); + /** Generic low-level file I/O errors - Close failed */ public static final long H5E_CLOSEERROR = H5E_CLOSEERROR(); + /** Minor error codes - Group related errors - Name component is too long */ public static final long H5E_COMPLEN = H5E_COMPLEN(); + /** Major error codes - API Context */ + public static final long H5E_CONTEXT = H5E_CONTEXT(); + /** Major error codes - Dataset */ public static final long H5E_DATASET = H5E_DATASET(); + /** Major error codes - Dataspace */ public static final long H5E_DATASPACE = H5E_DATASPACE(); + /** Major error codes - Datatype */ public static final long H5E_DATATYPE = H5E_DATATYPE(); + /** Value for the default error stack */ public static final long H5E_DEFAULT = H5E_DEFAULT(); + /** Minor error codes - Property list errors - Duplicate class name in parent class */ public static final long H5E_DUPCLASS = H5E_DUPCLASS(); + /** Major error codes - Extensible Array */ + public static final long H5E_EARRAY = H5E_EARRAY(); + /** Major error codes - External file list */ public static final long H5E_EFL = H5E_EFL(); + /** Major error codes - Error API */ + public static final long H5E_ERROR = H5E_ERROR(); + /** Minor error codes - B-tree related errors - Object already exists */ public static final long H5E_EXISTS = H5E_EXISTS(); + /** Major error codes - Fixed Array */ + public static final long H5E_FARRAY = H5E_FARRAY(); + /** Generic low-level file I/O errors - File control (fcntl) failed */ public static final long H5E_FCNTL = H5E_FCNTL(); + /** Major error codes - File accessibility */ public static final long H5E_FILE = H5E_FILE(); + /** Minor error codes - File accessibility errors - File already exists */ public static final long H5E_FILEEXISTS = H5E_FILEEXISTS(); + /** Minor error codes - File accessibility errors - File already open */ public static final long H5E_FILEOPEN = H5E_FILEOPEN(); + /** Major error codes - Free Space Manager */ + public static final long H5E_FSPACE = H5E_FSPACE(); + /** Major error codes - Function entry/exit */ public static final long H5E_FUNC = H5E_FUNC(); + /** Major error codes - Heap */ public static final long H5E_HEAP = H5E_HEAP(); + /** Minor error codes - Dataspace errors - Internal states are inconsistent */ + public static final long H5E_INCONSISTENTSTATE = H5E_INCONSISTENTSTATE(); + /** Major error codes - Internal error (too specific to document in detail) */ public static final long H5E_INTERNAL = H5E_INTERNAL(); + /** Major error codes - Low-level I/O */ public static final long H5E_IO = H5E_IO(); + /** Major error codes - Links */ public static final long H5E_LINK = H5E_LINK(); + /** Minor error codes - Object header related errors - Bad object header link count */ public static final long H5E_LINKCOUNT = H5E_LINKCOUNT(); + /** Minor error codes - Cache related errors - Failure in the cache logging framework */ + public static final long H5E_LOGGING = H5E_LOGGING(); + /** Minor error codes - File accessibility errors - File mount error */ public static final long H5E_MOUNT = H5E_MOUNT(); + /** Minor error codes - Parallel MPI - Some MPI function failed */ public static final long H5E_MPI = H5E_MPI(); + /** Minor error codes - Parallel MPI - MPI Error String */ public static final long H5E_MPIERRSTR = H5E_MPIERRSTR(); + /** Minor error codes - Link related errors - Too many soft links in path */ + public static final long H5E_NLINKS = H5E_NLINKS(); + /** Minor error codes - Parallel MPI - Can't perform independent IO */ + public static final long H5E_NO_INDEPENDENT = H5E_NO_INDEPENDENT(); + /** I/O pipeline errors - Filter present but encoding disabled */ + public static final long H5E_NOENCODER = H5E_NOENCODER(); + /** I/O pipeline errors - Requested filter is not available */ public static final long H5E_NOFILTER = H5E_NOFILTER(); + /** Minor error codes - Object atom related errors - Out of IDs for group */ public static final long H5E_NOIDS = H5E_NOIDS(); + /** Major error codes - No error */ public static final long H5E_NONE_MAJOR = H5E_NONE_MAJOR(); + /** No error */ public static final long H5E_NONE_MINOR = H5E_NONE_MINOR(); + /** Minor error codes - Resource errors - No space available for allocation */ public static final long H5E_NOSPACE = H5E_NOSPACE(); + /** Minor error codes - Cache related errors - Metadata not currently cached */ public static final long H5E_NOTCACHED = H5E_NOTCACHED(); + /** Minor error codes - B-tree related errors - Object not found */ public static final long H5E_NOTFOUND = H5E_NOTFOUND(); + /** Minor error codes - File accessibility errors - Not an HDF5 file */ public static final long H5E_NOTHDF5 = H5E_NOTHDF5(); + /** Minor error codes - Link related errors - Link class not registered */ + public static final long H5E_NOTREGISTERED = H5E_NOTREGISTERED(); + /** Minor error codes - Resource errors - Object is already open */ + public static final long H5E_OBJOPEN = H5E_OBJOPEN(); + /** Major error codes - Object header */ public static final long H5E_OHDR = H5E_OHDR(); + /** Minor error codes - Plugin errors - Can't open directory or file */ + public static final long H5E_OPENERROR = H5E_OPENERROR(); + /** Generic low-level file I/O errors - Address overflowed */ public static final long H5E_OVERFLOW = H5E_OVERFLOW(); + /** Major error codes - Page Buffering */ + public static final long H5E_PAGEBUF = H5E_PAGEBUF(); + /** Minor error codes - Group related errors - Problem with path to object */ + public static final long H5E_PATH = H5E_PATH(); + /** Major error codes - Data filters */ public static final long H5E_PLINE = H5E_PLINE(); + /** Major error codes - Property lists */ public static final long H5E_PLIST = H5E_PLIST(); + /** Major error codes - Plugin for dynamically loaded library */ + public static final long H5E_PLUGIN = H5E_PLUGIN(); + /** Minor error codes - Cache related errors - Protected metadata error */ public static final long H5E_PROTECT = H5E_PROTECT(); + /** Generic low-level file I/O errors - Read failed */ public static final long H5E_READERROR = H5E_READERROR(); + /** Major error codes - References */ public static final long H5E_REFERENCE = H5E_REFERENCE(); + /** Major error codes - Resource unavailable */ public static final long H5E_RESOURCE = H5E_RESOURCE(); + /** Major error codes - Reference Counted Strings */ public static final long H5E_RS = H5E_RS(); + /** Generic low-level file I/O errors - Seek failed */ public static final long H5E_SEEKERROR = H5E_SEEKERROR(); + /** Minor error codes - Property list errors - Disallowed operation */ + public static final long H5E_SETDISALLOWED = H5E_SETDISALLOWED(); + /** I/O pipeline errors - Error from filter 'set local' callback */ public static final long H5E_SETLOCAL = H5E_SETLOCAL(); + /** Major error codes - Skip Lists */ + public static final long H5E_SLIST = H5E_SLIST(); + /** Major error codes - Shared Object Header Messages */ + public static final long H5E_SOHM = H5E_SOHM(); + /** Major error codes - Data storage */ public static final long H5E_STORAGE = H5E_STORAGE(); + /** Major error codes - Symbol table */ public static final long H5E_SYM = H5E_SYM(); + /** Minor error codes - System level errors - System error message */ + public static final long H5E_SYSERRSTR = H5E_SYSERRSTR(); + /** Minor error codes - Cache related errors - Internal error detected */ + public static final long H5E_SYSTEM = H5E_SYSTEM(); + /** Minor error codes - Link related errors - Link traversal failure */ + public static final long H5E_TRAVERSE = H5E_TRAVERSE(); + /** Minor error codes - File accessibility errors - File has been truncated */ public static final long H5E_TRUNCATED = H5E_TRUNCATED(); + /** Major error codes - Ternary Search Trees */ public static final long H5E_TST = H5E_TST(); + /** Minor error codes - Argument errors - Information is uinitialized */ public static final long H5E_UNINITIALIZED = H5E_UNINITIALIZED(); + /** Minor error codes - Argument errors - Feature is unsupported */ public static final long H5E_UNSUPPORTED = H5E_UNSUPPORTED(); + /** Minor error codes - Object header related errors - Wrong version number */ public static final long H5E_VERSION = H5E_VERSION(); + /** Major error codes - Virtual File Layer */ public static final long H5E_VFL = H5E_VFL(); + /** Error stack traversal direction - begin at API function, end deep */ public static final long H5E_WALK_DOWNWARD = H5E_WALK_DOWNWARD(); + /** Error stack traversal direction - begin deep, end at API function */ public static final long H5E_WALK_UPWARD = H5E_WALK_UPWARD(); + /** Generic low-level file I/O errors - Write failed */ public static final long H5E_WRITEERROR = H5E_WRITEERROR(); public static final int H5F_ACC_CREAT = H5F_ACC_CREAT(); @@ -390,6 +640,7 @@ public class HDF5Constants { 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_NONE = H5PL_TYPE_NONE(); public static final int H5PL_FILTER_PLUGIN = H5PL_FILTER_PLUGIN(); public static final int H5PL_ALL_PLUGIN = H5PL_ALL_PLUGIN(); @@ -398,29 +649,54 @@ public class HDF5Constants { public static final int H5R_MAXTYPE = H5R_MAXTYPE(); public static final int H5R_OBJ_REF_BUF_SIZE = H5R_OBJ_REF_BUF_SIZE(); public static final int H5R_OBJECT = H5R_OBJECT(); + + /** Define atomic datatypes */ public static final int H5S_ALL = H5S_ALL(); + /** Define user-level maximum number of dimensions */ public static final int H5S_MAX_RANK = H5S_MAX_RANK(); + /** Different types of dataspaces - error */ public static final int H5S_NO_CLASS = H5S_NO_CLASS(); + /** Different types of dataspaces - null dataspace */ public static final int H5S_NULL = H5S_NULL(); + /** Different types of dataspaces - scalar variable */ public static final int H5S_SCALAR = H5S_SCALAR(); + /** Enumerated type for the type of selection - Entire extent selected */ public static final int H5S_SEL_ALL = H5S_SEL_ALL(); + /** Enumerated type for the type of selection - Error */ public static final int H5S_SEL_ERROR = H5S_SEL_ERROR(); + /** Enumerated type for the type of selection - Hyperslab selected */ public static final int H5S_SEL_HYPERSLABS = H5S_SEL_HYPERSLABS(); + /** Enumerated type for the type of selection - LAST */ public static final int H5S_SEL_N = H5S_SEL_N(); + /** Enumerated type for the type of selection - Nothing selected */ public static final int H5S_SEL_NONE = H5S_SEL_NONE(); + /** Enumerated type for the type of selection - Points / elements selected */ public static final int H5S_SEL_POINTS = H5S_SEL_POINTS(); + /** Different ways of combining selections - Binary "and" operation for hyperslabs */ public static final int H5S_SELECT_AND = H5S_SELECT_AND(); + /** Different ways of combining selections - Append elements to end of point selection */ public static final int H5S_SELECT_APPEND = H5S_SELECT_APPEND(); + /** Different ways of combining selections - Invalid upper bound on selection operations */ public static final int H5S_SELECT_INVALID = H5S_SELECT_INVALID(); + /** Different ways of combining selections - error */ public static final int H5S_SELECT_NOOP = H5S_SELECT_NOOP(); + /** Different ways of combining selections - Binary "not" operation for hyperslabs */ public static final int H5S_SELECT_NOTA = H5S_SELECT_NOTA(); + /** Different ways of combining selections - Binary "not" operation for hyperslabs */ public static final int H5S_SELECT_NOTB = H5S_SELECT_NOTB(); + /** Different ways of combining selections - Binary "or" operation for hyperslabs */ public static final int H5S_SELECT_OR = H5S_SELECT_OR(); + /** Different ways of combining selections - Prepend elements to beginning of point selection */ public static final int H5S_SELECT_PREPEND = H5S_SELECT_PREPEND(); + /** Different ways of combining selections - Select "set" operation */ public static final int H5S_SELECT_SET = H5S_SELECT_SET(); + /** Different ways of combining selections - Binary "xor" operation for hyperslabs */ public static final int H5S_SELECT_XOR = H5S_SELECT_XOR(); + /** Different types of dataspaces - simple dataspace */ public static final int H5S_SIMPLE = H5S_SIMPLE(); + /** Define atomic datatypes */ public static final int H5S_UNLIMITED = H5S_UNLIMITED(); + public static final long H5T_ALPHA_B16 = H5T_ALPHA_B16(); public static final long H5T_ALPHA_B32 = H5T_ALPHA_B32(); public static final long H5T_ALPHA_B64 = H5T_ALPHA_B64(); @@ -626,48 +902,97 @@ 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(); + + /** Return values for filter callback function */ public static final int H5Z_CB_CONT = H5Z_CB_CONT(); + /** Return values for filter callback function */ public static final int H5Z_CB_ERROR = H5Z_CB_ERROR(); + /** Return values for filter callback function */ public static final int H5Z_CB_FAIL = H5Z_CB_FAIL(); + /** Return values for filter callback function */ public static final int H5Z_CB_NO = H5Z_CB_NO(); + /** Values to decide if EDC is enabled for reading data */ public static final int H5Z_DISABLE_EDC = H5Z_DISABLE_EDC(); + /** Values to decide if EDC is enabled for reading data */ public static final int H5Z_ENABLE_EDC = H5Z_ENABLE_EDC(); + /** Values to decide if EDC is enabled for reading data */ public static final int H5Z_ERROR_EDC = H5Z_ERROR_EDC(); + /** Filter IDs - deflation like gzip */ public static final int H5Z_FILTER_DEFLATE = H5Z_FILTER_DEFLATE(); + /** Filter IDs - no filter */ public static final int H5Z_FILTER_ERROR = H5Z_FILTER_ERROR(); + /** Filter IDs - fletcher32 checksum of EDC */ public static final int H5Z_FILTER_FLETCHER32 = H5Z_FILTER_FLETCHER32(); + /** Filter IDs - maximum filter id */ public static final int H5Z_FILTER_MAX = H5Z_FILTER_MAX(); + /** Filter IDs - nbit compression */ public static final int H5Z_FILTER_NBIT = H5Z_FILTER_NBIT(); + /** Filter IDs - reserved indefinitely */ public static final int H5Z_FILTER_NONE = H5Z_FILTER_NONE(); + /** Filter IDs - filter ids below this value are reserved for library use */ public static final int H5Z_FILTER_RESERVED = H5Z_FILTER_RESERVED(); + /** Filter IDs - scale+offset compression */ public static final int H5Z_FILTER_SCALEOFFSET = H5Z_FILTER_SCALEOFFSET(); + /** Filter IDs - shuffle the data */ public static final int H5Z_FILTER_SHUFFLE = H5Z_FILTER_SHUFFLE(); + /** Filter IDs - szip compression */ public static final int H5Z_FILTER_SZIP = H5Z_FILTER_SZIP(); + /** Flags for filter definition (stored) + * definition flag mask */ public static final int H5Z_FLAG_DEFMASK = H5Z_FLAG_DEFMASK(); + /** Additional flags for filter invocation (not stored) + * invocation flag mask */ public static final int H5Z_FLAG_INVMASK = H5Z_FLAG_INVMASK(); + /** Flags for filter definition (stored) + * filter is mandatory */ public static final int H5Z_FLAG_MANDATORY = H5Z_FLAG_MANDATORY(); + /** Flags for filter definition (stored) + * filter is optional */ public static final int H5Z_FLAG_OPTIONAL = H5Z_FLAG_OPTIONAL(); + /** Additional flags for filter invocation (not stored) + * reverse direction; read */ public static final int H5Z_FLAG_REVERSE = H5Z_FLAG_REVERSE(); + /** Additional flags for filter invocation (not stored) + * skip EDC filters for read */ public static final int H5Z_FLAG_SKIP_EDC = H5Z_FLAG_SKIP_EDC(); + /** Symbol to remove all filters in H5Premove_filter */ + public static final int H5Z_FILTER_ALL = H5Z_FILTER_ALL(); + /** Maximum number of filters allowed in a pipeline */ public static final int H5Z_MAX_NFILTERS = H5Z_MAX_NFILTERS(); + /** Values to decide if EDC is enabled for reading data */ public static final int H5Z_NO_EDC = H5Z_NO_EDC(); + /** Bit flags for H5Zget_filter_info */ public static final int H5Z_FILTER_CONFIG_ENCODE_ENABLED = H5Z_FILTER_CONFIG_ENCODE_ENABLED(); + /** Bit flags for H5Zget_filter_info */ public static final int H5Z_FILTER_CONFIG_DECODE_ENABLED = H5Z_FILTER_CONFIG_DECODE_ENABLED(); + /** Special parameters for ScaleOffset filter*/ public static final int H5Z_SO_INT_MINBITS_DEFAULT = H5Z_SO_INT_MINBITS_DEFAULT(); + /** Special parameters for ScaleOffset filter*/ public static final int H5Z_SO_FLOAT_DSCALE = H5Z_SO_FLOAT_DSCALE(); + /** Special parameters for ScaleOffset filter*/ public static final int H5Z_SO_FLOAT_ESCALE = H5Z_SO_FLOAT_ESCALE(); + /** Special parameters for ScaleOffset filter*/ public static final int H5Z_SO_INT = H5Z_SO_INT(); + /** shuffle filter - Number of parameters that users can set */ public static final int H5Z_SHUFFLE_USER_NPARMS = H5Z_SHUFFLE_USER_NPARMS(); + /** shuffle filter - Total number of parameters for filter */ public static final int H5Z_SHUFFLE_TOTAL_NPARMS = H5Z_SHUFFLE_TOTAL_NPARMS(); + /** szip filter - Number of parameters that users can set */ public static final int H5Z_SZIP_USER_NPARMS = H5Z_SZIP_USER_NPARMS(); + /** szip filter - Total number of parameters for filter */ public static final int H5Z_SZIP_TOTAL_NPARMS = H5Z_SZIP_TOTAL_NPARMS(); + /** szip filter - "User" parameter for option mask */ public static final int H5Z_SZIP_PARM_MASK = H5Z_SZIP_PARM_MASK(); + /** szip filter - "User" parameter for pixels-per-block */ public static final int H5Z_SZIP_PARM_PPB = H5Z_SZIP_PARM_PPB(); + /** szip filter - "Local" parameter for bits-per-pixel */ public static final int H5Z_SZIP_PARM_BPP = H5Z_SZIP_PARM_BPP(); + /** szip filter - "Local" parameter for pixels-per-scanline */ public static final int H5Z_SZIP_PARM_PPS = H5Z_SZIP_PARM_PPS(); + /** nbit filter - Number of parameters that users can set */ public static final int H5Z_NBIT_USER_NPARMS = H5Z_NBIT_USER_NPARMS(); + /** scale offset filter - Number of parameters that users can set */ public static final int H5Z_SCALEOFFSET_USER_NPARMS = H5Z_SCALEOFFSET_USER_NPARMS(); - public static final int H5Z_FILTER_ALL = H5Z_FILTER_ALL(); // ///////////////////////////////////////////////////////////////////////// // List of private native variables to get constant values from C // @@ -802,6 +1127,8 @@ public class HDF5Constants { private static native final long H5E_BADGROUP(); + private static native final long H5E_BADITER(); + private static native final long H5E_BADMESG(); private static native final long H5E_BADRANGE(); @@ -822,15 +1149,30 @@ public class HDF5Constants { private static native final long H5E_CANAPPLY(); - // private static native final long H5E_CANTALLOC(); + private static native final long H5E_CANTALLOC(); + + private static native final long H5E_CANTAPPEND(); + + private static native final long H5E_CANTATTACH(); + + private static native final long H5E_CANTCLEAN(); + private static native final long H5E_CANTCLIP(); private static native final long H5E_CANTCLOSEFILE(); + private static native final long H5E_CANTCLOSEOBJ(); + + private static native final long H5E_CANTCOMPARE(); + + private static native final long H5E_CANTCOMPUTE(); + private static native final long H5E_CANTCONVERT(); private static native final long H5E_CANTCOPY(); + private static native final long H5E_CANTCORK(); + private static native final long H5E_CANTCOUNT(); private static native final long H5E_CANTCREATE(); @@ -841,18 +1183,36 @@ public class HDF5Constants { private static native final long H5E_CANTDELETE(); + private static native final long H5E_CANTDEPEND(); + + private static native final long H5E_CANTDIRTY(); + private static native final long H5E_CANTENCODE(); + private static native final long H5E_CANTEXPUNGE(); + + private static native final long H5E_CANTEXTEND(); + + private static native final long H5E_CANTFILTER(); + private static native final long H5E_CANTFLUSH(); private static native final long H5E_CANTFREE(); + private static native final long H5E_CANTGATHER(); + + private static native final long H5E_CANTGC(); + private static native final long H5E_CANTGET(); + private static native final long H5E_CANTGETSIZE(); + private static native final long H5E_CANTINC(); private static native final long H5E_CANTINIT(); + private static native final long H5E_CANTINS(); + private static native final long H5E_CANTINSERT(); private static native final long H5E_CANTLIST(); @@ -861,29 +1221,96 @@ public class HDF5Constants { private static native final long H5E_CANTLOCK(); + private static native final long H5E_CANTLOCKFILE(); + + private static native final long H5E_CANTMARKCLEAN(); + + private static native final long H5E_CANTMARKDIRTY(); + + private static native final long H5E_CANTMARKSERIALIZED(); + + private static native final long H5E_CANTMARKUNSERIALIZED(); + + private static native final long H5E_CANTMERGE(); + + private static native final long H5E_CANTMOVE(); + + private static native final long H5E_CANTMODIFY(); + private static native final long H5E_CANTNEXT(); + private static native final long H5E_CANTNOTIFY(); + private static native final long H5E_CANTOPENFILE(); private static native final long H5E_CANTOPENOBJ(); - // private static native final long H5E_CANTRECV(); + private static native final long H5E_CANTOPERATE(); + + private static native final long H5E_CANTPACK(); + + private static native final long H5E_CANTPIN(); + + private static native final long H5E_CANTPROTECT(); + + private static native final long H5E_CANTRECV(); + + private static native final long H5E_CANTREDISTRIBUTE(); + private static native final long H5E_CANTREGISTER(); private static native final long H5E_CANTRELEASE(); + private static native final long H5E_CANTREMOVE(); + + private static native final long H5E_CANTRENAME(); + + private static native final long H5E_CANTRESET(); + + private static native final long H5E_CANTRESIZE(); + + private static native final long H5E_CANTRESTORE(); + + private static native final long H5E_CANTREVIVE(); + + private static native final long H5E_CANTSHRINK(); + private static native final long H5E_CANTSELECT(); private static native final long H5E_CANTSET(); + private static native final long H5E_CANTSERIALIZE(); + + private static native final long H5E_CANTSORT(); + private static native final long H5E_CANTSPLIT(); + private static native final long H5E_CANTSWAP(); + + private static native final long H5E_CANTTAG(); + + private static native final long H5E_CANTUNCORK(); + + private static native final long H5E_CANTUNDEPEND(); + private static native final long H5E_CANTUNLOCK(); + private static native final long H5E_CANTUNLOCKFILE(); + + private static native final long H5E_CANTUNPIN(); + + private static native final long H5E_CANTUNPROTECT(); + + private static native final long H5E_CANTUNSERIALIZE(); + + private static native final long H5E_CANTUPDATE(); + private static native final long H5E_CLOSEERROR(); private static native final long H5E_COMPLEN(); + private static native final long H5E_CONTEXT(); + private static native final long H5E_DATASET(); private static native final long H5E_DATASPACE(); @@ -894,10 +1321,16 @@ public class HDF5Constants { private static native final long H5E_DUPCLASS(); + private static native final long H5E_EARRAY(); + private static native final long H5E_EFL(); + private static native final long H5E_ERROR(); + private static native final long H5E_EXISTS(); + private static native final long H5E_FARRAY(); + private static native final long H5E_FCNTL(); private static native final long H5E_FILE(); @@ -906,10 +1339,14 @@ public class HDF5Constants { private static native final long H5E_FILEOPEN(); + private static native final long H5E_FSPACE(); + private static native final long H5E_FUNC(); private static native final long H5E_HEAP(); + private static native final long H5E_INCONSISTENTSTATE(); + private static native final long H5E_INTERNAL(); private static native final long H5E_IO(); @@ -918,6 +1355,8 @@ public class HDF5Constants { private static native final long H5E_LINKCOUNT(); + private static native final long H5E_LOGGING(); + private static native final int H5E_MAJOR(); private static native final int H5E_MINOR(); @@ -928,6 +1367,12 @@ public class HDF5Constants { private static native final long H5E_MPIERRSTR(); + private static native final long H5E_NLINKS(); + + private static native final long H5E_NO_INDEPENDENT(); + + private static native final long H5E_NOENCODER(); + private static native final long H5E_NOFILTER(); private static native final long H5E_NOIDS(); @@ -944,14 +1389,26 @@ public class HDF5Constants { private static native final long H5E_NOTHDF5(); + private static native final long H5E_NOTREGISTERED(); + + private static native final long H5E_OBJOPEN(); + private static native final long H5E_OHDR(); + private static native final long H5E_OPENERROR(); + private static native final long H5E_OVERFLOW(); + private static native final long H5E_PAGEBUF(); + + private static native final long H5E_PATH(); + private static native final long H5E_PLINE(); private static native final long H5E_PLIST(); + private static native final long H5E_PLUGIN(); + private static native final long H5E_PROTECT(); private static native final long H5E_READERROR(); @@ -964,12 +1421,24 @@ public class HDF5Constants { private static native final long H5E_SEEKERROR(); + private static native final long H5E_SETDISALLOWED(); + private static native final long H5E_SETLOCAL(); + private static native final long H5E_SLIST(); + + private static native final long H5E_SOHM(); + private static native final long H5E_STORAGE(); private static native final long H5E_SYM(); + private static native final long H5E_SYSERRSTR(); + + private static native final long H5E_SYSTEM(); + + private static native final long H5E_TRAVERSE(); + private static native final long H5E_TRUNCATED(); private static native final long H5E_TST(); @@ -988,6 +1457,14 @@ public class HDF5Constants { 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(); @@ -1364,6 +1841,8 @@ public class HDF5Constants { private static native final int H5PL_TYPE_FILTER(); + private static native final int H5PL_TYPE_NONE(); + private static native final int H5PL_FILTER_PLUGIN(); private static native final int H5PL_ALL_PLUGIN(); diff --git a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java index 988c8fb..69c9709 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java @@ -15,7 +15,28 @@ package hdf.hdf5lib.callbacks; import hdf.hdf5lib.structs.H5A_info_t; -//Information class for link callback(for H5Aiterate) +/** + * Information class for link callback for H5Aiterate. + * + */ public interface H5A_iterate_cb extends Callbacks { - int callback(long group, String name, H5A_info_t info, H5A_iterate_t op_data); + /** + * application callback for each attribute + * + * @param loc_id the ID for the group or dataset being iterated over + * @param name the name of the current attribute about the object + * @param info the attribute's "info" struct + * @param op_data the operator data passed in to H5Aiterate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ + int callback(long loc_id, String name, H5A_info_t info, H5A_iterate_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java index 51d67d5..bdc96fa 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Aiterate. + * + */ public interface H5A_iterate_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java b/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java index ead8f73..8ad336f 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pset/get_append_flush) +/** + * Information class for link callback for H5Pset/get_append_flush. + * + */ public interface H5D_append_cb extends Callbacks { + /** + * application callback for each dataset access property list + * + * @param dataset_id the ID for the dataset being iterated over + * @param cur_dims the dimension sizes for determining boundary + * @param op_data the operator data passed in to H5Pset/get_append_flush + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long dataset_id, long[] cur_dims, H5D_append_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java b/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java index 8bf6410..795ed1e 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Dappend. + * + */ public interface H5D_append_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java index a911a1c..ca10342 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java @@ -13,7 +13,29 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Diterate) +/** + * Information class for link callback for H5Diterate. + * + */ public interface H5D_iterate_cb extends Callbacks { + /** + * application callback for each dataset element + * + * @param elem the pointer to the element in memory containing the current point + * @param elem_type the datatype ID for the elements stored in elem + * @param ndim the number of dimensions for POINT array + * @param point the array containing the location of the element within the original dataspace + * @param op_data the operator data passed in to H5Diterate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(byte[] elem, long elem_type, int ndim, long[] point, H5D_iterate_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java index d049711..43fc159 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Diterate. + * + */ public interface H5D_iterate_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java b/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java index afc04ae..e5914c1 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java @@ -15,7 +15,27 @@ package hdf.hdf5lib.callbacks; import hdf.hdf5lib.structs.H5E_error2_t; -//Information class for link callback(for H5Ewalk) +/** + * Information class for link callback for H5Ewalk. + * + */ public interface H5E_walk_cb extends Callbacks { + /** + * application callback for each error stack element + * + * @param nidx the index of the current error stack element + * @param info the error stack "info" struct + * @param op_data the operator data passed in to H5Ewalk + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(int nidx, H5E_error2_t info, H5E_walk_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java b/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java index 0be8977..3ff09ec 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Ewalk. + * + */ public interface H5E_walk_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_cb.java index ec71911..c472a3e 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_cb.java @@ -15,7 +15,28 @@ package hdf.hdf5lib.callbacks; import hdf.hdf5lib.structs.H5L_info_t; -//Information class for link callback(for H5Lvisit/H5Lvisit_by_name) +/** + * 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); + /** + * application callback for each group + * + * @param loc_id the ID for the group being iterated over + * @param name the name of the current link + * @param info the link's "info" struct + * @param op_data the operator data passed in to H5Literate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ + int callback(long loc_id, String name, H5L_info_t info, H5L_iterate_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java index 28ffb8a..916632d 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java @@ -13,8 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Lvisit/H5Lvisit_by_name. + * + */ public interface H5L_iterate_t { -/** public ArrayList iterdata = new ArrayList(); - * Any derived interfaces must define the single public variable as above. - */ + } diff --git a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_cb.java index 89cf206..ef90dae 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_cb.java @@ -15,7 +15,28 @@ package hdf.hdf5lib.callbacks; import hdf.hdf5lib.structs.H5O_info_t; -//Information class for link callback(for H5Ovisit/H5Ovisit_by_name) +/** + * 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); + /** + * application callback for each group + * + * @param loc_id the ID for the group or dataset being iterated over + * @param name the name of the current object + * @param info the object's "info" struct + * @param op_data the operator data passed in to H5Oiterate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ + int callback(long loc_id, String name, H5O_info_t info, H5O_iterate_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java index 1491b09..2c3984c 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java @@ -13,8 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Ovisit/H5Ovisit_by_name. + * + */ public interface H5O_iterate_t { -/** public ArrayList iterdata = new ArrayList(); - * Any derived interfaces must define the single public variable as above. - */ + } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java index e77d386..78a87ad 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java @@ -13,7 +13,26 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pcreate_class) +/** + * Information class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_close_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID for the property list class being iterated over + * @param close_data the function to call when a property list is closed + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, H5P_cls_close_func_t close_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java index 0d5ad9e..709ee494 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_close_func_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java index 139f877..878bbd3 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pcreate_class) +/** + * Information class for link callback for H5Pcreate_class + * + */ public interface H5P_cls_copy_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param new_prop_id the ID for the property list copy + * @param old_prop_id the ID for the property list class being copied + * @param copy_data the function to call when each property list in this class is copied + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long new_prop_id, long old_prop_id, H5P_cls_copy_func_t copy_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java index 12c2601..b3e7f09 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_copy_func_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java index e64ec6f..88d0aa6 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java @@ -13,7 +13,26 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pcreate_class) +/** + * Information class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_create_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID for the property list class being iterated over + * @param create_data the function to call when each property list in this class is created + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, H5P_cls_create_func_t create_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java index 73646f1..8e259cc 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Pcreate_class. + * + */ public interface H5P_cls_create_func_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java index 5ecb88d..60e1884 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Piterate) +/** + * Information class for link callback for H5Piterate. + * + */ public interface H5P_iterate_cb extends Callbacks { + /** + * application callback for each property list + * + * @param plist the ID for the property list being iterated over + * @param name the name of the current property list + * @param op_data the operator data passed in to H5Piterate + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long plist, String name, H5P_iterate_t op_data); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java index 2e320b4..4c5d222 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java @@ -13,6 +13,10 @@ package hdf.hdf5lib.callbacks; +/** + * Data class for link callback for H5Piterate. + * + */ public interface H5P_iterate_t { /** public ArrayList iterdata = new ArrayList(); * Any derived interfaces must define the single public variable as above. diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java index 103fe5f..40569bc 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_close_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param name the name of the property being closed + * @param size the size of the property value + * @param value the value of the property being closed + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java index 46477b9..cc466a6 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_compare_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param value1 the value of the first property being compared + * @param value2 the value of the second property being compared + * @param size the size of the property value + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(byte[] value1, byte[] value2, long size); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java index 57994bb5..59e4bb8 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_copy_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param name the name of the property being copied + * @param size the size of the property value + * @param value the value of the property being copied + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java index 8791c22..5c6df7a 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java @@ -13,7 +13,27 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_create_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param name the name of the property list being created + * @param size the size of the property value + * @param value the initial value for the property being created + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java index 46cd097..5206d4f 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java @@ -13,7 +13,28 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_delete_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID of the property list the property is deleted from + * @param name the name of the property being deleted + * @param size the size of the property value + * @param value the value of the property being deleted + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java index 04599a0..8f44497 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java @@ -13,7 +13,28 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_get_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID for the property list being queried + * @param name the name of the property being queried + * @param size the size of the property value + * @param value the value being retrieved for the property + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java index 6ac750f..2a2d3a1 100644 --- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java +++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java @@ -13,7 +13,28 @@ package hdf.hdf5lib.callbacks; -//Information class for link callback(for H5Pregister2) +/** + * Information class for link callback for H5Pregister2. + * + */ public interface H5P_prp_set_func_cb extends Callbacks { + /** + * application callback for each property list + * + * @param prop_id the ID for the property list being modified + * @param name the name of the property being modified + * @param size the size of the property value + * @param value the value being set for the property + * + * @return operation status + * A. Zero causes the iterator to continue, returning zero when all + * attributes have been processed. + * B. Positive causes the iterator to immediately return that positive + * value, indicating short-circuit success. The iterator can be + * restarted at the next attribute. + * C. Negative causes the iterator to immediately return that value, + * indicating failure. The iterator can be restarted at the next + * attribute. + */ int callback(long prop_id, String name, long size, byte[] value); } diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java b/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java index 1e4b5fd..70fdd11 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5Exception.java @@ -31,6 +31,9 @@ package hdf.hdf5lib.exceptions; * */ public class HDF5Exception extends RuntimeException { + /** + * the specified detail message of this exception + */ protected String detailMessage; /** diff --git a/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java b/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java index ea4a89a..fea5b6d 100644 --- a/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java +++ b/java/src/hdf/hdf5lib/exceptions/HDF5ReferenceException.java @@ -13,6 +13,12 @@ package hdf.hdf5lib.exceptions; +/** + * The class HDF5LibraryException returns errors raised by the HDF5 library. + *

+ * This sub-class represents HDF-5 major error code H5E_REFERENCE + */ + public class HDF5ReferenceException extends HDF5LibraryException { /** * Constructs an HDF5ReferenceException with no specified diff --git a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java index 20863dc..a118d05 100644 --- a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java +++ b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for H5Pget_mdc_config/H5Pset_mdc_config +/** + * Information struct for H5Pget_mdc_config/H5Pset_mdc_config + * + */ public class H5AC_cache_config_t implements Serializable{ private static final long serialVersionUID = -6748085696476149972L; // general configuration fields: diff --git a/java/src/hdf/hdf5lib/structs/H5A_info_t.java b/java/src/hdf/hdf5lib/structs/H5A_info_t.java index a46a495..cd7a397 100644 --- a/java/src/hdf/hdf5lib/structs/H5A_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5A_info_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for Attribute (For H5Aget_info/H5Aget_info_by_idx/H5Aget_info_by_name) +/** + * Information struct for Attribute (For H5Aget_info/H5Aget_info_by_idx/H5Aget_info_by_name) + * + */ public class H5A_info_t implements Serializable{ private static final long serialVersionUID = 2791443594041667613L; public boolean corder_valid; // Indicate if creation order is valid diff --git a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java index 257ad05..083537f 100644 --- a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java +++ b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for Attribute (For H5Ewalk) +/** + * Information struct for Attribute (For H5Ewalk) + * + */ public class H5E_error2_t implements Serializable{ private static final long serialVersionUID = 279144359041667613L; diff --git a/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java index 9fcff2e..26690ec 100644 --- a/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java +++ b/java/src/hdf/hdf5lib/structs/H5FD_hdfs_fapl_t.java @@ -16,7 +16,7 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -/* +/** * Java representation of the HDFS VFD file access property list (fapl) * structure. * diff --git a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java index a899e10..735cc7e 100644 --- a/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java +++ b/java/src/hdf/hdf5lib/structs/H5FD_ros3_fapl_t.java @@ -16,7 +16,7 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -/* +/** * Java representation of the ROS3 VFD file access property list (fapl) * structure. * diff --git a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java index 4664b5b..836b683 100644 --- a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java +++ b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for object (for H5Fget_info) +/** + * Information struct for object (for H5Fget_info) + * + */ public class H5F_info2_t implements Serializable{ private static final long serialVersionUID = 4691681162544054518L; public int super_version; // Superblock version # diff --git a/java/src/hdf/hdf5lib/structs/H5G_info_t.java b/java/src/hdf/hdf5lib/structs/H5G_info_t.java index 56c876e..9a5c72e 100644 --- a/java/src/hdf/hdf5lib/structs/H5G_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5G_info_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) +/** + * Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) + * + */ public class H5G_info_t implements Serializable{ private static final long serialVersionUID = -3746463015312132912L; public int storage_type; // Type of storage for links in group diff --git a/java/src/hdf/hdf5lib/structs/H5L_info_t.java b/java/src/hdf/hdf5lib/structs/H5L_info_t.java index 3bbb189..a595708 100644 --- a/java/src/hdf/hdf5lib/structs/H5L_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5L_info_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for link (for H5Lget_info/H5Lget_info_by_idx) +/** + * 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; diff --git a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java index 73aaa47..df76638 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java @@ -15,7 +15,10 @@ 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) +/** + * 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 { private static final long serialVersionUID = 7883826382952577189L; public int version; /* Version number of header format in file */ @@ -56,25 +59,25 @@ public class H5O_hdr_info_t implements Serializable { H5O_hdr_info_t info = (H5O_hdr_info_t) o; if (this.version != info.version) - return false; + return false; if (this.nmesgs != info.nmesgs) - return false; + return false; if (this.nchunks != info.nchunks) - return false; + return false; if (this.flags != info.flags) - return false; + return false; if (this.space_total != info.space_total) - return false; + return false; if (this.space_meta != info.space_meta) - return false; + return false; if (this.space_mesg != info.space_mesg) - return false; + return false; if (this.space_free != info.space_free) - return false; + return false; if (this.mesg_present != info.mesg_present) - return false; + return false; if (this.mesg_shared != info.mesg_shared) - return false; + return false; return true; } diff --git a/java/src/hdf/hdf5lib/structs/H5O_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_info_t.java index 5dd078f..8dedeca 100644 --- a/java/src/hdf/hdf5lib/structs/H5O_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5O_info_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -// Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) +/** + * 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 */ diff --git a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java index 7159f02..1c3ab80 100644 --- a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java +++ b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java @@ -15,7 +15,10 @@ package hdf.hdf5lib.structs; import java.io.Serializable; -//Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) +/** + * Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) + * + */ public class H5_ih_info_t implements Serializable { private static final long serialVersionUID = -142238015615462707L; public long index_size; /* btree and/or list */ @@ -38,9 +41,9 @@ public class H5_ih_info_t implements Serializable { H5_ih_info_t info = (H5_ih_info_t) o; if (this.index_size != info.index_size) - return false; + return false; if (this.heap_size != info.heap_size) - return false; + return false; return true; } diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index 3c8fc68..c0dcbb8 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -355,6 +355,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1BADGROUP(JNIEnv *env, jclass cls) return H5E_BADGROUP; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1BADITER(JNIEnv *env, jclass cls) +{ + return H5E_BADITER; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1BADMESG(JNIEnv *env, jclass cls) { return H5E_BADMESG; @@ -404,8 +409,26 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANAPPLY(JNIEnv *env, jclass cls) { return H5E_CANAPPLY; } -/*JNIEXPORT jlong JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTALLOC(JNIEnv *env, jclass cls) { return H5E_CANTALLOC; }*/ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTALLOC(JNIEnv *env, jclass cls) +{ + return H5E_CANTALLOC; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTAPPEND(JNIEnv *env, jclass cls) +{ + return H5E_CANTAPPEND; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTATTACH(JNIEnv *env, jclass cls) +{ + return H5E_CANTATTACH; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLEAN(JNIEnv *env, jclass cls) +{ + return H5E_CANTCLEAN; +} JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLIP(JNIEnv *env, jclass cls) { @@ -417,6 +440,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLOSEFILE(JNIEnv *env, jclass cls) return H5E_CANTCLOSEFILE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCLOSEOBJ(JNIEnv *env, jclass cls) +{ + return H5E_CANTCLOSEOBJ; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOMPARE(JNIEnv *env, jclass cls) +{ + return H5E_CANTCOMPARE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOMPUTE(JNIEnv *env, jclass cls) +{ + return H5E_CANTCOMPUTE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCONVERT(JNIEnv *env, jclass cls) { return H5E_CANTCONVERT; @@ -427,6 +465,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOPY(JNIEnv *env, jclass cls) return H5E_CANTCOPY; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCORK(JNIEnv *env, jclass cls) +{ + return H5E_CANTCORK; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTCOUNT(JNIEnv *env, jclass cls) { return H5E_CANTCOUNT; @@ -452,11 +495,36 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDELETE(JNIEnv *env, jclass cls) return H5E_CANTDELETE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDEPEND(JNIEnv *env, jclass cls) +{ + return H5E_CANTDEPEND; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTDIRTY(JNIEnv *env, jclass cls) +{ + return H5E_CANTDIRTY; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFILTER(JNIEnv *env, jclass cls) +{ + return H5E_CANTFILTER; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTENCODE(JNIEnv *env, jclass cls) { return H5E_CANTENCODE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTEXPUNGE(JNIEnv *env, jclass cls) +{ + return H5E_CANTEXPUNGE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTEXTEND(JNIEnv *env, jclass cls) +{ + return H5E_CANTEXTEND; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFLUSH(JNIEnv *env, jclass cls) { return H5E_CANTFLUSH; @@ -467,11 +535,26 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTFREE(JNIEnv *env, jclass cls) return H5E_CANTFREE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGATHER(JNIEnv *env, jclass cls) +{ + return H5E_CANTGATHER; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGC(JNIEnv *env, jclass cls) +{ + return H5E_CANTGC; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGET(JNIEnv *env, jclass cls) { return H5E_CANTGET; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTGETSIZE(JNIEnv *env, jclass cls) +{ + return H5E_CANTGETSIZE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINC(JNIEnv *env, jclass cls) { return H5E_CANTINC; @@ -482,6 +565,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINIT(JNIEnv *env, jclass cls) return H5E_CANTINIT; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINS(JNIEnv *env, jclass cls) +{ + return H5E_CANTINS; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTINSERT(JNIEnv *env, jclass cls) { return H5E_CANTINSERT; @@ -502,11 +590,56 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLOCK(JNIEnv *env, jclass cls) return H5E_CANTLOCK; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTLOCKFILE(JNIEnv *env, jclass cls) +{ + return H5E_CANTLOCKFILE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKCLEAN(JNIEnv *env, jclass cls) +{ + return H5E_CANTMARKCLEAN; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKDIRTY(JNIEnv *env, jclass cls) +{ + return H5E_CANTMARKDIRTY; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKSERIALIZED(JNIEnv *env, jclass cls) +{ + return H5E_CANTMARKSERIALIZED; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMARKUNSERIALIZED(JNIEnv *env, jclass cls) +{ + return H5E_CANTMARKUNSERIALIZED; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMERGE(JNIEnv *env, jclass cls) +{ + return H5E_CANTMERGE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMODIFY(JNIEnv *env, jclass cls) +{ + return H5E_CANTMODIFY; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTMOVE(JNIEnv *env, jclass cls) +{ + return H5E_CANTMOVE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTNEXT(JNIEnv *env, jclass cls) { return H5E_CANTNEXT; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTNOTIFY(JNIEnv *env, jclass cls) +{ + return H5E_CANTNOTIFY; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPENFILE(JNIEnv *env, jclass cls) { return H5E_CANTOPENFILE; @@ -516,8 +649,36 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPENOBJ(JNIEnv *env, jclass cls) { return H5E_CANTOPENOBJ; } -/*JNIEXPORT jlong JNICALL -Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRECV(JNIEnv *env, jclass cls) { return H5E_CANTRECV; }*/ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTOPERATE(JNIEnv *env, jclass cls) +{ + return H5E_CANTOPERATE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTPACK(JNIEnv *env, jclass cls) +{ + return H5E_CANTPACK; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTPIN(JNIEnv *env, jclass cls) +{ + return H5E_CANTPIN; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTPROTECT(JNIEnv *env, jclass cls) +{ + return H5E_CANTPROTECT; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRECV(JNIEnv *env, jclass cls) +{ + return H5E_CANTRECV; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREDISTRIBUTE(JNIEnv *env, jclass cls) +{ + return H5E_CANTREDISTRIBUTE; +} JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREGISTER(JNIEnv *env, jclass cls) { @@ -529,6 +690,41 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRELEASE(JNIEnv *env, jclass cls) return H5E_CANTRELEASE; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREMOVE(JNIEnv *env, jclass cls) +{ + return H5E_CANTREMOVE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRENAME(JNIEnv *env, jclass cls) +{ + return H5E_CANTRENAME; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRESET(JNIEnv *env, jclass cls) +{ + return H5E_CANTRESET; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRESIZE(JNIEnv *env, jclass cls) +{ + return H5E_CANTRESIZE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTRESTORE(JNIEnv *env, jclass cls) +{ + return H5E_CANTRESTORE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTREVIVE(JNIEnv *env, jclass cls) +{ + return H5E_CANTREVIVE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSHRINK(JNIEnv *env, jclass cls) +{ + return H5E_CANTSHRINK; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSELECT(JNIEnv *env, jclass cls) { return H5E_CANTSELECT; @@ -539,16 +735,71 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSET(JNIEnv *env, jclass cls) return H5E_CANTSET; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSERIALIZE(JNIEnv *env, jclass cls) +{ + return H5E_CANTSERIALIZE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSORT(JNIEnv *env, jclass cls) +{ + return H5E_CANTSORT; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSPLIT(JNIEnv *env, jclass cls) { return H5E_CANTSPLIT; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTSWAP(JNIEnv *env, jclass cls) +{ + return H5E_CANTSWAP; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTTAG(JNIEnv *env, jclass cls) +{ + return H5E_CANTTAG; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNCORK(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNCORK; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNDEPEND(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNDEPEND; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNLOCK(JNIEnv *env, jclass cls) { return H5E_CANTUNLOCK; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNLOCKFILE(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNLOCKFILE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNPIN(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNPIN; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNPROTECT(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNPROTECT; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUNSERIALIZE(JNIEnv *env, jclass cls) +{ + return H5E_CANTUNSERIALIZE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CANTUPDATE(JNIEnv *env, jclass cls) +{ + return H5E_CANTUPDATE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1CLOSEERROR(JNIEnv *env, jclass cls) { return H5E_CLOSEERROR; @@ -559,6 +810,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1COMPLEN(JNIEnv *env, jclass cls) return H5E_COMPLEN; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1CONTEXT(JNIEnv *env, jclass cls) +{ + return H5E_CONTEXT; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1DATASET(JNIEnv *env, jclass cls) { return H5E_DATASET; @@ -584,16 +840,31 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1DUPCLASS(JNIEnv *env, jclass cls) return H5E_DUPCLASS; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1EARRAY(JNIEnv *env, jclass cls) +{ + return H5E_EARRAY; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1EFL(JNIEnv *env, jclass cls) { return H5E_EFL; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1ERROR(JNIEnv *env, jclass cls) +{ + return H5E_ERROR; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1EXISTS(JNIEnv *env, jclass cls) { return H5E_EXISTS; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1FARRAY(JNIEnv *env, jclass cls) +{ + return H5E_FARRAY; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FCNTL(JNIEnv *env, jclass cls) { return H5E_FCNTL; @@ -614,6 +885,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1FILEOPEN(JNIEnv *env, jclass cls) return H5E_FILEOPEN; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1FSPACE(JNIEnv *env, jclass cls) +{ + return H5E_FSPACE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1FUNC(JNIEnv *env, jclass cls) { return H5E_FUNC; @@ -624,6 +900,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1HEAP(JNIEnv *env, jclass cls) return H5E_HEAP; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1INCONSISTENTSTATE(JNIEnv *env, jclass cls) +{ + return H5E_INCONSISTENTSTATE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1INTERNAL(JNIEnv *env, jclass cls) { return H5E_INTERNAL; @@ -643,6 +924,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1LINKCOUNT(JNIEnv *env, jclass cls) { return H5E_LINKCOUNT; } +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1LOGGING(JNIEnv *env, jclass cls) +{ + return H5E_LOGGING; +} JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1MAJOR(JNIEnv *env, jclass cls) { @@ -669,6 +955,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1MPIERRSTR(JNIEnv *env, jclass cls) return H5E_MPIERRSTR; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1NLINKS(JNIEnv *env, jclass cls) +{ + return H5E_NLINKS; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1NO_1INDEPENDENT(JNIEnv *env, jclass cls) +{ + return H5E_NO_INDEPENDENT; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1NOENCODER(JNIEnv *env, jclass cls) +{ + return H5E_NOENCODER; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1NOFILTER(JNIEnv *env, jclass cls) { return H5E_NOFILTER; @@ -709,16 +1010,41 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTHDF5(JNIEnv *env, jclass cls) return H5E_NOTHDF5; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1NOTREGISTERED(JNIEnv *env, jclass cls) +{ + return H5E_NOTREGISTERED; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1OBJOPEN(JNIEnv *env, jclass cls) +{ + return H5E_OBJOPEN; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1OHDR(JNIEnv *env, jclass cls) { return H5E_OHDR; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1OPENERROR(JNIEnv *env, jclass cls) +{ + return H5E_OPENERROR; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1OVERFLOW(JNIEnv *env, jclass cls) { return H5E_OVERFLOW; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1PAGEBUF(JNIEnv *env, jclass cls) +{ + return H5E_PAGEBUF; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1PATH(JNIEnv *env, jclass cls) +{ + return H5E_PATH; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1PLINE(JNIEnv *env, jclass cls) { return H5E_PLINE; @@ -729,6 +1055,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1PLIST(JNIEnv *env, jclass cls) return H5E_PLIST; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1PLUGIN(JNIEnv *env, jclass cls) +{ + return H5E_PLUGIN; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1PROTECT(JNIEnv *env, jclass cls) { return H5E_PROTECT; @@ -759,11 +1090,26 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1SEEKERROR(JNIEnv *env, jclass cls) return H5E_SEEKERROR; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SETDISALLOWED(JNIEnv *env, jclass cls) +{ + return H5E_SETDISALLOWED; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1SETLOCAL(JNIEnv *env, jclass cls) { return H5E_SETLOCAL; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SLIST(JNIEnv *env, jclass cls) +{ + return H5E_SLIST; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SOHM(JNIEnv *env, jclass cls) +{ + return H5E_SOHM; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1STORAGE(JNIEnv *env, jclass cls) { return H5E_STORAGE; @@ -774,6 +1120,21 @@ Java_hdf_hdf5lib_HDF5Constants_H5E_1SYM(JNIEnv *env, jclass cls) return H5E_SYM; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SYSERRSTR(JNIEnv *env, jclass cls) +{ + return H5E_SYSERRSTR; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1SYSTEM(JNIEnv *env, jclass cls) +{ + return H5E_SYSTEM; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5E_1TRAVERSE(JNIEnv *env, jclass cls) +{ + return H5E_TRAVERSE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1TRUNCATED(JNIEnv *env, jclass cls) { return H5E_TRUNCATED; @@ -1798,6 +2159,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5PL_1TYPE_1FILTER(JNIEnv *env, jclass cls) return H5PL_TYPE_FILTER; } JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5PL_1TYPE_1NONE(JNIEnv *env, jclass cls) +{ + return H5PL_TYPE_NONE; +} +JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5PL_1FILTER_1PLUGIN(JNIEnv *env, jclass cls) { return H5PL_FILTER_PLUGIN; diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c index d23f6cc..95be74d 100644 --- a/java/src/jni/h5sImp.c +++ b/java/src/jni/h5sImp.c @@ -1340,6 +1340,389 @@ done: return; } /* end Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_copy + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1copy(JNIEnv *env, jclass clss, jlong dst_id, jlong src_id) +{ + herr_t status = FAIL; + + UNUSED(clss); + + if ((status = H5Sselect_copy((hid_t)dst_id, (hid_t)src_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + return; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1copy */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_shape_same + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1shape_1same(JNIEnv *env, jclass clss, jlong space1_id, jlong space2_id) +{ + htri_t bval = JNI_FALSE; + + UNUSED(clss); + + if ((bval = H5Sselect_shape_same((hid_t)space1_id, (hid_t)space2_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + bval = (bval > 0) ? JNI_TRUE : JNI_FALSE; + +done: + return (jboolean)bval; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1shape_1same */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_adjust + * Signature: (J[J)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1adjust(JNIEnv *env, jclass clss, jlong space_id, jlongArray offset) +{ + jboolean isCopy; + hssize_t *offst = NULL; + jlong * offsetP = NULL; + jsize offset_rank = -1; + int i, rank = -1; + herr_t status = FAIL; + + UNUSED(clss); + + if (space_id < 0) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_adjust: invalid dataspace ID"); + + if ((rank = H5Sget_simple_extent_ndims(space_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + if (NULL == offset) { + offsetP = NULL; + offst = (hssize_t *)offsetP; + } + else { + if ((offset_rank = ENVPTR->GetArrayLength(ENVONLY, offset)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_adjust: offset length < 0"); + } + + if (offset_rank != rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_adjust: offset rank doesn't match dataspace rank!"); + + PIN_LONG_ARRAY(ENVONLY, offset, offsetP, &isCopy, "H5Sselect_adjust: offset not pinned"); + + if (NULL == (offst = (hssize_t *)HDmalloc((size_t)offset_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_adjust: failed to allocate offset buffer"); + } + + if ((status = H5Sselect_adjust(space_id, (hssize_t *)offst)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + for (i = 0; i < offset_rank; i++) { + offsetP[i] = (jlong)offst[i]; + } /* end for */ + +done: + if (offst) + HDfree(offst); + if (offsetP) + UNPIN_LONG_ARRAY(ENVONLY, offset, offsetP, (status < 0) ? JNI_ABORT : 0); + + return; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1adjust */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_intersect_block + * Signature: (J[J[J)Z + */ +JNIEXPORT jboolean JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block(JNIEnv *env, jclass clss, jlong space_id, jlongArray start, + jlongArray end) +{ + htri_t bval = JNI_FALSE; + jboolean isCopy; + hsize_t *strt = NULL, *nd = NULL; + jlong * startP = NULL, *endP = NULL; + jsize start_rank = -1, end_rank = -1; + int i, rank = -1; + + UNUSED(clss); + + if (space_id < 0) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_intersect_block: invalid dataspace ID"); + + if ((rank = H5Sget_simple_extent_ndims(space_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + if (NULL == start) { + startP = NULL; + strt = (hsize_t *)startP; + } + else { + if ((start_rank = ENVPTR->GetArrayLength(ENVONLY, start)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_intersect_block: start length < 0"); + } + + if (start_rank != rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, + "H5Sselect_intersect_block: start rank doesn't match dataspace rank!"); + + PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Sselect_intersect_block: start not pinned"); + + if (NULL == (strt = (hsize_t *)HDmalloc((size_t)start_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_intersect_block: failed to allocate start buffer"); + } + + if (NULL == end) { + endP = NULL; + nd = (hsize_t *)endP; + } + else { + if ((end_rank = ENVPTR->GetArrayLength(ENVONLY, end)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sselect_intersect_block: end array length < 0"); + } + + if (end_rank != rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, + "H5Sselect_intersect_block: end rank doesn't match dataspace rank!"); + + PIN_LONG_ARRAY(ENVONLY, end, endP, &isCopy, "H5Sselect_intersect_block: end not pinned"); + + if (NULL == (nd = (hsize_t *)HDmalloc((size_t)end_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_intersect_block: failed to allocate end buffer"); + } + + if ((bval = H5Sselect_intersect_block(space_id, (hsize_t *)strt, (hsize_t *)nd)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + bval = (bval > 0) ? JNI_TRUE : JNI_FALSE; + + for (i = 0; i < start_rank; i++) { + startP[i] = (jlong)strt[i]; + endP[i] = (jlong)nd[i]; + } /* end for */ + +done: + if (strt) + HDfree(strt); + if (startP) + UNPIN_LONG_ARRAY(ENVONLY, start, startP, (bval < 0) ? JNI_ABORT : 0); + if (nd) + HDfree(nd); + if (endP) + UNPIN_LONG_ARRAY(ENVONLY, end, endP, (bval < 0) ? JNI_ABORT : 0); + + return (jboolean)bval; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_project_intersection + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5Sselect_1project_1intersection(JNIEnv *env, jclass clss, jlong src_space_id, + jlong dst_space_id, jlong src_intersect_space_id) +{ + hid_t sid = H5I_INVALID_HID; + + UNUSED(clss); + + if ((sid = H5Sselect_project_intersection(src_space_id, dst_space_id, src_intersect_space_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + + return (jlong)sid; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1project_1intersection */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Scombine_hyperslab + * Signature: (JI[J[J[J[J)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *env, jclass clss, jlong space_id, jint op, jlongArray start, + jlongArray stride, jlongArray count, jlongArray block) +{ + jboolean isCopy; + hsize_t *strt = NULL, *strd = NULL, *cnt = NULL, *blk = NULL; + hsize_t *lp = NULL; + jlong * startP = NULL, *strideP = NULL, *countP = NULL, *blockP = NULL; + jlong * jlp = NULL; + jsize start_rank, stride_rank, count_rank, block_rank; + int i; + hid_t sid = H5I_INVALID_HID; + + UNUSED(clss); + + if (NULL == start) + H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: start is NULL"); + if (NULL == count) + H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: count is NULL"); + + if ((start_rank = ENVPTR->GetArrayLength(ENVONLY, start)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: start array length < 0"); + } + if ((count_rank = ENVPTR->GetArrayLength(ENVONLY, count)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: count array length < 0"); + } + + if (start_rank != count_rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: count and start have different rank!"); + + PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Scombine_hyperslab: start not pinned"); + + if (NULL == (strt = lp = (hsize_t *)HDmalloc((size_t)start_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate start buffer"); + + jlp = (jlong *)startP; + for (i = 0; i < start_rank; i++) { + *lp = (hsize_t)*jlp; + lp++; + jlp++; + } /* end if */ + + PIN_LONG_ARRAY(ENVONLY, count, countP, &isCopy, "H5Scombine_hyperslab: count not pinned"); + + if (NULL == (cnt = lp = (hsize_t *)HDmalloc((size_t)count_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate count buffer"); + + jlp = (jlong *)countP; + for (i = 0; i < count_rank; i++) { + *lp = (hsize_t)*jlp; + lp++; + jlp++; + } /* end if */ + + if (NULL == stride) { + strideP = NULL; + strd = (hsize_t *)strideP; + } + else { + if ((stride_rank = ENVPTR->GetArrayLength(ENVONLY, stride)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: stride array length < 0"); + } + + if (stride_rank != start_rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: stride and start have different rank!"); + + PIN_LONG_ARRAY(ENVONLY, stride, strideP, &isCopy, "H5Scombine_hyperslab: stride not pinned"); + + if (NULL == (strd = lp = (hsize_t *)HDmalloc((size_t)stride_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate stride buffer"); + + jlp = (jlong *)strideP; + for (i = 0; i < stride_rank; i++) { + *lp = (hsize_t)*jlp; + lp++; + jlp++; + } /* end if */ + } + + if (NULL == block) { + blockP = NULL; + blk = (hsize_t *)blockP; + } + else { + if ((block_rank = ENVPTR->GetArrayLength(ENVONLY, block)) < 0) { + CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE); + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: block array length < 0"); + } + + if (block_rank != start_rank) + H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Scombine_hyperslab: block and start have different rank!"); + + PIN_LONG_ARRAY(ENVONLY, block, blockP, &isCopy, "H5Scombine_hyperslab: block not pinned"); + + if (NULL == (blk = lp = (hsize_t *)HDmalloc((size_t)block_rank * sizeof(hsize_t)))) + H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate block buffer"); + + jlp = (jlong *)blockP; + for (i = 0; i < block_rank; i++) { + *lp = (hsize_t)*jlp; + lp++; + jlp++; + } /* end for */ + } + + if ((sid = H5Scombine_hyperslab(space_id, (H5S_seloper_t)op, (const hsize_t *)strt, (const hsize_t *)strd, + (const hsize_t *)cnt, (const hsize_t *)blk)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + if (blk) + HDfree(blk); + if (blockP) + UNPIN_LONG_ARRAY(ENVONLY, block, blockP, JNI_ABORT); + if (strd) + HDfree(strd); + if (strideP) + UNPIN_LONG_ARRAY(ENVONLY, stride, strideP, JNI_ABORT); + if (cnt) + HDfree(cnt); + if (countP) + UNPIN_LONG_ARRAY(ENVONLY, count, countP, JNI_ABORT); + if (strt) + HDfree(strt); + if (startP) + UNPIN_LONG_ARRAY(ENVONLY, start, startP, JNI_ABORT); + + return (jlong)sid; +} /* end Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Smodify_select + * Signature: (JIJ)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5Smodify_1select(JNIEnv *env, jclass clss, jlong space1_id, jint op, jlong space2_id) +{ + herr_t status = FAIL; + + UNUSED(clss); + + if ((status = H5Smodify_select((hid_t)space1_id, (H5S_seloper_t)op, (hid_t)space2_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + return; +} /* end Java_hdf_hdf5lib_H5_H5Smodify_1select */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Scombine_select + * Signature: (JIJ)J + */ +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_H5_H5Scombine_1select(JNIEnv *env, jclass clss, jlong space1_id, jint op, jlong space2_id) +{ + hid_t sid = H5I_INVALID_HID; + + UNUSED(clss); + + if ((sid = H5Scombine_select((hid_t)space1_id, (H5S_seloper_t)op, (hid_t)space2_id)) < 0) + H5_LIBRARY_ERROR(ENVONLY); + +done: + + return (jlong)sid; +} /* end Java_hdf_hdf5lib_H5_H5Scombine_1select */ + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5sImp.h b/java/src/jni/h5sImp.h index ee28b39..83255c1 100644 --- a/java/src/jni/h5sImp.h +++ b/java/src/jni/h5sImp.h @@ -259,6 +259,65 @@ JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Sis_1regular_1hyperslab(JNIEnv JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab(JNIEnv *, jclass, jlong, jlongArray, jlongArray, jlongArray, jlongArray); +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_copy + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1copy(JNIEnv *, jclass, jlong, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_shape_same + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1shape_1same(JNIEnv *, jclass, jlong, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_adjust + * Signature: (J[J)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1adjust(JNIEnv *, jclass, jlong, jlongArray); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_intersect_block + * Signature: (J[J[J)Z + */ +JNIEXPORT jboolean JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block(JNIEnv *, jclass, jlong, + jlongArray, jlongArray); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Sselect_project_intersection + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Sselect_1project_1intersection(JNIEnv *, jclass, jlong, jlong, + jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Scombine_hyperslab + * Signature: (JI[J[J[J[J)J + */ +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *, jclass, jlong, jint, jlongArray, + jlongArray, jlongArray, jlongArray); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Smodify_select + * Signature: (JIJ)V + */ +JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5Smodify_1select(JNIEnv *, jclass, jlong, jint, jlong); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5Scombine_select + * Signature: (JIJ)J + */ +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_H5_H5Scombine_1select(JNIEnv *, jclass, jlong, jint, jlong); + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/test/TestH5Sbasic.java b/java/test/TestH5Sbasic.java index 2173647..9874584 100644 --- a/java/test/TestH5Sbasic.java +++ b/java/test/TestH5Sbasic.java @@ -242,4 +242,142 @@ public class TestH5Sbasic { H5.H5Sdecode(null); } + @Test(expected = IllegalArgumentException.class) + public void testH5Sget_regular_hyperslab_invalid() throws Throwable { + long q_start[] = new long[2]; + long q_stride[] = new long[2]; + long q_count[] = new long[2]; + long q_block[] = new long[2]; + + H5.H5Sget_regular_hyperslab(-1, q_start, q_stride, q_count, q_block); + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class) + public void testH5Sselect_copy_invalid() throws Throwable { + H5.H5Sselect_copy(-1, -1); + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5DataspaceInterfaceException.class) + public void testH5Sselect_shape_same_invalid() throws Throwable { + H5.H5Sselect_shape_same(-1, -1); + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_adjust_invalid() throws Throwable { + long offset[][] = {{0,1},{2,4},{5,6}}; + H5.H5Sselect_adjust(-1, offset); + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_adjust_rank_offset() throws Throwable { + long sid = -1; + long offset[][] = {{0,1},{2,4},{5,6}}; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Sselect_adjust(sid, offset); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_intersect_block_invalid() throws Throwable { + long start[] = new long[2]; + long end[] = new long[2]; + H5.H5Sselect_intersect_block(-1, start, end); + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_intersect_block_rank_start() throws Throwable { + long sid = -1; + long start[] = new long[2]; + long end[] = null; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Sselect_intersect_block(sid, start, end); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = IllegalArgumentException.class) + public void testH5Sselect_intersect_block_rank_end() throws Throwable { + long sid = -1; + long start[] = null; + long end[] = new long[2]; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Sselect_intersect_block(sid, start, end); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5DataspaceInterfaceException.class) + public void testH5Sselect_project_intersection_invalid() throws Throwable { + H5.H5Sselect_project_intersection(-1, -1, -1); + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class) + public void testH5Scombine_hyperslab_invalid() throws Throwable { + long start[] = new long[2]; + long count[] = new long[2]; + H5.H5Scombine_hyperslab(-1, 0, start, null, count, null); + } + + @Test(expected = NullPointerException.class) + public void testH5Scombine_hyperslab_null_start() throws Throwable { + long sid = -1; + long start[] = null; + long stride[] = null; + long count[] = new long[2]; + long block[] = null; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Scombine_hyperslab(sid, 0, start, stride, count, block); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = NullPointerException.class) + public void testH5Scombine_hyperslab_null_count() throws Throwable { + long sid = -1; + long start[] = new long[2]; + long stride[] = null; + long count[] = null; + long block[] = null; + + try { + sid = H5.H5Screate(HDF5Constants.H5S_SIMPLE); + assertTrue("H5.H5Screate_simple_extent",sid > 0); + H5.H5Scombine_hyperslab(sid, 0, start, stride, count, block); + } + finally { + try {H5.H5Sclose(sid);} catch (Exception ex) {} + } + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class) + public void testH5Smodify_select_invalid() throws Throwable { + H5.H5Smodify_select(-1, 0, -1); + } + + @Test(expected = hdf.hdf5lib.exceptions.HDF5FunctionArgumentException.class) + public void testH5Scombine_select_invalid() throws Throwable { + H5.H5Scombine_select(-1, 0, -1); + } + } diff --git a/java/test/testfiles/JUnit-TestH5Sbasic.txt b/java/test/testfiles/JUnit-TestH5Sbasic.txt index 707878e..3422442 100644 --- a/java/test/testfiles/JUnit-TestH5Sbasic.txt +++ b/java/test/testfiles/JUnit-TestH5Sbasic.txt @@ -5,18 +5,32 @@ JUnit version 4.11 .testH5Sdecode_null .testH5Screate_simple_dims_exceed .testH5Screate_simple_unlimted_1d +.testH5Sselect_intersect_block_rank_start +.testH5Sget_regular_hyperslab_invalid +.testH5Sselect_adjust_rank_offset .testH5Screate_simple_dims_invalid .testH5Screate_scalar .testH5Screate_simple +.testH5Sselect_project_intersection_invalid .testH5Screate_simple_rank_invalid .testH5Sget_simple_extent_type_invalid +.testH5Scombine_hyperslab_invalid +.testH5Scombine_hyperslab_null_count +.testH5Scombine_hyperslab_null_start .testH5Sencode_invalid .testH5Screate_null .testH5Screate_simple_extent .testH5Screate_invalid +.testH5Sselect_intersect_block_invalid +.testH5Sselect_adjust_invalid .testH5Screate_simple_unlimted +.testH5Sselect_shape_same_invalid +.testH5Smodify_select_invalid +.testH5Scombine_select_invalid +.testH5Sselect_copy_invalid +.testH5Sselect_intersect_block_rank_end Time: XXXX -OK (16 tests) +OK (30 tests) -- cgit v0.12 From 2bdad92a26662256704deed7974ea81a0635a6b9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 5 Nov 2020 11:30:04 -0600 Subject: HDFFV-10868 add release note --- release_docs/RELEASE.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 654d2c0..9942c19 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -86,7 +86,14 @@ New Features Java Library: ---------------- - - + - Added new H5S functions. + + H5Sselect_copy, H5Sselect_shape_same, H5Sselect_adjust, + H5Sselect_intersect_block, H5Sselect_project_intersection, + H5Scombine_hyperslab, H5Smodify_select, H5Scombine_select + wrapper functions added. + + (ADB - 2020/10/27, HDFFV-10868) Tools: ------ -- cgit v0.12