[svn-r29227] HDFFV-9552: merge in java code.

new files added.
This commit is contained in:
Allen Byrne 2016-02-28 21:45:23 -05:00
parent 63249be0e1
commit 198ceb5fcc
26 changed files with 2114 additions and 0 deletions

View File

@ -0,0 +1,23 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
import hdf.hdf5lib.structs.H5A_info_t;
//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);
}

View File

@ -0,0 +1,22 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
public interface H5A_iterate_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
*/
}

View File

@ -0,0 +1,23 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
import hdf.hdf5lib.structs.H5E_error2_t;
//Information class for link callback(for H5Ewalk)
public interface H5E_walk_cb extends Callbacks {
int callback(int nidx, H5E_error2_t info, H5E_walk_t op_data);
}

View File

@ -0,0 +1,22 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
public interface H5E_walk_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
*/
}

View File

@ -0,0 +1,21 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
//Information class for link callback(for H5Pcreate_class)
public interface H5P_cls_close_func_cb extends Callbacks {
int callback(long prop_id, H5P_cls_close_func_t close_data);
}

View File

@ -0,0 +1,22 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
public interface H5P_cls_close_func_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
*/
}

View File

@ -0,0 +1,21 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
//Information class for link callback(for H5Pcreate_class)
public interface H5P_cls_copy_func_cb extends Callbacks {
int callback(long new_prop_id, long old_prop_id, H5P_cls_copy_func_t copy_data);
}

View File

@ -0,0 +1,22 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
public interface H5P_cls_copy_func_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
*/
}

View File

@ -0,0 +1,21 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
//Information class for link callback(for H5Pcreate_class)
public interface H5P_cls_create_func_cb extends Callbacks {
int callback(long prop_id, H5P_cls_create_func_t create_data);
}

View File

@ -0,0 +1,22 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
public interface H5P_cls_create_func_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
*/
}

View File

@ -0,0 +1,21 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
//Information class for link callback(for H5Piterate)
public interface H5P_iterate_cb extends Callbacks {
int callback(long plist, String name, H5P_iterate_t op_data);
}

View File

@ -0,0 +1,22 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
public interface H5P_iterate_t {
/** public ArrayList iterdata = new ArrayList();
* Any derived interfaces must define the single public variable as above.
*/
}

View File

@ -0,0 +1,21 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
//Information class for link callback(for H5Pregister2)
public interface H5P_prp_close_func_cb extends Callbacks {
int callback(String name, long size, byte[] value);
}

View File

@ -0,0 +1,21 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
//Information class for link callback(for H5Pregister2)
public interface H5P_prp_compare_func_cb extends Callbacks {
int callback(byte[] value1, byte[] value2, long size);
}

View File

@ -0,0 +1,21 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
//Information class for link callback(for H5Pregister2)
public interface H5P_prp_copy_func_cb extends Callbacks {
int callback(String name, long size, byte[] value);
}

View File

@ -0,0 +1,21 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
//Information class for link callback(for H5Pregister2)
public interface H5P_prp_create_func_cb extends Callbacks {
int callback(String name, long size, byte[] value);
}

View File

@ -0,0 +1,21 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
//Information class for link callback(for H5Pregister2)
public interface H5P_prp_delete_func_cb extends Callbacks {
int callback(long prop_id, String name, long size, byte[] value);
}

View File

@ -0,0 +1,21 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
//Information class for link callback(for H5Pregister2)
public interface H5P_prp_get_func_cb extends Callbacks {
int callback(long prop_id, String name, long size, byte[] value);
}

View File

@ -0,0 +1,21 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.callbacks;
//Information class for link callback(for H5Pregister2)
public interface H5P_prp_set_func_cb extends Callbacks {
int callback(long prop_id, String name, long size, byte[] value);
}

View File

@ -0,0 +1,41 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.structs;
import java.io.Serializable;
//Information struct for Attribute (For H5Ewalk)
public class H5E_error2_t implements Serializable{
private static final long serialVersionUID = 279144359041667613L;
public long cls_id; //class ID
public long maj_num; //major error ID
public long min_num; //minor error number
public int line; //line in file where error occurs
public String func_name; //function in which error occurred
public String file_name; //file in which error occurred
public String desc; //optional supplied description
H5E_error2_t(long cls_id, long maj_num, long min_num, int line, String func_name, String file_name, String desc) {
this.cls_id = cls_id;
this.maj_num = maj_num;
this.min_num = min_num;
this.line = line;
this.func_name = func_name;
this.file_name = file_name;
this.desc = desc;
}
}

View File

@ -0,0 +1,47 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package hdf.hdf5lib.structs;
import java.io.Serializable;
//Information struct for object (for H5Fget_info)
public class H5F_info2_t implements Serializable{
private static final long serialVersionUID = 4691681162544054518L;
public int super_version; // Superblock version #
public long super_size; // Superblock size
public long super_ext_size; // Superblock extension size
public int free_version; // Version # of file free space management
public long free_meta_size; // Free space manager metadata size
public long free_tot_space; // Amount of free space in the file
public int sohm_version; // Version # of shared object header info
public long sohm_hdr_size; // Shared object header message header size
public H5_ih_info_t sohm_msgs_info; // Shared object header message index & heap size
public H5F_info2_t (int super_version, long super_size, long super_ext_size,
int free_version, long free_meta_size, long free_tot_space,
int sohm_version, long sohm_hdr_size, H5_ih_info_t sohm_msgs_info)
{
this.super_version = super_version;
this.super_size = super_size;
this.super_ext_size = super_ext_size;
this.free_version = free_version;
this.free_meta_size = free_meta_size;
this.free_tot_space = free_tot_space;
this.sohm_version = sohm_version;
this.sohm_hdr_size = sohm_hdr_size;
this.sohm_msgs_info = sohm_msgs_info;
}
}

64
java/src/jni/h5plImp.c Normal file
View File

@ -0,0 +1,64 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* For details of the HDF libraries, see the HDF Documentation at:
* http://hdfdfgroup.org/HDF5/doc/
*
*/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "hdf5.h"
#include <stdlib.h>
#include "h5jni.h"
#include "h5plImp.h"
extern JavaVM *jvm;
extern jobject visit_callback;
/*
* Class: hdf_hdf5lib_H5
* Method: H5PLset_loading_state
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLset_1loading_1state
(JNIEnv *env, jclass clss, jint plugin_flags)
{
if (H5PLset_loading_state((unsigned int)plugin_flags) < 0) {
h5libraryError(env);
}
}
/*
* Class: hdf_hdf5lib_H5
* Method: H5PLget_loading_state
* Signature: (V)I
*/
JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5PLget_1loading_1state
(JNIEnv *env, jclass clss)
{
unsigned int plugin_type = 0;
if (H5PLget_loading_state(&plugin_type) < 0) {
h5libraryError(env);
}
return (jint)plugin_type;
}
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */

46
java/src/jni/h5plImp.h Normal file
View File

@ -0,0 +1,46 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <jni.h>
/* Header for class hdf_hdf5lib_H5_H5PL */
#ifndef _Included_hdf_hdf5lib_H5_H5PL
#define _Included_hdf_hdf5lib_H5_H5PL
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* Class: hdf_hdf5lib_H5
* Method: H5PLset_loading_state
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_hdf_hdf5lib_H5_H5PLset_1loading_1state
(JNIEnv *, jclass, jint);
/*
* Class: hdf_hdf5lib_H5
* Method: H5PLget_loading_state
* Signature: (V)I
*/
JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5PLget_1loading_1state
(JNIEnv *, jclass);
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
#endif /* _Included_hdf_hdf5lib_H5_H5PL */

61
java/test/TestH5PL.java Normal file
View File

@ -0,0 +1,61 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package test;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import hdf.hdf5lib.H5;
import hdf.hdf5lib.HDF5Constants;
import hdf.hdf5lib.exceptions.HDF5LibraryException;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
public class TestH5PL {
@Rule public TestName testname = new TestName();
@Before
public void checkOpenIDs() {
assertTrue("H5 open ids is 0",H5.getOpenIDCount()==0);
System.out.print(testname.getMethodName());
}
@After
public void nextTestName() {
System.out.println();
}
@Test
public void TestH5PLplugins() {
try {
int plugin_flags = H5.H5PLget_loading_state();
assertTrue("H5.H5PLget_loading_state: "+plugin_flags, plugin_flags == HDF5Constants.H5PL_ALL_PLUGIN);
int new_setting = plugin_flags & ~HDF5Constants.H5PL_FILTER_PLUGIN;
H5.H5PLset_loading_state (new_setting);
int changed_flags = H5.H5PLget_loading_state();
assertTrue("H5.H5PLget_loading_state: "+changed_flags, changed_flags == new_setting);
H5.H5PLset_loading_state (plugin_flags);
changed_flags = H5.H5PLget_loading_state();
assertTrue("H5.H5PLget_loading_state: "+changed_flags, changed_flags == HDF5Constants.H5PL_ALL_PLUGIN);
}
catch (Throwable err) {
err.printStackTrace();
fail("TestH5PLplugins " + err);
}
}
}

1013
java/test/TestH5Plist.java Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,433 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.File;
import hdf.hdf5lib.H5;
import hdf.hdf5lib.HDF5Constants;
import hdf.hdf5lib.exceptions.HDF5Exception;
import hdf.hdf5lib.exceptions.HDF5LibraryException;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
public class TestH5Pvirtual {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "vds.h5";
private static final String SRC_FILE[] = {
"v-0.h5",
"v-1.h5",
"v-2.h5"
};
private static final String SRC_DATASET[] = {
"A",
"B",
"C"
};
private static final int DIM_Y = 6;
private static final int VDSDIM_X = 4;
private static final int VDSDIM_Y = 6;
private static final int fill_value = -1;
long[] H5dims = { DIM_Y };
long[] VDSH5dims = { VDSDIM_X, VDSDIM_Y };
long H5fid = -1;
long H5dsid = -1;
long H5dssid = -1;
long H5dvsid = -1;
long H5did = -1;
long H5dcplid = -1;
long H5dapl_id = -1;
private final void _deleteFile(String filename) {
File file = new File(filename);
if (file.exists()) {
try {file.delete();} catch (SecurityException e) {}
}
}
private final long _createDataset(long fid, long dsid, String name, long dcpl, long dapl) {
long did = -1;
long space_id = -1;
long[] start = {0, 0};
long[] stride = null;
long[] count = {1, 1};
long[] block = {1, VDSDIM_Y};
try {
H5dssid = H5.H5Screate_simple(1, H5dims, null);
for (int i = 0; i < 3; i++) {
start[0] = i;
/* Select i-th row in the virtual dataset; selection in the source datasets is the same. */
H5.H5Sselect_hyperslab(dsid, HDF5Constants.H5S_SELECT_SET, start, stride, count, block);
H5.H5Pset_virtual(dcpl, dsid, SRC_FILE[i], SRC_DATASET[i], H5dssid);
}
did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_NATIVE_INT, dsid,
HDF5Constants.H5P_DEFAULT, dcpl, dapl);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Dcreate: " + err);
}
assertTrue("TestH5Pvirtual._createDataset: ", did > 0);
return did;
}
private final void _createH5File(long fcpl, long fapl) {
int[] dset_data = new int[DIM_Y];
// Create source files and datasets
for (int i=0; i < 3; i++) {
long space_id = -1;
long dset_id = -1;
long file_id = -1;
for (int j = 0; j < DIM_Y; j++) dset_data[j] = i+1;
try {
file_id = H5.H5Fcreate(SRC_FILE[i], HDF5Constants.H5F_ACC_TRUNC,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
space_id = H5.H5Screate_simple(1, H5dims, null);
dset_id = H5.H5Dcreate(file_id, SRC_DATASET[i], HDF5Constants.H5T_NATIVE_INT, space_id,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
H5.H5Dwrite (dset_id, HDF5Constants.H5T_NATIVE_INT, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT,
dset_data);
}
catch (Throwable err) {
err.printStackTrace();
fail("TestH5Pvirtual.createH5file: " + err);
}
finally {
if (dset_id > 0)
try {H5.H5Dclose(dset_id);} catch (Exception ex) {}
if (space_id > 0)
try {H5.H5Sclose(space_id);} catch (Exception ex) {}
if (file_id > 0)
try {H5.H5Fclose(file_id);} catch (Exception ex) {}
}
}
try {
int[] fill_value = {-1};
H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
H5dsid = H5.H5Screate_simple(2, VDSH5dims, null);
H5dcplid = H5.H5Pcreate(HDF5Constants.H5P_DATASET_CREATE);
H5.H5Pset_fill_value(H5dcplid, HDF5Constants.H5T_NATIVE_INT, fill_value);
}
catch (Throwable err) {
err.printStackTrace();
fail("TestH5Pvirtual.createH5file: " + err);
}
assertTrue("TestH5Pvirtual.createH5file: H5.H5Fcreate: ", H5fid > 0);
assertTrue("TestH5Pvirtual.createH5file: H5.H5Screate_simple: ", H5dsid > 0);
assertTrue("TestH5Pvirtual.createH5file: H5.H5Pcreate: ", H5dcplid > 0);
try {
H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL);
}
catch (Throwable err) {
err.printStackTrace();
}
}
@Before
public void createH5file()
throws NullPointerException, HDF5Exception {
assertTrue("H5 open ids is 0",H5.getOpenIDCount()==0);
System.out.print(testname.getMethodName());
_createH5File(HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
H5dapl_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_ACCESS);
assertTrue("TestH5Pvirtual.createH5file: H5.H5Pcreate: ", H5dapl_id > 0);
}
@After
public void deleteH5file() throws HDF5LibraryException {
if (H5dapl_id > 0)
try {H5.H5Pclose(H5dapl_id);} catch (Exception ex) {}
if (H5dcplid > 0)
try {H5.H5Pclose(H5dcplid);} catch (Exception ex) {}
if (H5dsid > 0)
try {H5.H5Sclose(H5dsid);} catch (Exception ex) {}
if (H5fid > 0)
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
for (int i = 0; i < 3; i++) {
_deleteFile(SRC_FILE[i]);
}
_deleteFile(H5_FILE);
System.out.println();
}
@Test
public void testH5Pvirtual_storage() {
int layout = -1;
H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id);
try {
layout = H5.H5Pget_layout (H5dcplid);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Pget_layout: " + err);
}
finally {
if (H5dssid > 0)
try {H5.H5Sclose(H5dssid);} catch (Exception ex) {}
if (H5did > 0)
try {H5.H5Dclose(H5did);} catch (Exception ex) {}
}
assertTrue("testH5Pvirtual_storage", HDF5Constants.H5D_VIRTUAL == layout);
}
@Test
public void testH5Pget_virtual_count() {
long num_map = -1;
H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id);
try {
num_map = H5.H5Pget_virtual_count(H5dcplid);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Pget_virtual_count: " + err);
}
finally {
if (H5dssid > 0)
try {H5.H5Sclose(H5dssid);} catch (Exception ex) {}
if (H5did > 0)
try {H5.H5Dclose(H5did);} catch (Exception ex) {}
}
assertTrue("testH5Pget_virtual_count: "+num_map, num_map >= 0);
}
@Test
public void testH5Pget_source_filename() throws Throwable {
String filename = null;
H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id);
try {
filename = (H5.H5Pget_virtual_filename (H5dcplid, 2));
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Pget_virtual_filename: " + err);
}
finally {
if (H5dssid > 0)
try {H5.H5Sclose(H5dssid);} catch (Exception ex) {}
if (H5did > 0)
try {H5.H5Dclose(H5did);} catch (Exception ex) {}
}
assertTrue("testH5Pget_source_filename: "+filename, filename.compareTo("v-2.h5") == 0);
}
@Test
public void testH5Pget_source_datasetname() throws Throwable {
String datasetname = null;
H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id);
try {
datasetname = H5.H5Pget_virtual_dsetname (H5dcplid, 1);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Pget_virtual_dsetname: " + err);
}
finally {
if (H5dssid > 0)
try {H5.H5Sclose(H5dssid);} catch (Exception ex) {}
if (H5did > 0)
try {H5.H5Dclose(H5did);} catch (Exception ex) {}
}
assertTrue("testH5Pget_source_datasetname: "+datasetname, datasetname.compareTo("B") == 0);
}
@Test
public void testH5Pget_selection_source_dataset() throws Throwable {
long src_space = -1;
long src_selection = -1;
H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id);
try {
src_space = H5.H5Pget_virtual_srcspace (H5dcplid, 0);
src_selection = H5.H5Sget_select_type(src_space);
}
catch (Throwable err) {
err.printStackTrace();
fail("testH5Pget_selection_source_dataset: " + err);
}
finally {
if (src_space > 0)
try {H5.H5Sclose(src_space);} catch (Exception ex) {}
if (H5dssid > 0)
try {H5.H5Sclose(H5dssid);} catch (Exception ex) {}
if (H5did > 0)
try {H5.H5Dclose(H5did);} catch (Exception ex) {}
}
assertTrue("testH5Pget_selection_source_dataset", src_selection == HDF5Constants.H5S_SEL_ALL);
}
@Test
public void testH5Pget_mapping_parameters() {
long num_map = -1;
H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id);
try {
try {
num_map = H5.H5Pget_virtual_count(H5dcplid);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Pget_virtual_count: " + err);
}
for (int i = 0; i < num_map; i++) {
int vselection = -1;
long vspace = -1;
long nblocks; // Number of hyperslab blocks
long blocks[] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; // List of blocks
long[] start = {i, 0};
long[] stride = {1, 1};
long[] count = {1, 1};
long[] block = {1, VDSDIM_Y};
long q_start[] = new long[2];
long q_stride[] = new long[2];
long q_count[] = new long[2];
long q_block[] = new long[2];
boolean is_regular = false;
try {
try {
vspace = H5.H5Pget_virtual_vspace (H5dcplid, i);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Pget_virtual_vspace: " + err);
}
try {
vselection = H5.H5Sget_select_type(vspace);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.H5Sget_select_type: " + err);
}
assertTrue("testH5Pget_mapping_parameters["+i+"]", vselection == HDF5Constants.H5S_SEL_HYPERSLABS);
// Verify that there is only one block
nblocks = H5.H5Sget_select_hyper_nblocks(vspace);
assertTrue("H5Sget_select_hyper_nblocks", nblocks == 1);
// Retrieve the block defined
H5.H5Sget_select_hyper_blocklist(vspace, 0, nblocks, blocks);
// Verify that the correct block is defined
assertTrue("H5.H5Sget_select_hyper_blocklist["+i+"] [0]: "+blocks[0], start[0] == blocks[0]);
assertTrue("H5.H5Sget_select_hyper_blocklist["+i+"] [1]: "+blocks[1], start[1] == blocks[1]);
assertTrue("H5.H5Sget_select_hyper_blocklist["+i+"] [2]: "+blocks[2], (block[0]-1+i) == blocks[2]);
assertTrue("H5.H5Sget_select_hyper_blocklist["+i+"] [3]: "+blocks[3], (block[1]-1) == blocks[3]);
// We also can use new APIs to get start, stride, count and block
is_regular = H5.H5Sis_regular_hyperslab(vspace);
assertTrue("H5.H5Sis_regular_hyperslab", is_regular);
H5.H5Sget_regular_hyperslab (vspace, q_start, q_stride, q_count, q_block);
// Verify the hyperslab parameters
for(int u = 0; u < 2; u++) {
assertTrue("H5Sget_regular_hyperslab, start", start[u] == q_start[u]);
assertTrue("H5Sget_regular_hyperslab, stride", stride[u] == q_stride[u]);
assertTrue("H5Sget_regular_hyperslab, count", count[u] == q_count[u]);
assertTrue("H5Sget_regular_hyperslab, block", block[u] == q_block[u]);
}
}
catch (Throwable err) {
err.printStackTrace();
fail("H5.testH5Pget_mapping_parameters: " + err);
}
finally {
if (vspace > 0)
try {H5.H5Sclose(vspace);} catch (Exception ex) {}
}
}
}
catch (Throwable err) {
err.printStackTrace();
fail("testH5Pget_mapping_parameters: " + err);
}
finally {
if (H5dssid > 0)
try {H5.H5Sclose(H5dssid);} catch (Exception ex) {}
if (H5did > 0)
try {H5.H5Dclose(H5did);} catch (Exception ex) {}
}
}
@Test
public void testH5Pset_get_virtual_view() {
int ret_val = -1;
H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id);
try {
ret_val = H5.H5Pget_virtual_view(H5dapl_id);
assertTrue("H5Pget_virtual_view", ret_val >= 0);
assertEquals(HDF5Constants.H5D_VDS_LAST_AVAILABLE, ret_val);
H5.H5Pset_virtual_view(H5dapl_id, HDF5Constants.H5D_VDS_FIRST_MISSING);
ret_val = H5.H5Pget_virtual_view(H5dapl_id);
assertTrue("H5Pget_virtual_view", ret_val >= 0);
assertEquals(HDF5Constants.H5D_VDS_FIRST_MISSING, ret_val);
}
catch (Throwable err) {
err.printStackTrace();
fail("testH5Pset_get_virtual_view: " + err);
}
finally {
if (H5dssid > 0)
try {H5.H5Sclose(H5dssid);} catch (Exception ex) {}
if (H5did > 0)
try {H5.H5Dclose(H5did);} catch (Exception ex) {}
}
}
@Ignore
public void testH5Pset_get_virtual_printf_gap() {
long ret_val = -1;
H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id);
try {
ret_val = H5.H5Pget_virtual_printf_gap(H5dapl_id);
assertTrue("H5Pget_virtual_printf_gap", ret_val >= 0);
assertEquals(0, ret_val);
H5.H5Pset_virtual_printf_gap(H5dapl_id, 2);
ret_val = H5.H5Pget_virtual_view(H5dapl_id);
assertTrue("H5Pget_virtual_printf_gap", ret_val >= 0);
assertEquals(2, ret_val);
}
catch (Throwable err) {
err.printStackTrace();
fail("H5Pset_get_virtual_printf_gap: " + err);
}
finally {
if (H5dssid > 0)
try {H5.H5Sclose(H5dssid);} catch (Exception ex) {}
if (H5did > 0)
try {H5.H5Dclose(H5did);} catch (Exception ex) {}
}
}
}