mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Remove need for HDF5-1.6 API being defined
This commit is contained in:
parent
e6bdee5930
commit
cbcee382b0
@ -769,30 +769,6 @@ IF(USE_HDF5)
|
||||
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5allocate_memory "" HAVE_H5ALLOCATE_MEMORY)
|
||||
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5resize_memory "" HAVE_H5RESIZE_MEMORY)
|
||||
|
||||
##
|
||||
# Starting with libhdf5 1.12.0, we need to specify the option
|
||||
# `--with-default-api-version=v18` when configuring libhdf5. Otherwise,
|
||||
# the symbol H5Literate is not found. Check for this and return an error if it's not found.
|
||||
#
|
||||
# We first check for the symbol in the library, for versions 1.8.x and 1.10.x. If this fails,
|
||||
# we must then check for its usage as a macro (version 1.12.x).
|
||||
##
|
||||
|
||||
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Literate "" HAVE_H5Literate)
|
||||
|
||||
IF(NOT HAVE_H5Literate)
|
||||
CHECK_C_SOURCE_COMPILES("#include <H5public.h>
|
||||
#if !(H5Literate_vers == 1)
|
||||
#error
|
||||
#endif
|
||||
int main() {int x = 1;}" HAVE_H5Literate_Macro)
|
||||
ELSE()
|
||||
SET(HAVE_H5Literate_Macro 1)
|
||||
ENDIF(NOT HAVE_H5Literate)
|
||||
|
||||
IF(NOT HAVE_H5Literate_Macro)
|
||||
MESSAGE(FATAL_ERROR "${HDF5_C_LIBRARY_hdf5} does not contain symbol '_H5Literate'. Please recompile your libhdf5 install using '--with-default-api-version=v18'.")
|
||||
ENDIF(NOT HAVE_H5Literate_Macro)
|
||||
|
||||
##
|
||||
# End H5Literate checks
|
||||
@ -847,12 +823,6 @@ IF(USE_HDF5)
|
||||
|
||||
MESSAGE("-- Checking for HDF5 version 1.10.6 or later: ${HDF5_UTF8_PATHS}")
|
||||
|
||||
SET(H5_USE_16_API 1)
|
||||
OPTION(NC_ENABLE_HDF_16_API "Enable HDF5 1.6.x Compatibility(Required)" ON)
|
||||
IF(NOT NC_ENABLE_HDF_16_API)
|
||||
SET(H5_USE_16_API 0)
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(HAVE_HDF5_H hdf5.h PATHS ${HDF5_INCLUDE_DIR} NO_DEFAULT_PATH)
|
||||
FIND_PATH(HAVE_HDF5_H hdf5.h)
|
||||
IF(NOT HAVE_HDF5_H)
|
||||
|
@ -302,7 +302,7 @@ init(int argc, char** argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
H5Eprint(stderr);
|
||||
H5Eprint1(stderr);
|
||||
init(argc,argv);
|
||||
if(test_bzip2() != NC_NOERR) ERRR;
|
||||
exit(nerrs > 0?1:0);
|
||||
|
@ -61,7 +61,7 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, EMP_GRP, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, EMP_GRP, 0)) < 0) ERR;
|
||||
|
||||
/* Create space fo zero-length attributes. */
|
||||
if ((spaceid = H5Screate(H5S_NULL)) < 0) ERR;
|
||||
@ -69,7 +69,7 @@ main()
|
||||
/* Attach some zero-length float attributes! */
|
||||
for (e = 0; e < NUM_EMPS; e++)
|
||||
{
|
||||
if ((attid = H5Acreate(grpid, emp[e], H5T_NATIVE_FLOAT, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, emp[e], H5T_NATIVE_FLOAT, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, H5T_NATIVE_FLOAT, &val) < 0) ERR;
|
||||
if (H5Aclose(attid) < 0) ERR;
|
||||
@ -83,7 +83,7 @@ main()
|
||||
/* Now open the file again and read in the attributes. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, EMP_GRP)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, EMP_GRP)) < 0) ERR;
|
||||
|
||||
/* How many attributes are there? */
|
||||
if ((num_obj = H5Aget_num_attrs(grpid)) != NUM_EMPS) ERR;
|
||||
@ -106,13 +106,13 @@ main()
|
||||
/* Create a file and open the root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Attach a text attribute with some of Hamlet's lines. */
|
||||
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
|
||||
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
|
||||
if (H5Tset_size(typeid, strlen(txt) + 1) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT1_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT1_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, txt) < 0) ERR;
|
||||
|
||||
@ -121,7 +121,7 @@ main()
|
||||
if (H5Adelete(grpid, ATT1_NAME) < 0) ERR;
|
||||
|
||||
/* Create and write it again. */
|
||||
if ((attid = H5Acreate(grpid, ATT1_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT1_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, txt) < 0) ERR;
|
||||
|
||||
@ -139,13 +139,13 @@ main()
|
||||
/* See if we can write an attribute to the root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Attach a text attribute with some of Hamlet's lines. */
|
||||
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
|
||||
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
|
||||
if (H5Tset_size(typeid, strlen(txt) + 1) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT1_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT1_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, txt) < 0) ERR;
|
||||
if (H5Aclose(attid) < 0 ||
|
||||
@ -160,13 +160,13 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Attach a text attribute with some of Hamlet's lines. */
|
||||
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
|
||||
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
|
||||
if (H5Tset_size(typeid, strlen(txt) + 1) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT1_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT1_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, txt) < 0) ERR;
|
||||
if (H5Aclose(attid) < 0 ||
|
||||
@ -178,7 +178,7 @@ main()
|
||||
/* Now open the file again and read in the attribute. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((attid = H5Aopen_name(grpid, ATT1_NAME)) < 0) ERR;
|
||||
if ((typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
|
||||
@ -224,7 +224,7 @@ main()
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0)
|
||||
ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0)
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0)
|
||||
ERR;
|
||||
|
||||
/* Attach a float attribute with no data. The
|
||||
@ -233,7 +233,7 @@ main()
|
||||
ERR;
|
||||
if ((typeid = H5Tcopy(H5T_NATIVE_FLOAT)) < 0)
|
||||
ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT1_NAME,
|
||||
if ((attid = H5Acreate1(grpid, ATT1_NAME,
|
||||
typeid, spaceid, H5P_DEFAULT)) < 0)
|
||||
ERR;
|
||||
if (H5Awrite(attid, H5T_NATIVE_FLOAT, &val) < 0) ERR;
|
||||
@ -246,7 +246,7 @@ main()
|
||||
/* Now open the file again and read in the attribute. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((attid = H5Aopen_name(grpid, ATT1_NAME)) < 0) ERR;
|
||||
if ((spaceid = H5Aget_space(attid)) < 0) ERR;
|
||||
if ((size = H5Sget_simple_extent_npoints(spaceid)) < 0) ERR;
|
||||
@ -258,7 +258,7 @@ main()
|
||||
if ((spaceid = H5Screate(H5S_NULL)) < 0) ERR;
|
||||
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
|
||||
if (H5Tset_size(typeid, 1) < 0) ERR;
|
||||
if ((attid1 = H5Acreate(grpid, ATT2_NAME, typeid, spaceid,
|
||||
if ((attid1 = H5Acreate1(grpid, ATT2_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid1, H5T_NATIVE_FLOAT, &val) < 0) ERR;
|
||||
if (H5Sclose(spaceid) < 0 ||
|
||||
@ -271,7 +271,7 @@ main()
|
||||
/* Now open the file again and read in the attribute. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((attid = H5Aopen_name(grpid, ATT2_NAME)) < 0) ERR;
|
||||
if ((spaceid = H5Aget_space(attid)) < 0) ERR;
|
||||
if ((size = H5Sget_simple_extent_npoints(spaceid)) < 0) ERR;
|
||||
@ -331,12 +331,12 @@ main()
|
||||
/* Create a file and get its root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create a dataset. */
|
||||
dims[0] = DIM1_LEN;
|
||||
if ((var_spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate(grpid, VAR_NAME, H5T_NATIVE_HBOOL,
|
||||
if ((datasetid = H5Dcreate1(grpid, VAR_NAME, H5T_NATIVE_HBOOL,
|
||||
var_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Attach three text attributes with some of Hamlet's lines to
|
||||
@ -347,7 +347,7 @@ main()
|
||||
for (i = 0; i < NUM_SPEECHES; i++)
|
||||
{
|
||||
if (H5Tset_size(typeid, strlen(speech[i]) + 1) < 0) ERR;
|
||||
if ((attid = H5Acreate(datasetid, speech_name[i], typeid, spaceid,
|
||||
if ((attid = H5Acreate1(datasetid, speech_name[i], typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, speech[i]) < 0) ERR;
|
||||
if (H5Aclose(attid) < 0) ERR;
|
||||
@ -366,7 +366,7 @@ main()
|
||||
/* Open file, group, and dataset. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, VAR_NAME)) < 0) ERR;
|
||||
|
||||
/* How many attributes are there? */
|
||||
@ -387,7 +387,7 @@ main()
|
||||
|
||||
/* Recreate it and add the attributes again. */
|
||||
if ((var_spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate(grpid, VAR_NAME, H5T_NATIVE_HBOOL,
|
||||
if ((datasetid = H5Dcreate1(grpid, VAR_NAME, H5T_NATIVE_HBOOL,
|
||||
var_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Attach three text attributes with some of Hamlet's lines to
|
||||
@ -398,7 +398,7 @@ main()
|
||||
for (i = 0; i < NUM_SPEECHES; i++)
|
||||
{
|
||||
if (H5Tset_size(typeid, strlen(speech[i]) + 1) < 0) ERR;
|
||||
if ((attid = H5Acreate(datasetid, speech_name[i], typeid, spaceid,
|
||||
if ((attid = H5Acreate1(datasetid, speech_name[i], typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, speech[i]) < 0) ERR;
|
||||
if (H5Aclose(attid) < 0) ERR;
|
||||
@ -506,7 +506,7 @@ main()
|
||||
|
||||
/* Write an attribute. */
|
||||
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, NC3_STRICT_ATT_NAME, H5T_NATIVE_INT,
|
||||
if ((attid = H5Acreate1(grpid, NC3_STRICT_ATT_NAME, H5T_NATIVE_INT,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, H5T_NATIVE_INT, &one) < 0) ERR;
|
||||
if (H5Sclose(spaceid) < 0) ERR;
|
||||
@ -558,17 +558,17 @@ main()
|
||||
H5P_CRT_ORDER_INDEXED)) < 0) ERR;
|
||||
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Write two group-level attributes containing byte attays of
|
||||
* length 2, call them "first" and "second". */
|
||||
dims[0] = DIM2_LEN;
|
||||
if ((att_spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, att_name[0], H5T_NATIVE_UCHAR,
|
||||
if ((attid = H5Acreate1(grpid, att_name[0], H5T_NATIVE_UCHAR,
|
||||
att_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, H5T_NATIVE_UCHAR, b) < 0) ERR;
|
||||
if (H5Aclose(attid) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid , att_name[1], H5T_NATIVE_UCHAR,
|
||||
if ((attid = H5Acreate1(grpid , att_name[1], H5T_NATIVE_UCHAR,
|
||||
att_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, H5T_NATIVE_UCHAR, b) < 0) ERR;
|
||||
if (H5Aclose(attid) < 0) ERR;
|
||||
@ -576,7 +576,7 @@ main()
|
||||
/* Create a dataset which will be a HDF5 dimension scale. */
|
||||
dims[0] = 1;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((dimscaleid = H5Dcreate(grpid, "D1", H5T_IEEE_F32BE,
|
||||
if ((dimscaleid = H5Dcreate1(grpid, "D1", H5T_IEEE_F32BE,
|
||||
spaceid, H5P_DEFAULT)) < 0)
|
||||
ERR;
|
||||
|
||||
@ -584,7 +584,7 @@ main()
|
||||
if (H5DSset_scale(dimscaleid, NULL) < 0) ERR;
|
||||
|
||||
/* Add another attribute to the group. Call it "third". */
|
||||
if ((attid = H5Acreate(grpid , att_name[2], H5T_NATIVE_UCHAR,
|
||||
if ((attid = H5Acreate1(grpid , att_name[2], H5T_NATIVE_UCHAR,
|
||||
att_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, H5T_NATIVE_UCHAR, b) < 0) ERR;
|
||||
if (H5Aclose(attid) < 0) ERR;
|
||||
@ -606,7 +606,7 @@ main()
|
||||
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
|
||||
fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* How many attributes are there? */
|
||||
if ((num_obj = H5Aget_num_attrs(grpid)) != 3) ERR;
|
||||
@ -649,14 +649,14 @@ main()
|
||||
|
||||
/* Create a file and get its root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* These will all be zero-length atts. */
|
||||
if ((att_spaceid = H5Screate(H5S_NULL)) < 0) ERR;
|
||||
|
||||
for (i = 0; i < NUM_SIMPLE_ATTS; i++)
|
||||
{
|
||||
if ((attid = H5Acreate(grpid, name[i], H5T_NATIVE_INT,
|
||||
if ((attid = H5Acreate1(grpid, name[i], H5T_NATIVE_INT,
|
||||
att_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Aclose(attid) < 0) ERR;
|
||||
}
|
||||
@ -672,7 +672,7 @@ main()
|
||||
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
|
||||
fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* How many attributes are there? */
|
||||
if ((num_obj = H5Aget_num_attrs(grpid)) != NUM_SIMPLE_ATTS) ERR;
|
||||
|
@ -106,21 +106,21 @@ main()
|
||||
H5T_NATIVE_FLOAT) < 0) ERR;
|
||||
if (H5Tinsert(s1_typeid, Y_NAME, offsetof(struct s1, y),
|
||||
H5T_NATIVE_DOUBLE) < 0) ERR;
|
||||
if (H5Tcommit(grpid, S1_TYPE_NAME, s1_typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, S1_TYPE_NAME, s1_typeid) < 0) ERR;
|
||||
|
||||
/* Create a vlen type. Its a vlen of struct s1. */
|
||||
if ((vlen_typeid = H5Tvlen_create(s1_typeid)) < 0) ERR;
|
||||
if (H5Tcommit(grpid, VLEN_TYPE_NAME, vlen_typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, VLEN_TYPE_NAME, vlen_typeid) < 0) ERR;
|
||||
|
||||
/* Create the struct s3 type, which contains the vlen. */
|
||||
if ((s3_typeid = H5Tcreate(H5T_COMPOUND, sizeof(struct s3))) < 0) ERR;
|
||||
if (H5Tinsert(s3_typeid, VL_NAME, offsetof(struct s3, data),
|
||||
vlen_typeid) < 0) ERR;
|
||||
if (H5Tcommit(grpid, S3_TYPE_NAME, s3_typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, S3_TYPE_NAME, s3_typeid) < 0) ERR;
|
||||
|
||||
/* Create an attribute of this new type. */
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, S3_ATT_NAME, s3_typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, S3_ATT_NAME, s3_typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, s3_typeid, cvc_out) < 0) ERR;
|
||||
|
||||
@ -141,7 +141,7 @@ main()
|
||||
|
||||
/* Reopen the file. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* How many objects in this group? (There should be 3, the
|
||||
* types. Atts don't count as objects to HDF5.) */
|
||||
@ -247,11 +247,11 @@ main()
|
||||
|
||||
/* Create a vlen type. Its a vlen of int. */
|
||||
if ((vlen_typeid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) ERR;
|
||||
if (H5Tcommit(grpid, VLEN_TYPE_NAME, vlen_typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, VLEN_TYPE_NAME, vlen_typeid) < 0) ERR;
|
||||
|
||||
/* Create an attribute of this new type. */
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT_NAME, vlen_typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT_NAME, vlen_typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, vlen_typeid, vc_out) < 0) ERR;
|
||||
|
||||
@ -270,7 +270,7 @@ main()
|
||||
|
||||
/* Reopen the file. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* How many objects in this group? (There should be 2, the
|
||||
* types. Atts don't count as objects to HDF5.) */
|
||||
|
@ -104,15 +104,15 @@ main()
|
||||
H5T_NATIVE_FLOAT) < 0) ERR;
|
||||
if (H5Tinsert(s1_typeid, Y_NAME, offsetof(struct s1, y),
|
||||
H5T_NATIVE_DOUBLE) < 0) ERR;
|
||||
if (H5Tcommit(grpid, S1_TYPE_NAME, s1_typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, S1_TYPE_NAME, s1_typeid) < 0) ERR;
|
||||
|
||||
/* Create a vlen type. Its a vlen of struct s1. */
|
||||
if ((vlen_typeid = H5Tvlen_create(s1_typeid)) < 0) ERR;
|
||||
if (H5Tcommit(grpid, VLEN_TYPE_NAME, vlen_typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, VLEN_TYPE_NAME, vlen_typeid) < 0) ERR;
|
||||
|
||||
/* Create an attribute of this new type. */
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT_NAME, vlen_typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT_NAME, vlen_typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, vlen_typeid, vc_out) < 0) ERR;
|
||||
|
||||
@ -132,7 +132,7 @@ main()
|
||||
|
||||
/* Reopen the file. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* How many objects in this group? (There should be 2, the
|
||||
* types. Atts don't count as objects to HDF5.) */
|
||||
|
@ -64,20 +64,20 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((osmonds_grpid = H5Gcreate(fileid, OSMONDS, 0)) < 0) ERR;
|
||||
if ((osmonds_grpid = H5Gcreate1(fileid, OSMONDS, 0)) < 0) ERR;
|
||||
|
||||
/* Create a simple compound type. */
|
||||
if ((typeid = H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) ERR;
|
||||
if (H5Tinsert(typeid, BEER_OR_WINE, HOFFSET(struct s1, i1), H5T_NATIVE_INT) < 0) ERR;
|
||||
if (H5Tinsert(typeid, LIQUOR, HOFFSET(struct s1, i2), H5T_NATIVE_INT) < 0) ERR;
|
||||
if (H5Tcommit(osmonds_grpid, COMPOUND_NAME, typeid) < 0) ERR;
|
||||
if (H5Tcommit1(osmonds_grpid, COMPOUND_NAME, typeid) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM1_LEN;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create a dataset of this compound type. */
|
||||
if ((datasetid = H5Dcreate(osmonds_grpid, BOOZE_VAR, typeid,
|
||||
if ((datasetid = H5Dcreate1(osmonds_grpid, BOOZE_VAR, typeid,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Write some data. */
|
||||
@ -93,7 +93,7 @@ main()
|
||||
|
||||
/* Now open the file and read it. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((osmonds_grpid = H5Gopen(fileid, OSMONDS)) < 0) ERR;
|
||||
if ((osmonds_grpid = H5Gopen1(fileid, OSMONDS)) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(osmonds_grpid, BOOZE_VAR)) < 0) ERR;
|
||||
if ((typeid = H5Dget_type(datasetid)) < 0) ERR;
|
||||
if (H5Tget_class(typeid) != H5T_COMPOUND) ERR;
|
||||
@ -116,21 +116,21 @@ main()
|
||||
/* Open file and create two group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((osmonds_grpid = H5Gcreate(fileid, OSMONDS, 0)) < 0) ERR;
|
||||
if ((who_grpid = H5Gcreate(fileid, WHO, 0)) < 0) ERR;
|
||||
if ((osmonds_grpid = H5Gcreate1(fileid, OSMONDS, 0)) < 0) ERR;
|
||||
if ((who_grpid = H5Gcreate1(fileid, WHO, 0)) < 0) ERR;
|
||||
|
||||
/* Create a simple compound type. */
|
||||
if ((typeid = H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) ERR;
|
||||
if (H5Tinsert(typeid, BEER_OR_WINE, HOFFSET(struct s1, i1), H5T_NATIVE_INT) < 0) ERR;
|
||||
if (H5Tinsert(typeid, LIQUOR, HOFFSET(struct s1, i2), H5T_NATIVE_INT) < 0) ERR;
|
||||
if (H5Tcommit(osmonds_grpid, COMPOUND_NAME, typeid) < 0) ERR;
|
||||
if (H5Tcommit1(osmonds_grpid, COMPOUND_NAME, typeid) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM1_LEN;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create a dataset of this compound type in the same group. */
|
||||
if ((datasetid = H5Dcreate(osmonds_grpid, BOOZE_VAR, typeid,
|
||||
if ((datasetid = H5Dcreate1(osmonds_grpid, BOOZE_VAR, typeid,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Write some data. */
|
||||
@ -138,7 +138,7 @@ main()
|
||||
H5P_DEFAULT, data) < 0) ERR;
|
||||
|
||||
/* Create a dataset of this compound type in a different group. */
|
||||
if ((datasetid1 = H5Dcreate(who_grpid, BOOZE_VAR, typeid,
|
||||
if ((datasetid1 = H5Dcreate1(who_grpid, BOOZE_VAR, typeid,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Write some data. */
|
||||
@ -163,7 +163,7 @@ main()
|
||||
|
||||
/* Now open the file and read it. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((osmonds_grpid = H5Gopen(fileid, OSMONDS)) < 0) ERR;
|
||||
if ((osmonds_grpid = H5Gopen1(fileid, OSMONDS)) < 0) ERR;
|
||||
if (H5Gget_num_objs(osmonds_grpid, &num_obj) < 0) ERR;
|
||||
for (i=0; i<num_obj; i++)
|
||||
{
|
||||
@ -175,7 +175,7 @@ main()
|
||||
if ((datasetid = H5Dopen1(osmonds_grpid, name)) < 0) ERR;
|
||||
break;
|
||||
case H5G_TYPE:
|
||||
if ((typeid = H5Topen(osmonds_grpid, name)) < 0) ERR;
|
||||
if ((typeid = H5Topen1(osmonds_grpid, name)) < 0) ERR;
|
||||
if (H5Tget_class(typeid) != H5T_COMPOUND) ERR;
|
||||
if (H5Tget_nmembers(typeid) != 2) ERR;
|
||||
if (strcmp(name, COMPOUND_NAME)) ERR;
|
||||
@ -186,7 +186,7 @@ main()
|
||||
}
|
||||
|
||||
/* Open the other dataset, and learn about its type. */
|
||||
if ((who_grpid = H5Gopen(fileid, WHO)) < 0) ERR;
|
||||
if ((who_grpid = H5Gopen1(fileid, WHO)) < 0) ERR;
|
||||
if ((datasetid1 = H5Dopen1(who_grpid, BOOZE_VAR)) < 0) ERR;
|
||||
if ((typeid1 = H5Dget_type(datasetid1)) < 0) ERR;
|
||||
if ((equal = H5Tequal(typeid, typeid1)) < 0) ERR;
|
||||
@ -214,23 +214,23 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((osmonds_grpid = H5Gcreate(fileid, OSMONDS, 0)) < 0) ERR;
|
||||
if ((osmonds_grpid = H5Gcreate1(fileid, OSMONDS, 0)) < 0) ERR;
|
||||
|
||||
/* Create an array type. */
|
||||
if ((array_typeid = H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL)) < 0) ERR;
|
||||
if ((array_typeid = H5Tarray_create1(H5T_NATIVE_INT, 1, array_dims, NULL)) < 0) ERR;
|
||||
|
||||
/* Create a compound type containing an array. */
|
||||
if ((typeid = H5Tcreate(H5T_COMPOUND, sizeof(struct s2))) < 0) ERR;
|
||||
if (H5Tinsert(typeid, BEER_OR_WINE, HOFFSET(struct s2, i1), array_typeid) < 0) ERR;
|
||||
if (H5Tinsert(typeid, LIQUOR, HOFFSET(struct s2, i2), H5T_NATIVE_INT) < 0) ERR;
|
||||
if (H5Tcommit(osmonds_grpid, COMPOUND_NAME, typeid) < 0) ERR;
|
||||
if (H5Tcommit1(osmonds_grpid, COMPOUND_NAME, typeid) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM1_LEN;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create a dataset of this compound type. */
|
||||
if ((datasetid = H5Dcreate(osmonds_grpid, BOOZE_VAR, typeid,
|
||||
if ((datasetid = H5Dcreate1(osmonds_grpid, BOOZE_VAR, typeid,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Write some data. */
|
||||
@ -247,7 +247,7 @@ main()
|
||||
|
||||
/* Now open the file and read it. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((osmonds_grpid = H5Gopen(fileid, OSMONDS)) < 0) ERR;
|
||||
if ((osmonds_grpid = H5Gopen1(fileid, OSMONDS)) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(osmonds_grpid, BOOZE_VAR)) < 0) ERR;
|
||||
if ((typeid = H5Dget_type(datasetid)) < 0) ERR;
|
||||
if (H5Tget_class(typeid) != H5T_COMPOUND) ERR;
|
||||
@ -310,7 +310,7 @@ main()
|
||||
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create a compound type containing some different types. */
|
||||
if ((typeid = H5Tcreate(H5T_COMPOUND, sizeof(struct obs_t))) < 0) ERR;
|
||||
@ -319,14 +319,14 @@ main()
|
||||
if (H5Tinsert(typeid, COUNT, HOFFSET(struct obs_t, count), H5T_NATIVE_INT) < 0) ERR;
|
||||
if (H5Tinsert(typeid, RELHUM, HOFFSET(struct obs_t, relhum), H5T_NATIVE_FLOAT) < 0) ERR;
|
||||
if (H5Tinsert(typeid, TIME, HOFFSET(struct obs_t, time), H5T_NATIVE_DOUBLE) < 0) ERR;
|
||||
if (H5Tcommit(grpid, OBS_T, typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, OBS_T, typeid) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM6_LEN;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create a dataset of this compound type. */
|
||||
if ((datasetid = H5Dcreate(grpid, OBS_VAR, typeid, spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate1(grpid, OBS_VAR, typeid, spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Write some data. */
|
||||
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT, obsdata) < 0) ERR;
|
||||
@ -340,7 +340,7 @@ main()
|
||||
|
||||
/* Now open the file and read it. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, OBS_VAR)) < 0) ERR;
|
||||
if ((typeid = H5Dget_type(datasetid)) < 0) ERR;
|
||||
if ((size_in = H5Tget_size(typeid)) == 0) ERR;
|
||||
@ -384,7 +384,7 @@ main()
|
||||
strcpy(file_in, REF_FILE_NAME);
|
||||
|
||||
if ((fileid = H5Fopen(file_in, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, OBS_VAR)) < 0) ERR;
|
||||
if ((typeid = H5Dget_type(datasetid)) < 0) ERR;
|
||||
if ((mem_type = H5Tget_native_type(typeid, H5T_DIR_DEFAULT)) < 0) ERR;
|
||||
@ -460,7 +460,7 @@ main()
|
||||
|
||||
/* Open file and get root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create a compound type. */
|
||||
if ((typeid_inner = H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) ERR;
|
||||
@ -478,14 +478,14 @@ main()
|
||||
if (H5Tinsert(typeid, "min_temp", HOFFSET(struct hr_rec, min_temp), H5T_NATIVE_FLOAT) < 0) ERR;
|
||||
if (H5Tinsert(typeid, "percent_transporter_errosion", HOFFSET(struct hr_rec, percent_transporter_errosion),
|
||||
H5T_NATIVE_DOUBLE) < 0) ERR;
|
||||
if (H5Tcommit(grpid, "hr_rec", typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, "hr_rec", typeid) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM1_LEN;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create a dataset of this compound type. */
|
||||
if ((datasetid = H5Dcreate(grpid, DATASET_NAME, typeid, spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate1(grpid, DATASET_NAME, typeid, spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Write some data. */
|
||||
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT, hr_data_out) < 0) ERR;
|
||||
@ -501,7 +501,7 @@ main()
|
||||
|
||||
/* Now open the file and read it. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, DATASET_NAME)) < 0) ERR;
|
||||
if ((typeid = H5Dget_type(datasetid)) < 0) ERR;
|
||||
if (H5Tget_class(typeid) != H5T_COMPOUND) ERR;
|
||||
@ -565,7 +565,7 @@ main()
|
||||
|
||||
/* Open file and get root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create a compound type. */
|
||||
if ((typeid_inner = H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) ERR;
|
||||
@ -585,14 +585,14 @@ main()
|
||||
if (H5Tinsert(typeid, "min_temp", HOFFSET(struct hr_rec, min_temp), H5T_NATIVE_FLOAT) < 0) ERR;
|
||||
if (H5Tinsert(typeid, "percent_transporter_errosion", HOFFSET(struct hr_rec, percent_transporter_errosion),
|
||||
H5T_NATIVE_DOUBLE) < 0) ERR;
|
||||
if (H5Tcommit(grpid, "hr_rec", typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, "hr_rec", typeid) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM1_LEN;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create a dataset of this compound type. */
|
||||
if ((datasetid = H5Dcreate(grpid, DATASET_NAME, typeid, spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate1(grpid, DATASET_NAME, typeid, spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Write some data. */
|
||||
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT, hr_data_out) < 0) ERR;
|
||||
@ -609,7 +609,7 @@ main()
|
||||
|
||||
/* Now open the file and read it. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, DATASET_NAME)) < 0) ERR;
|
||||
if ((typeid = H5Dget_type(datasetid)) < 0) ERR;
|
||||
if (H5Tget_class(typeid) != H5T_COMPOUND) ERR;
|
||||
@ -673,7 +673,7 @@ main()
|
||||
|
||||
/* Open file and get root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create a compound type. */
|
||||
if ((typeid_inner = H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) ERR;
|
||||
@ -691,7 +691,7 @@ main()
|
||||
if (H5Tinsert(typeid, "min_temp", HOFFSET(struct hr_rec, min_temp), H5T_NATIVE_FLOAT) < 0) ERR;
|
||||
if (H5Tinsert(typeid, "percent_transporter_errosion", HOFFSET(struct hr_rec, percent_transporter_errosion),
|
||||
H5T_NATIVE_DOUBLE) < 0) ERR;
|
||||
if (H5Tcommit(grpid, "hr_rec", typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, "hr_rec", typeid) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM1_LEN;
|
||||
@ -713,7 +713,7 @@ main()
|
||||
|
||||
/* Now open the file and read it. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((attid = H5Aopen_by_name(grpid, ".", ATT_NAME1, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
if ((native_typeid = H5Tget_native_type(typeid, H5T_DIR_DEFAULT)) < 0) ERR;
|
||||
@ -762,7 +762,7 @@ main()
|
||||
|
||||
/* Open file and get root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create a compound type. */
|
||||
if ((typeid = H5Tcreate(H5T_COMPOUND, sizeof(struct hr_rec))) < 0) ERR;
|
||||
@ -774,14 +774,14 @@ main()
|
||||
sizeof(struct hr_rec), HOFFSET(struct hr_rec, name), HOFFSET(struct hr_rec, max_temp));*/
|
||||
if (H5Tinsert(typeid, "name", HOFFSET(struct hr_rec, name), array1_tid) < 0) ERR;
|
||||
if (H5Tinsert(typeid, "max_temp", HOFFSET(struct hr_rec, max_temp), H5T_NATIVE_FLOAT) < 0) ERR;
|
||||
if (H5Tcommit(grpid, "hr_rec", typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, "hr_rec", typeid) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM1_LEN;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create a dataset of this compound type. */
|
||||
if ((datasetid = H5Dcreate(grpid, DATASET_NAME, typeid, spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate1(grpid, DATASET_NAME, typeid, spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Write some data. */
|
||||
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT, hr_data_out) < 0) ERR;
|
||||
@ -797,7 +797,7 @@ main()
|
||||
|
||||
/* Now open the file and read it. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, DATASET_NAME)) < 0) ERR;
|
||||
if ((typeid = H5Dget_type(datasetid)) < 0) ERR;
|
||||
if (H5Tget_class(typeid) != H5T_COMPOUND) ERR;
|
||||
@ -847,7 +847,7 @@ main()
|
||||
|
||||
/* Open file and get root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create a compound type. */
|
||||
if ((typeid = H5Tcreate(H5T_COMPOUND, sizeof(struct hr_rec))) < 0) ERR;
|
||||
@ -858,7 +858,7 @@ main()
|
||||
sizeof(struct hr_rec), HOFFSET(struct hr_rec, name), HOFFSET(struct hr_rec, max_temp));*/
|
||||
if (H5Tinsert(typeid, "Name", HOFFSET(struct hr_rec, name), array1_tid) < 0) ERR;
|
||||
if (H5Tinsert(typeid, "Max_Temp", HOFFSET(struct hr_rec, max_temp), H5T_NATIVE_FLOAT) < 0) ERR;
|
||||
if (H5Tcommit(grpid, "SF_HR_Record", typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, "SF_HR_Record", typeid) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM2_LEN;
|
||||
@ -881,7 +881,7 @@ main()
|
||||
|
||||
/* Now open the file and read it. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((attid = H5Aopen_by_name(grpid, ".", ATT_NAME, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
if (H5Tget_class(typeid) != H5T_COMPOUND) ERR;
|
||||
@ -938,14 +938,14 @@ main()
|
||||
|
||||
/* Open file and get root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create a compound type. */
|
||||
if ((typeid = H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) ERR;
|
||||
if ((array1_tid = H5Tarray_create2(H5T_NATIVE_UCHAR, 1, dims)) < 0) ERR;
|
||||
if (H5Tinsert(typeid, "x", HOFFSET(struct s1, x), array1_tid) < 0) ERR;
|
||||
if (H5Tinsert(typeid, "y", HOFFSET(struct s1, y), H5T_NATIVE_FLOAT) < 0) ERR;
|
||||
if (H5Tcommit(grpid, "c", typeid) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, "c", typeid) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DISC_DIM1_LEN;
|
||||
@ -967,7 +967,7 @@ main()
|
||||
|
||||
/* Now open the file and read it. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((attid = H5Aopen_by_name(grpid, ".", DISC_ATT_NAME, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
if (H5Tget_class(typeid) != H5T_COMPOUND) ERR;
|
||||
@ -1039,18 +1039,18 @@ main()
|
||||
|
||||
/* Create file and get root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create the inner compound type. */
|
||||
if ((typeid_inner = H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) ERR;
|
||||
if (H5Tinsert(typeid_inner, "x", HOFFSET(struct s1, x), H5T_NATIVE_FLOAT) < 0) ERR;
|
||||
if (H5Tinsert(typeid_inner, "y", HOFFSET(struct s1, y), H5T_NATIVE_DOUBLE) < 0) ERR;
|
||||
if (H5Tcommit(grpid, INNER_TYPE_NAME, typeid_inner) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, INNER_TYPE_NAME, typeid_inner) < 0) ERR;
|
||||
|
||||
/* Create a compound type containing a compound type. */
|
||||
if ((typeid_outer = H5Tcreate(H5T_COMPOUND, sizeof(struct s2))) < 0) ERR;
|
||||
if (H5Tinsert(typeid_outer, INNER_TYPE_NAME, HOFFSET(struct s2, s1), typeid_inner) < 0) ERR;
|
||||
if (H5Tcommit(grpid, OUTER_TYPE_NAME, typeid_outer) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, OUTER_TYPE_NAME, typeid_outer) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM_CMP_LEN;
|
||||
@ -1072,7 +1072,7 @@ main()
|
||||
|
||||
/* Now open the file and get the type of the attribute. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((attid = H5Aopen_by_name(grpid, ".", ATT_CMP_NAME1, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((att_typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
if ((att_native_typeid = H5Tget_native_type(att_typeid, H5T_DIR_DEFAULT)) < 0) ERR;
|
||||
@ -1141,18 +1141,18 @@ main()
|
||||
|
||||
/* Create file and get root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create the inner compound type. */
|
||||
if ((typeid_inner = H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) ERR;
|
||||
if (H5Tinsert(typeid_inner, "x", HOFFSET(struct s1, x), H5T_NATIVE_FLOAT) < 0) ERR;
|
||||
if (H5Tinsert(typeid_inner, "y", HOFFSET(struct s1, y), H5T_NATIVE_DOUBLE) < 0) ERR;
|
||||
if (H5Tcommit(grpid, INNER_TYPE_NAME, typeid_inner) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, INNER_TYPE_NAME, typeid_inner) < 0) ERR;
|
||||
|
||||
/* Create a compound type containing a compound type. */
|
||||
if ((typeid_outer = H5Tcreate(H5T_COMPOUND, sizeof(struct s2))) < 0) ERR;
|
||||
if (H5Tinsert(typeid_outer, INNER_TYPE_NAME, HOFFSET(struct s2, s1), typeid_inner) < 0) ERR;
|
||||
if (H5Tcommit(grpid, OUTER_TYPE_NAME, typeid_outer) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, OUTER_TYPE_NAME, typeid_outer) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM_CMP_LEN;
|
||||
@ -1174,7 +1174,7 @@ main()
|
||||
|
||||
/* Now open the file and get the type of the attribute. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((attid = H5Aopen_by_name(grpid, ".", ATT_CMP_NAME1, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((att_typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
if ((att_native_typeid = H5Tget_native_type(att_typeid, H5T_DIR_DEFAULT)) < 0) ERR;
|
||||
|
@ -83,18 +83,18 @@ main()
|
||||
|
||||
/* Create file and get root group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create the inner compound type. */
|
||||
if ((typeid_inner = H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) ERR;
|
||||
if (H5Tinsert(typeid_inner, "x", HOFFSET(struct s1, x), H5T_NATIVE_FLOAT) < 0) ERR;
|
||||
if (H5Tinsert(typeid_inner, "y", HOFFSET(struct s1, y), H5T_NATIVE_DOUBLE) < 0) ERR;
|
||||
if (H5Tcommit(grpid, INNER_TYPE_NAME, typeid_inner) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, INNER_TYPE_NAME, typeid_inner) < 0) ERR;
|
||||
|
||||
/* Create a compound type containing a compound type. */
|
||||
if ((typeid_outer = H5Tcreate(H5T_COMPOUND, sizeof(struct s2))) < 0) ERR;
|
||||
if (H5Tinsert(typeid_outer, INNER_TYPE_NAME, HOFFSET(struct s2, s1), typeid_inner) < 0) ERR;
|
||||
if (H5Tcommit(grpid, OUTER_TYPE_NAME, typeid_outer) < 0) ERR;
|
||||
if (H5Tcommit1(grpid, OUTER_TYPE_NAME, typeid_outer) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM_CMP_LEN;
|
||||
@ -116,7 +116,7 @@ main()
|
||||
|
||||
/* Now open the file and get the type of the attribute. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((attid = H5Aopen_by_name(grpid, ".", ATT_NAME1, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((att_typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
if ((att_native_typeid = H5Tget_native_type(att_typeid, H5T_DIR_DEFAULT)) < 0) ERR;
|
||||
@ -184,7 +184,7 @@ main()
|
||||
strcpy(file_in, REF_FILE_IN);
|
||||
|
||||
if ((fileid = H5Fopen(file_in, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((attid = H5Aopen_by_name(grpid, ".", ATT_NAME1, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((att_typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
if ((att_native_typeid = H5Tget_native_type(att_typeid, H5T_DIR_DEFAULT)) < 0) ERR;
|
||||
|
@ -63,12 +63,12 @@ rec_scan_group(hid_t grpid)
|
||||
switch(obj_class)
|
||||
{
|
||||
case H5G_GROUP:
|
||||
if ((child_grpid = H5Gopen(grpid, obj_name)) < 0) ERR;
|
||||
if ((child_grpid = H5Gopen1(grpid, obj_name)) < 0) ERR;
|
||||
if (rec_scan_group(child_grpid)) ERR;
|
||||
break;
|
||||
case H5G_DATASET:
|
||||
/* Open the dataset. */
|
||||
if ((datasetid = H5Dopen(grpid, obj_name)) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, obj_name)) < 0) ERR;
|
||||
/*printf("\nobj_name %s\n", obj_name);*/
|
||||
|
||||
/* Get the dimensions of this dataset. */
|
||||
@ -138,32 +138,32 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create our dimension scale. Use the built-in NAME attribute
|
||||
* on the dimscale. */
|
||||
if ((dimscale_spaceid = H5Screate_simple(1, dimscale_dims,
|
||||
dimscale_dims)) < 0) ERR;
|
||||
if ((dimscaleid = H5Dcreate(grpid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
if ((dimscaleid = H5Dcreate1(grpid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
dimscale_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSset_scale(dimscaleid, NAME_ATTRIBUTE) < 0) ERR;
|
||||
|
||||
/* Create a 1D variable which uses the dimscale. Attach a label
|
||||
* to this scale. */
|
||||
if ((var1_spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((var1_datasetid = H5Dcreate(grpid, VAR1_NAME, H5T_NATIVE_INT,
|
||||
if ((var1_datasetid = H5Dcreate1(grpid, VAR1_NAME, H5T_NATIVE_INT,
|
||||
var1_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSattach_scale(var1_datasetid, dimscaleid, 0) < 0) ERR;
|
||||
if (H5DSset_label(var1_datasetid, 0, FIFTIES_SONG) < 0) ERR;
|
||||
|
||||
/* Create a 1D variabls that doesn't use the dimension scale. */
|
||||
if ((var2_datasetid = H5Dcreate(grpid, VAR2_NAME, H5T_NATIVE_INT,
|
||||
if ((var2_datasetid = H5Dcreate1(grpid, VAR2_NAME, H5T_NATIVE_INT,
|
||||
var1_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Create a 2D dataset which uses the scale for one of its
|
||||
* dimensions. */
|
||||
if ((var3_spaceid = H5Screate_simple(2, dims, dims)) < 0) ERR;
|
||||
if ((var3_datasetid = H5Dcreate(grpid, VAR3_NAME, H5T_NATIVE_INT,
|
||||
if ((var3_datasetid = H5Dcreate1(grpid, VAR3_NAME, H5T_NATIVE_INT,
|
||||
var3_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSattach_scale(var3_datasetid, dimscaleid, 0) < 0) ERR;
|
||||
|
||||
@ -198,7 +198,7 @@ main()
|
||||
|
||||
/* Reopen the file and group. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
|
||||
/* Loop through datasets to find variables. */
|
||||
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
|
||||
@ -225,7 +225,7 @@ main()
|
||||
H5Dclose(datasetid);
|
||||
}
|
||||
|
||||
if ((datasetid = H5Dopen(grpid, obj_name)) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, obj_name)) < 0) ERR;
|
||||
if ((is_scale = H5DSis_scale(datasetid)) < 0) ERR;
|
||||
if (is_scale && strcmp(obj_name, DIMSCALE_NAME)) ERR;
|
||||
if (is_scale)
|
||||
@ -294,13 +294,13 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create our dimension scale. Use the built-in NAME attribute
|
||||
* on the dimscale. */
|
||||
if ((dimscale_spaceid = H5Screate_simple(1, dimscale_dims,
|
||||
dimscale_dims)) < 0) ERR;
|
||||
if ((dimscaleid = H5Dcreate(grpid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
if ((dimscaleid = H5Dcreate1(grpid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
dimscale_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSset_scale(dimscaleid, NAME_ATTRIBUTE) < 0) ERR;
|
||||
|
||||
@ -309,7 +309,7 @@ main()
|
||||
for (v = 0; v < NUM_DATASETS; v++)
|
||||
{
|
||||
sprintf(var_name, "var_%d", v);
|
||||
if ((var1_datasetid[v] = H5Dcreate(grpid, var_name, H5T_NATIVE_INT,
|
||||
if ((var1_datasetid[v] = H5Dcreate1(grpid, var_name, H5T_NATIVE_INT,
|
||||
var1_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSattach_scale(var1_datasetid[v], dimscaleid, 0) < 0) ERR;
|
||||
}
|
||||
@ -334,7 +334,7 @@ main()
|
||||
/* Create file and group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
if ((spaceid = H5Screate_simple(1, dims, maxdims)) < 0) ERR;
|
||||
|
||||
@ -343,12 +343,12 @@ main()
|
||||
if (H5Pset_chunk(cparmsid, 1, dims) < 0) ERR;
|
||||
|
||||
/* Create our dimension scale, as an unlimited dataset. */
|
||||
if ((dimscaleid = H5Dcreate(grpid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
if ((dimscaleid = H5Dcreate1(grpid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSset_scale(dimscaleid, NAME_ATTRIBUTE) < 0) ERR;
|
||||
|
||||
/* Create a variable which uses it. */
|
||||
if ((datasetid = H5Dcreate(grpid, VAR1_NAME, H5T_NATIVE_INT,
|
||||
if ((datasetid = H5Dcreate1(grpid, VAR1_NAME, H5T_NATIVE_INT,
|
||||
spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSattach_scale(datasetid, dimscaleid, 0) < 0) ERR;
|
||||
if (H5DSset_label(datasetid, 0, "dimension label") < 0) ERR;
|
||||
@ -375,7 +375,7 @@ main()
|
||||
|
||||
/* Reopen the file and group. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
|
||||
/* Loop through datasets to find variables. */
|
||||
if (H5Gget_num_objs(grpid, (hsize_t *)&num_obj) < 0) ERR;
|
||||
@ -402,7 +402,7 @@ main()
|
||||
}
|
||||
|
||||
/* Open the dataset. */
|
||||
if ((datasetid = H5Dopen(grpid, obj_name)) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, obj_name)) < 0) ERR;
|
||||
|
||||
/* This should be an unlimited dataset. */
|
||||
if ((spaceid = H5Dget_space(datasetid)) < 0) ERR;
|
||||
@ -482,7 +482,7 @@ main()
|
||||
/* Create file and group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create 3 1D spaces for the 3 dimension scale datasets. Time
|
||||
* starts out as size 0. It's an unlimited dimension scale. */
|
||||
@ -502,13 +502,13 @@ main()
|
||||
if (H5Pset_chunk(cparmsid, 1, dims) < 0) ERR;
|
||||
|
||||
/* Create our dimension scales. */
|
||||
if ((time_scaleid = H5Dcreate(grpid, TIME_NAME, H5T_NATIVE_INT,
|
||||
if ((time_scaleid = H5Dcreate1(grpid, TIME_NAME, H5T_NATIVE_INT,
|
||||
time_spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSset_scale(time_scaleid, TIME_NAME) < 0) ERR;
|
||||
if ((lat_scaleid = H5Dcreate(grpid, LAT_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((lat_scaleid = H5Dcreate1(grpid, LAT_NAME, H5T_NATIVE_FLOAT,
|
||||
lat_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSset_scale(lat_scaleid, LAT_NAME) < 0) ERR;
|
||||
if ((lon_scaleid = H5Dcreate(grpid, LON_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((lon_scaleid = H5Dcreate1(grpid, LON_NAME, H5T_NATIVE_FLOAT,
|
||||
lon_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSset_scale(lon_scaleid, LON_NAME) < 0) ERR;
|
||||
|
||||
@ -524,7 +524,7 @@ main()
|
||||
/* Create two variables which use them, and attach the dimension scales. */
|
||||
dims[TIME_DIM] = 1;
|
||||
if (H5Pset_chunk(cparmsid, NDIMS, dims) < 0) ERR;
|
||||
if ((pres_dsid = H5Dcreate(grpid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((pres_dsid = H5Dcreate1(grpid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSattach_scale(pres_dsid, time_scaleid, 0) < 0) ERR;
|
||||
if (H5DSattach_scale(pres_dsid, lat_scaleid, 1) < 0) ERR;
|
||||
@ -532,7 +532,7 @@ main()
|
||||
if (H5DSset_label(pres_dsid, TIME_DIM, TIME_NAME) < 0) ERR;
|
||||
if (H5DSset_label(pres_dsid, LAT_DIM, LAT_NAME) < 0) ERR;
|
||||
if (H5DSset_label(pres_dsid, LON_DIM, LON_NAME) < 0) ERR;
|
||||
if ((temp_dsid = H5Dcreate(grpid, TEMP_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((temp_dsid = H5Dcreate1(grpid, TEMP_NAME, H5T_NATIVE_FLOAT,
|
||||
spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSattach_scale(temp_dsid, time_scaleid, 0) < 0) ERR;
|
||||
if (H5DSattach_scale(temp_dsid, lat_scaleid, 1) < 0) ERR;
|
||||
@ -567,7 +567,7 @@ main()
|
||||
|
||||
/* Reopen the file and group. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
|
||||
/* Loop through datasets to find variables. */
|
||||
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
|
||||
@ -586,7 +586,7 @@ main()
|
||||
break;
|
||||
case H5G_DATASET:
|
||||
/* Open the dataset. */
|
||||
if ((datasetid = H5Dopen(grpid, obj_name)) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, obj_name)) < 0) ERR;
|
||||
/*printf("\nobj_name %s\n", obj_name);*/
|
||||
|
||||
/* Get the dimensions of this dataset. */
|
||||
@ -687,9 +687,9 @@ main()
|
||||
/* Create file and group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((adam_grpid = H5Gcreate(fileid, FATHER, 0)) < 0) ERR;
|
||||
if ((able_grpid = H5Gcreate(adam_grpid, GOOD_CHILD, 0)) < 0) ERR;
|
||||
if ((cain_grpid = H5Gcreate(adam_grpid, BAD_CHILD, 0)) < 0) ERR;
|
||||
if ((adam_grpid = H5Gcreate1(fileid, FATHER, 0)) < 0) ERR;
|
||||
if ((able_grpid = H5Gcreate1(adam_grpid, GOOD_CHILD, 0)) < 0) ERR;
|
||||
if ((cain_grpid = H5Gcreate1(adam_grpid, BAD_CHILD, 0)) < 0) ERR;
|
||||
|
||||
/* Create 3 1D spaces for the 3 dimension scale datasets. Time
|
||||
* and smelliness starts out as 0. They are unlimited dimension
|
||||
@ -710,13 +710,13 @@ main()
|
||||
if (H5Pset_chunk(cparmsid, 1, dims) < 0) ERR;
|
||||
|
||||
/* Create our dimension scales. */
|
||||
if ((time_scaleid = H5Dcreate(adam_grpid, TIME_NAME, H5T_NATIVE_INT,
|
||||
if ((time_scaleid = H5Dcreate1(adam_grpid, TIME_NAME, H5T_NATIVE_INT,
|
||||
time_spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSset_scale(time_scaleid, TIME_NAME) < 0) ERR;
|
||||
if ((smelliness_scaleid = H5Dcreate(adam_grpid, SMELLINESS_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((smelliness_scaleid = H5Dcreate1(adam_grpid, SMELLINESS_NAME, H5T_NATIVE_FLOAT,
|
||||
smelliness_spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSset_scale(smelliness_scaleid, SMELLINESS_NAME) < 0) ERR;
|
||||
if ((distance_scaleid = H5Dcreate(adam_grpid, DISTANCE_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((distance_scaleid = H5Dcreate1(adam_grpid, DISTANCE_NAME, H5T_NATIVE_FLOAT,
|
||||
distance_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSset_scale(distance_scaleid, DISTANCE_NAME) < 0) ERR;
|
||||
|
||||
@ -735,12 +735,12 @@ main()
|
||||
if (H5Pset_chunk(cparmsid, NDIMS, dims) < 0) ERR;
|
||||
|
||||
/* Create two variables which use them, and attach the dimension scales. */
|
||||
if ((goat_dsid = H5Dcreate(able_grpid, GOAT_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((goat_dsid = H5Dcreate1(able_grpid, GOAT_NAME, H5T_NATIVE_FLOAT,
|
||||
spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSattach_scale(goat_dsid, time_scaleid, 0) < 0) ERR;
|
||||
if (H5DSattach_scale(goat_dsid, smelliness_scaleid, 1) < 0) ERR;
|
||||
if (H5DSattach_scale(goat_dsid, distance_scaleid, 2) < 0) ERR;
|
||||
if ((camel_dsid = H5Dcreate(cain_grpid, CAMEL_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((camel_dsid = H5Dcreate1(cain_grpid, CAMEL_NAME, H5T_NATIVE_FLOAT,
|
||||
spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSattach_scale(camel_dsid, time_scaleid, 0) < 0) ERR;
|
||||
if (H5DSattach_scale(camel_dsid, smelliness_scaleid, 1) < 0) ERR;
|
||||
@ -767,7 +767,7 @@ main()
|
||||
|
||||
/* Reopen the file and group. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, FATHER)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, FATHER)) < 0) ERR;
|
||||
|
||||
/* If we can't scan the group, crash into a flaming heap of
|
||||
* smoking, smoldering rubbish. */
|
||||
|
@ -38,32 +38,32 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create our dimension scale. Use the built-in NAME attribute
|
||||
* on the dimscale. */
|
||||
if ((dimscale_spaceid = H5Screate_simple(1, dimscale_dims,
|
||||
dimscale_dims)) < 0) ERR;
|
||||
if ((dimscaleid = H5Dcreate(grpid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
if ((dimscaleid = H5Dcreate1(grpid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
dimscale_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSset_scale(dimscaleid, NAME_ATTRIBUTE) < 0) ERR;
|
||||
|
||||
/* Create a 1D variable which uses the dimscale. Attach a label
|
||||
* to this scale. */
|
||||
if ((var1_spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((var1_datasetid = H5Dcreate(grpid, VAR1_NAME, H5T_NATIVE_INT,
|
||||
if ((var1_datasetid = H5Dcreate1(grpid, VAR1_NAME, H5T_NATIVE_INT,
|
||||
var1_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSattach_scale(var1_datasetid, dimscaleid, 0) < 0) ERR;
|
||||
if (H5DSset_label(var1_datasetid, 0, FIFTIES_SONG) < 0) ERR;
|
||||
|
||||
/* Create a 1D variabls that doesn't use the dimension scale. */
|
||||
if ((var2_datasetid = H5Dcreate(grpid, VAR2_NAME, H5T_NATIVE_INT,
|
||||
if ((var2_datasetid = H5Dcreate1(grpid, VAR2_NAME, H5T_NATIVE_INT,
|
||||
var1_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Create a 2D dataset which uses the scale for one of its
|
||||
* dimensions. */
|
||||
if ((var3_spaceid = H5Screate_simple(2, dims, dims)) < 0) ERR;
|
||||
if ((var3_datasetid = H5Dcreate(grpid, VAR3_NAME, H5T_NATIVE_INT,
|
||||
if ((var3_datasetid = H5Dcreate1(grpid, VAR3_NAME, H5T_NATIVE_INT,
|
||||
var3_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSattach_scale(var3_datasetid, dimscaleid, 0) < 0) ERR;
|
||||
|
||||
|
@ -95,12 +95,12 @@ main()
|
||||
if (H5Pset_chunk(cparmsid, NDIMS, dims) < 0) ERR;
|
||||
|
||||
/* Create our dimension scale, as an unlimited dataset. */
|
||||
if ((dimscaleid = H5Dcreate(fileid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
if ((dimscaleid = H5Dcreate1(fileid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSset_scale(dimscaleid, NAME_ATTRIBUTE) < 0) ERR;
|
||||
|
||||
/* Create a variable which uses it. */
|
||||
if ((datasetid = H5Dcreate(fileid, VAR1_NAME, H5T_NATIVE_INT,
|
||||
if ((datasetid = H5Dcreate1(fileid, VAR1_NAME, H5T_NATIVE_INT,
|
||||
spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSattach_scale(datasetid, dimscaleid, 0) < 0) ERR;
|
||||
if (H5DSset_label(datasetid, 0, DIMSCALE_LABEL) < 0) ERR;
|
||||
@ -255,15 +255,15 @@ main()
|
||||
if ((pres_spaceid = H5Screate_simple(DIMS_2, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create our dimension scales. */
|
||||
if ((lat_dimscaleid = H5Dcreate(fileid, LAT_NAME, H5T_NATIVE_INT,
|
||||
if ((lat_dimscaleid = H5Dcreate1(fileid, LAT_NAME, H5T_NATIVE_INT,
|
||||
lat_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSset_scale(lat_dimscaleid, NULL) < 0) ERR;
|
||||
if ((lon_dimscaleid = H5Dcreate(fileid, LON_NAME, H5T_NATIVE_INT,
|
||||
if ((lon_dimscaleid = H5Dcreate1(fileid, LON_NAME, H5T_NATIVE_INT,
|
||||
lon_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSset_scale(lon_dimscaleid, NULL) < 0) ERR;
|
||||
|
||||
/* Create a variable which uses these two dimscales. */
|
||||
if ((pres_datasetid = H5Dcreate(fileid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((pres_datasetid = H5Dcreate1(fileid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
pres_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSattach_scale(pres_datasetid, lat_dimscaleid, 0) < 0) ERR;
|
||||
if (H5DSattach_scale(pres_datasetid, lon_dimscaleid, 1) < 0) ERR;
|
||||
@ -463,10 +463,10 @@ main()
|
||||
H5P_CRT_ORDER_INDEXED) < 0) ERR;
|
||||
|
||||
/* Create our dimension scales. */
|
||||
if ((lat_dimscaleid = H5Dcreate(grpid, U1_NAME, H5T_NATIVE_INT,
|
||||
if ((lat_dimscaleid = H5Dcreate1(grpid, U1_NAME, H5T_NATIVE_INT,
|
||||
lat_spaceid, plistid)) < 0) ERR;
|
||||
if (H5DSset_scale(lat_dimscaleid, NULL) < 0) ERR;
|
||||
if ((lon_dimscaleid = H5Dcreate(grpid, U2_NAME, H5T_NATIVE_INT,
|
||||
if ((lon_dimscaleid = H5Dcreate1(grpid, U2_NAME, H5T_NATIVE_INT,
|
||||
lon_spaceid, plistid)) < 0) ERR;
|
||||
if (H5DSset_scale(lon_dimscaleid, NULL) < 0) ERR;
|
||||
|
||||
@ -477,7 +477,7 @@ main()
|
||||
H5P_CRT_ORDER_INDEXED) < 0) ERR;
|
||||
|
||||
/* Create a variable which uses these two dimscales. */
|
||||
if ((pres_datasetid = H5Dcreate(grpid, VNAME, H5T_NATIVE_DOUBLE, pres_spaceid,
|
||||
if ((pres_datasetid = H5Dcreate1(grpid, VNAME, H5T_NATIVE_DOUBLE, pres_spaceid,
|
||||
plistid2)) < 0) ERR;
|
||||
if (H5DSattach_scale(pres_datasetid, lat_dimscaleid, 0) < 0) ERR;
|
||||
if (H5DSattach_scale(pres_datasetid, lon_dimscaleid, 1) < 0) ERR;
|
||||
|
@ -99,12 +99,12 @@ main()
|
||||
if (H5Pset_chunk(cparmsid, NDIMS, dims) < 0) ERR;
|
||||
|
||||
/* Create our dimension scale, as an unlimited dataset. */
|
||||
if ((dimscaleid = H5Dcreate(fileid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
if ((dimscaleid = H5Dcreate1(fileid, DIMSCALE_NAME, H5T_NATIVE_INT,
|
||||
spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSset_scale(dimscaleid, NAME_ATTRIBUTE) < 0) ERR;
|
||||
|
||||
/* Create a variable which uses it. */
|
||||
if ((datasetid = H5Dcreate(fileid, VAR1_NAME, H5T_NATIVE_INT,
|
||||
if ((datasetid = H5Dcreate1(fileid, VAR1_NAME, H5T_NATIVE_INT,
|
||||
spaceid, cparmsid)) < 0) ERR;
|
||||
if (H5DSattach_scale(datasetid, dimscaleid, 0) < 0) ERR;
|
||||
if (H5DSset_label(datasetid, 0, DIMSCALE_LABEL) < 0) ERR;
|
||||
@ -151,7 +151,7 @@ main()
|
||||
break;
|
||||
case H5G_DATASET:
|
||||
/* Open the dataset. */
|
||||
if ((datasetid = H5Dopen(fileid, obj_name)) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(fileid, obj_name)) < 0) ERR;
|
||||
|
||||
/* This should be an unlimited dataset. */
|
||||
if ((spaceid = H5Dget_space(datasetid)) < 0) ERR;
|
||||
|
@ -56,16 +56,16 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create a dataset of native endian. */
|
||||
dims[0] = DIM1_LEN;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((native_did = H5Dcreate(grpid, NATIVE_VAR_NAME, H5T_STD_I32BE,
|
||||
if ((native_did = H5Dcreate1(grpid, NATIVE_VAR_NAME, H5T_STD_I32BE,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((le_did = H5Dcreate(grpid, LE_VAR_NAME, H5T_IEEE_F32LE,
|
||||
if ((le_did = H5Dcreate1(grpid, LE_VAR_NAME, H5T_IEEE_F32LE,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((be_did = H5Dcreate(grpid, BE_VAR_NAME, H5T_IEEE_F32BE,
|
||||
if ((be_did = H5Dcreate1(grpid, BE_VAR_NAME, H5T_IEEE_F32BE,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
if (H5Dclose(native_did) < 0 ||
|
||||
|
@ -73,7 +73,7 @@ main()
|
||||
/* Open file. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create enum type. */
|
||||
/* Both methods do the same thing, but Quincey says to prefer
|
||||
@ -87,7 +87,7 @@ main()
|
||||
|
||||
/* Write an attribute of this type. */
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, data) < 0) ERR;
|
||||
|
||||
@ -100,7 +100,7 @@ main()
|
||||
/* Reopen the file. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
|
||||
/* Check the attribute's type. */
|
||||
if ((attid = H5Aopen_name(grpid, ATT_NAME)) < 0) ERR;
|
||||
@ -174,7 +174,7 @@ main()
|
||||
/* Open file. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME2, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME2, 0)) < 0) ERR;
|
||||
|
||||
/* Create enum type. */
|
||||
if ((typeid = H5Tenum_create(H5T_NATIVE_SHORT)) < 0) ERR;
|
||||
@ -187,13 +187,13 @@ main()
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
|
||||
if (H5Pset_fill_value(plistid, typeid, &fill_value) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate(grpid, VAR_LANG_NAME, typeid,
|
||||
if ((datasetid = H5Dcreate1(grpid, VAR_LANG_NAME, typeid,
|
||||
spaceid, plistid)) < 0) ERR;
|
||||
|
||||
/* Create a netCDFstyle _FillValue attribute, though it will be
|
||||
* ignored by HDF5. */
|
||||
if ((att_spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, FV_NAME, typeid, att_spaceid,
|
||||
if ((attid = H5Acreate1(grpid, FV_NAME, typeid, att_spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, &fill_value) < 0) ERR;
|
||||
|
||||
@ -218,7 +218,7 @@ main()
|
||||
|
||||
/* Reopen the file. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME2)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME2)) < 0) ERR;
|
||||
|
||||
/* Check the variable's type. */
|
||||
if ((datasetid = H5Dopen1(grpid, VAR_LANG_NAME)) < 0) ERR;
|
||||
@ -273,7 +273,7 @@ main()
|
||||
/* /\* Open file. *\/ */
|
||||
/* if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, */
|
||||
/* H5P_DEFAULT)) < 0) ERR; */
|
||||
/* if ((grpid = H5Gcreate(fileid, GRP_NAME3, 0)) < 0) ERR; */
|
||||
/* if ((grpid = H5Gcreate1(fileid, GRP_NAME3, 0)) < 0) ERR; */
|
||||
|
||||
/* /\* Create enum type. *\/ */
|
||||
/* if ((typeid = H5Tenum_create(H5T_NATIVE_SHORT)) < 0) ERR; */
|
||||
|
@ -55,12 +55,12 @@ main()
|
||||
access_plist)) < 0) ERR;
|
||||
/* Add an opaque type. */
|
||||
if ((typeid = H5Tcreate(H5T_OPAQUE, OPAQUE_SIZE)) < 0) ERR;
|
||||
if (H5Tcommit(fileid, OPAQUE_NAME, typeid) < 0) ERR;
|
||||
if (H5Tcommit1(fileid, OPAQUE_NAME, typeid) < 0) ERR;
|
||||
|
||||
/* Add attribute of this type. */
|
||||
dims[0] = 3;
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((attid = H5Acreate(fileid, ATT_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(fileid, ATT_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, data) < 0) ERR;
|
||||
|
||||
@ -70,14 +70,14 @@ main()
|
||||
if (H5Fclose(fileid) < 0) ERR;
|
||||
if (H5Pclose(access_plist) < 0) ERR;
|
||||
|
||||
if (H5Eset_auto(NULL, NULL) < 0) ERR;
|
||||
if (H5Eset_auto1(NULL, NULL) < 0) ERR;
|
||||
|
||||
/* Reopen the file. */
|
||||
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
|
||||
/*if (H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI)) ERR;*/
|
||||
if (H5Pset_fclose_degree(fapl_id, H5F_CLOSE_STRONG)) ERR;
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
|
||||
for (i = 0; i < num_obj; i++)
|
||||
@ -86,7 +86,7 @@ main()
|
||||
if (H5Gget_objname_by_idx(grpid, i, obj_name,
|
||||
STR_LEN) < 0) ERR;
|
||||
if (obj_class != H5G_TYPE) ERR;
|
||||
if ((typeid = H5Topen(grpid, obj_name)) < 0) ERR;
|
||||
if ((typeid = H5Topen1(grpid, obj_name)) < 0) ERR;
|
||||
if ((class = H5Tget_class(typeid)) < 0) ERR;
|
||||
if (class != H5T_OPAQUE) ERR;
|
||||
if (!(H5Tget_size(typeid))) ERR;
|
||||
@ -119,7 +119,7 @@ main()
|
||||
/* Create file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
access_plist)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* How many open objects are there? */
|
||||
if ((objs = H5Fget_obj_count(fileid, H5F_OBJ_ALL)) < 0) ERR;
|
||||
@ -128,7 +128,7 @@ main()
|
||||
if (objs != 1) ERR;
|
||||
|
||||
/* Turn off HDF5 error messages. */
|
||||
if (H5Eset_auto(NULL, NULL) < 0) ERR;
|
||||
if (H5Eset_auto1(NULL, NULL) < 0) ERR;
|
||||
|
||||
/* This H5Fclose should fail, because I didn't close the group. */
|
||||
if (H5Fclose(fileid) >= 0) ERR;
|
||||
@ -281,7 +281,7 @@ main()
|
||||
if ((spaceid = H5Screate_simple(1, dims, maxdims)) < 0) ERR;
|
||||
if (H5Pset_attr_creation_order(plistid, H5P_CRT_ORDER_TRACKED|
|
||||
H5P_CRT_ORDER_INDEXED) < 0) ERR;
|
||||
if ((dim1_dimscaleid = H5Dcreate(grpid, "dim1", H5T_IEEE_F32BE,
|
||||
if ((dim1_dimscaleid = H5Dcreate1(grpid, "dim1", H5T_IEEE_F32BE,
|
||||
spaceid, plistid)) < 0) ERR;
|
||||
if (H5Sclose(spaceid) < 0) ERR;
|
||||
if (H5Pclose(plistid) < 0) ERR;
|
||||
@ -295,7 +295,7 @@ main()
|
||||
if ((spaceid = H5Screate_simple(1, dims, maxdims)) < 0) ERR;
|
||||
if (H5Pset_attr_creation_order(plistid, H5P_CRT_ORDER_TRACKED|
|
||||
H5P_CRT_ORDER_INDEXED) < 0) ERR;
|
||||
if ((dim2_dimscaleid = H5Dcreate(grpid, "dim2", H5T_IEEE_F32BE,
|
||||
if ((dim2_dimscaleid = H5Dcreate1(grpid, "dim2", H5T_IEEE_F32BE,
|
||||
spaceid, plistid)) < 0) ERR;
|
||||
if (H5Sclose(spaceid) < 0) ERR;
|
||||
if (H5Pclose(plistid) < 0) ERR;
|
||||
@ -321,7 +321,7 @@ main()
|
||||
if ((spaceid = H5Screate_simple(NDIMS2, dimsize, maxdimsize)) < 0) ERR;
|
||||
if (H5Pset_attr_creation_order(plistid, H5P_CRT_ORDER_TRACKED|
|
||||
H5P_CRT_ORDER_INDEXED) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate(grpid, VAR_NAME2, H5T_NATIVE_SCHAR, spaceid, plistid)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate1(grpid, VAR_NAME2, H5T_NATIVE_SCHAR, spaceid, plistid)) < 0) ERR;
|
||||
|
||||
free(fillp);
|
||||
free(chunksize);
|
||||
|
@ -43,12 +43,12 @@ main()
|
||||
access_plist)) < 0) ERR;
|
||||
/* Add an opaque type. */
|
||||
if ((typeid = H5Tcreate(H5T_OPAQUE, OPAQUE_SIZE)) < 0) ERR;
|
||||
if (H5Tcommit(fileid, OPAQUE_NAME, typeid) < 0) ERR;
|
||||
if (H5Tcommit1(fileid, OPAQUE_NAME, typeid) < 0) ERR;
|
||||
|
||||
/* Add attribute of this type. */
|
||||
dims[0] = 3;
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((attid = H5Acreate(fileid, ATT_NAME, typeid, spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((attid = H5Acreate1(fileid, ATT_NAME, typeid, spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, data) < 0) ERR;
|
||||
|
||||
if (H5Aclose(attid) < 0) ERR;
|
||||
|
@ -41,14 +41,14 @@ main()
|
||||
if (H5Pset_fclose_degree(access_plistid, H5F_CLOSE_SEMI)) ERR;
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
access_plistid)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if (H5Gclose(grpid) < 0 ||
|
||||
H5Fclose(fileid) < 0) ERR;
|
||||
|
||||
/* Reopen file and root group. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
|
||||
access_plistid)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if (H5Gclose(grpid) < 0 ||
|
||||
H5Fclose(fileid) < 0)
|
||||
ERR;
|
||||
@ -64,9 +64,9 @@ main()
|
||||
/* Create file with one dataset. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate(grpid, DATASET_NAME, H5T_NATIVE_INT,
|
||||
if ((datasetid = H5Dcreate1(grpid, DATASET_NAME, H5T_NATIVE_INT,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Dclose(datasetid) < 0 ||
|
||||
H5Sclose(spaceid) < 0 ||
|
||||
@ -76,7 +76,7 @@ main()
|
||||
/* Reopen file and check, then rename dataset. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, DATASET_NAME)) < 0) ERR;
|
||||
if (H5Dclose(datasetid) < 0) ERR;
|
||||
if (H5Gmove(grpid, DATASET_NAME, NEW_NAME) < 0) ERR;
|
||||
@ -96,16 +96,16 @@ main()
|
||||
/* Create file with some nested groups. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((subgrpid = H5Gcreate(grpid, SUB_GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((subgrpid = H5Gcreate1(grpid, SUB_GRP_NAME, 0)) < 0) ERR;
|
||||
if (H5Gclose(subgrpid) < 0 ||
|
||||
H5Gclose(grpid) < 0 ||
|
||||
H5Fclose(fileid) < 0) ERR;
|
||||
|
||||
/* Reopen file and discover groups. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((subgrpid = H5Gopen(grpid, SUB_GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((subgrpid = H5Gopen1(grpid, SUB_GRP_NAME)) < 0) ERR;
|
||||
if (H5Gclose(subgrpid) < 0 ||
|
||||
H5Gclose(grpid) < 0 ||
|
||||
H5Fclose(fileid) < 0) ERR;
|
||||
@ -120,16 +120,16 @@ main()
|
||||
/* Create file with nested group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, (char *)norm_utf8, 0)) < 0) ERR;
|
||||
if ((subgrpid = H5Gcreate(grpid, SUB_GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, (char *)norm_utf8, 0)) < 0) ERR;
|
||||
if ((subgrpid = H5Gcreate1(grpid, SUB_GRP_NAME, 0)) < 0) ERR;
|
||||
if (H5Gclose(subgrpid) < 0 ||
|
||||
H5Gclose(grpid) < 0 ||
|
||||
H5Fclose(fileid) < 0) ERR;
|
||||
|
||||
/* Reopen file and discover groups. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, (char *)norm_utf8)) < 0) ERR;
|
||||
if ((subgrpid = H5Gopen(grpid, SUB_GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, (char *)norm_utf8)) < 0) ERR;
|
||||
if ((subgrpid = H5Gopen1(grpid, SUB_GRP_NAME)) < 0) ERR;
|
||||
if (H5Gclose(subgrpid) < 0 ||
|
||||
H5Gclose(grpid) < 0 ||
|
||||
H5Fclose(fileid) < 0) ERR;
|
||||
@ -154,15 +154,15 @@ main()
|
||||
if ((grpid = H5Gcreate_anon(fileid, gcpl_id, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((H5Olink(grpid, fileid, (char *)norm_utf8, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
if ((subgrpid = H5Gcreate(grpid, SUB_GRP_NAME, 0)) < 0) ERR;
|
||||
if ((subgrpid = H5Gcreate1(grpid, SUB_GRP_NAME, 0)) < 0) ERR;
|
||||
if (H5Gclose(subgrpid) < 0 ||
|
||||
H5Gclose(grpid) < 0 ||
|
||||
H5Fclose(fileid) < 0) ERR;
|
||||
|
||||
/* Reopen file and discover groups. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, (char *)norm_utf8)) < 0) ERR;
|
||||
if ((subgrpid = H5Gopen(grpid, SUB_GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, (char *)norm_utf8)) < 0) ERR;
|
||||
if ((subgrpid = H5Gopen1(grpid, SUB_GRP_NAME)) < 0) ERR;
|
||||
if (H5Gclose(subgrpid) < 0 ||
|
||||
H5Gclose(grpid) < 0 ||
|
||||
H5Fclose(fileid) < 0) ERR;
|
||||
|
@ -50,7 +50,7 @@ main()
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
|
||||
|
||||
/* Open root group. */
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create 1 D data space with unlimited dimension. */
|
||||
dimsize[0] = 0;
|
||||
@ -69,7 +69,7 @@ main()
|
||||
{
|
||||
sprintf(var_name, "var_%d", v);
|
||||
/* printf("creating var %s\n", var_name);*/
|
||||
if ((datasetid[v] = H5Dcreate(grpid, var_name, H5T_NATIVE_INT,
|
||||
if ((datasetid[v] = H5Dcreate1(grpid, var_name, H5T_NATIVE_INT,
|
||||
spaceid, plistid)) < 0) ERR_RET;
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ main()
|
||||
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
|
||||
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* if ((datasetid = H5Dopen1(grpid, SIMPLE_VAR_NAME)) < 0) ERR; */
|
||||
/* if ((spaceid = H5Dget_space(datasetid)) < 0) */
|
||||
|
@ -33,7 +33,7 @@ main()
|
||||
/* Open file. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, "grp1", 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, "grp1", 0)) < 0) ERR;
|
||||
|
||||
/* Create opaque type. */
|
||||
if ((typeid = H5Tcreate(H5T_OPAQUE, SIZE)) < 0) ERR;
|
||||
@ -44,7 +44,7 @@ main()
|
||||
|
||||
/* Write an attribute of this type. */
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, data) < 0) ERR;
|
||||
if (H5Aclose(attid) < 0) ERR;
|
||||
|
@ -174,7 +174,7 @@ main(int argc, char **argv)
|
||||
if ((slice_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
|
||||
|
||||
/* Open the dataset. */
|
||||
if ((dsid = H5Dopen(fileid, VAR_NAME)) < 0) ERR;
|
||||
if ((dsid = H5Dopen1(fileid, VAR_NAME)) < 0) ERR;
|
||||
if ((whole_spaceid1 = H5Dget_space(dsid)) < 0) ERR;
|
||||
|
||||
ftime = MPI_Wtime();
|
||||
|
@ -151,7 +151,7 @@ main(int argc, char **argv)
|
||||
if ((slice_spaceid = H5Screate_simple(NDIMS, dims, NULL)) < 0) ERR;
|
||||
|
||||
/* Open the dataset. */
|
||||
if ((dsid = H5Dopen(fileid, VAR_NAME)) < 0) ERR;
|
||||
if ((dsid = H5Dopen1(fileid, VAR_NAME)) < 0) ERR;
|
||||
if ((whole_spaceid1 = H5Dget_space(dsid)) < 0) ERR;
|
||||
|
||||
/* Read the data, a slice at a time. */
|
||||
|
@ -64,7 +64,7 @@ main()
|
||||
/* Create the variables, one per element. */
|
||||
for (i = 0; i < NUM_ELEMENTS; i++)
|
||||
{
|
||||
if ((did[i] = H5Dcreate(grpid, names[i], H5T_NATIVE_INT,
|
||||
if ((did[i] = H5Dcreate1(grpid, names[i], H5T_NATIVE_INT,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Dclose(did[i]) < 0) ERR;
|
||||
}
|
||||
@ -80,7 +80,7 @@ main()
|
||||
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
|
||||
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, ELEMENTS_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, ELEMENTS_NAME)) < 0) ERR;
|
||||
|
||||
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
|
||||
if (num_obj != NUM_ELEMENTS) ERR;
|
||||
@ -116,7 +116,7 @@ main()
|
||||
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
|
||||
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, ELEMENTS_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, ELEMENTS_NAME)) < 0) ERR;
|
||||
|
||||
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
|
||||
if (num_obj != NUM_ELEMENTS) ERR;
|
||||
|
@ -37,7 +37,7 @@ main()
|
||||
/* Open file. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create string type. */
|
||||
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
|
||||
@ -45,7 +45,7 @@ main()
|
||||
|
||||
/* Write an attribute of this type. */
|
||||
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, &data) < 0) ERR;
|
||||
|
||||
@ -58,7 +58,7 @@ main()
|
||||
|
||||
/* Now reopen the file and check it out. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((attid = H5Aopen_name(grpid, ATT_NAME)) < 0) ERR;
|
||||
if ((typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
if ((spaceid = H5Aget_space(attid)) < 0) ERR;
|
||||
@ -106,7 +106,7 @@ main()
|
||||
/* Open file. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create string type. */
|
||||
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
|
||||
@ -118,7 +118,7 @@ main()
|
||||
|
||||
/* Write an attribute of this (string) type. */
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, data) < 0) ERR;
|
||||
|
||||
@ -129,7 +129,7 @@ main()
|
||||
|
||||
/* Now reopen the file and check it out. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((attid = H5Aopen_name(grpid, ATT_NAME)) < 0) ERR;
|
||||
if ((typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
|
||||
@ -190,7 +190,7 @@ main()
|
||||
/* Open file. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create string type. */
|
||||
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
|
||||
@ -202,7 +202,7 @@ main()
|
||||
|
||||
/* Write an attribute of this type. */
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, data) < 0) ERR;
|
||||
|
||||
@ -214,7 +214,7 @@ main()
|
||||
|
||||
/* Now reopen the file and check it out. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((attid = H5Aopen_name(grpid, ATT_NAME)) < 0) ERR;
|
||||
if ((typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
|
||||
@ -273,7 +273,7 @@ main()
|
||||
/* Open file. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create string type. */
|
||||
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
|
||||
@ -285,7 +285,7 @@ main()
|
||||
|
||||
/* Write an attribute of this type. */
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, data) < 0) ERR;
|
||||
|
||||
@ -297,7 +297,7 @@ main()
|
||||
|
||||
/* Now reopen the file and check it out. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((attid = H5Aopen_name(grpid, ATT_NAME)) < 0) ERR;
|
||||
if ((typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
|
||||
|
@ -36,12 +36,12 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Write an array of bools. */
|
||||
dims[0] = DIM1_LEN;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
|
||||
if ((datasetid = H5Dcreate1(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT,
|
||||
bool_out) < 0) ERR;
|
||||
@ -81,7 +81,7 @@ main()
|
||||
/* Create file and group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP2_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP2_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create a space corresponding to these three dimensions. */
|
||||
dims[0] = 0;
|
||||
@ -100,9 +100,9 @@ main()
|
||||
if (H5Pset_chunk(cparmsid, NDIMS, dims) < 0) ERR;
|
||||
|
||||
/* Create two variables which use this space. */
|
||||
if ((pres_dsid = H5Dcreate(grpid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((pres_dsid = H5Dcreate1(grpid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
spaceid, cparmsid)) < 0) ERR;
|
||||
if ((temp_dsid = H5Dcreate(grpid, TEMP_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((temp_dsid = H5Dcreate1(grpid, TEMP_NAME, H5T_NATIVE_FLOAT,
|
||||
spaceid, cparmsid)) < 0) ERR;
|
||||
|
||||
/* Get the spaceid and check various things. */
|
||||
@ -198,7 +198,7 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Write an array of bools, with compression. */
|
||||
dims[0] = DIM1_LEN;
|
||||
@ -207,7 +207,7 @@ main()
|
||||
if (H5Pset_chunk(propid, 1, dims)) ERR;
|
||||
if (H5Pset_deflate(propid, DEFLATE_LEVEL)) ERR;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
|
||||
if ((datasetid = H5Dcreate1(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
|
||||
spaceid, propid)) < 0) ERR;
|
||||
if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT,
|
||||
bool_out) < 0) ERR;
|
||||
@ -220,7 +220,7 @@ main()
|
||||
|
||||
/* Now reopen the file and check. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, VAR_BOOL_NAME)) < 0) ERR;
|
||||
if ((propid = H5Dget_create_plist(datasetid)) < 0) ERR;
|
||||
|
||||
@ -256,7 +256,7 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Write an array of bools, with compression, fletcher32
|
||||
* checksum, shuffle filters. Like a hoogie with "the works." */
|
||||
@ -268,7 +268,7 @@ main()
|
||||
if (H5Pset_deflate(propid, DEFLATE_LEVEL)) ERR;
|
||||
if (H5Pset_fletcher32(propid)) ERR;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
|
||||
if ((datasetid = H5Dcreate1(grpid, VAR_BOOL_NAME, H5T_NATIVE_HBOOL,
|
||||
spaceid, propid)) < 0) ERR;
|
||||
if (H5Dwrite(datasetid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT,
|
||||
bool_out) < 0) ERR;
|
||||
@ -281,7 +281,7 @@ main()
|
||||
|
||||
/* Now reopen the file and check. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, VAR_BOOL_NAME)) < 0) ERR;
|
||||
if ((propid = H5Dget_create_plist(datasetid)) < 0) ERR;
|
||||
|
||||
@ -339,16 +339,16 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create a dataset of native endian. */
|
||||
dims[0] = DIM1_LEN;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((native_did = H5Dcreate(grpid, NATIVE_VAR_NAME, H5T_NATIVE_INT,
|
||||
if ((native_did = H5Dcreate1(grpid, NATIVE_VAR_NAME, H5T_NATIVE_INT,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((le_did = H5Dcreate(grpid, LE_VAR_NAME, H5T_STD_I32LE,
|
||||
if ((le_did = H5Dcreate1(grpid, LE_VAR_NAME, H5T_STD_I32LE,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((be_did = H5Dcreate(grpid, BE_VAR_NAME, H5T_STD_I32BE,
|
||||
if ((be_did = H5Dcreate1(grpid, BE_VAR_NAME, H5T_STD_I32BE,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Dwrite(native_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
|
||||
data) < 0) ERR;
|
||||
@ -366,7 +366,7 @@ main()
|
||||
|
||||
/* Now reopen the file and check. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
|
||||
if ((native_did = H5Dopen1(grpid, NATIVE_VAR_NAME)) < 0) ERR;
|
||||
if ((typeid = H5Dget_type(native_did)) < 0) ERR;
|
||||
@ -432,7 +432,7 @@ main()
|
||||
/* Open file and create group. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create dataset creation property list. */
|
||||
if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
|
||||
@ -474,7 +474,7 @@ main()
|
||||
int i;
|
||||
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
|
||||
if ((native_did = H5Dopen1(grpid, SZIP_VAR_NAME)) < 0) ERR;
|
||||
|
||||
@ -520,7 +520,7 @@ main()
|
||||
sprintf(file_name, "%s_%s.h5", TEST_NAME, desc[f]);
|
||||
if ((fileid = H5Fcreate(file_name, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create dataset creation property list. */
|
||||
if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
|
||||
@ -579,7 +579,7 @@ main()
|
||||
int i;
|
||||
|
||||
if ((fileid = H5Fopen(file_name, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GRP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GRP_NAME)) < 0) ERR;
|
||||
|
||||
if ((native_did = H5Dopen1(grpid, BOTH_VAR_NAME)) < 0) ERR;
|
||||
|
||||
|
@ -63,7 +63,7 @@ main()
|
||||
/* Create the variables, one per element. */
|
||||
for (i = 0; i < NUM_ELEMENTS; i++)
|
||||
{
|
||||
if ((did[i] = H5Dcreate(grpid, names[i], H5T_NATIVE_INT,
|
||||
if ((did[i] = H5Dcreate1(grpid, names[i], H5T_NATIVE_INT,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Dclose(did[i]) < 0) ERR;
|
||||
}
|
||||
@ -79,7 +79,7 @@ main()
|
||||
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
|
||||
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, ELEMENTS_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, ELEMENTS_NAME)) < 0) ERR;
|
||||
|
||||
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
|
||||
if (num_obj != NUM_ELEMENTS) ERR;
|
||||
@ -145,7 +145,7 @@ main()
|
||||
{
|
||||
/* Create our dimension scale. Use the built-in NAME attribute
|
||||
* on the dimscale. */
|
||||
if ((dimscaleid = H5Dcreate(fileid, names[i], H5T_NATIVE_INT,
|
||||
if ((dimscaleid = H5Dcreate1(fileid, names[i], H5T_NATIVE_INT,
|
||||
dimscale_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSset_scale(dimscaleid, NAME_ATTRIBUTE) < 0) ERR;
|
||||
|
||||
@ -162,7 +162,7 @@ main()
|
||||
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
|
||||
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
|
||||
if (num_obj != NUM_DIMSCALES) ERR;
|
||||
@ -227,7 +227,7 @@ main()
|
||||
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
|
||||
|
||||
/* Create a scalar variable. */
|
||||
if ((did = H5Dcreate(grpid, VAR_NAME, H5T_NATIVE_INT,
|
||||
if ((did = H5Dcreate1(grpid, VAR_NAME, H5T_NATIVE_INT,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Dclose(did) < 0) ERR;
|
||||
|
||||
@ -238,11 +238,11 @@ main()
|
||||
if (H5Gunlink(grpid, VAR_NAME) < 0) ERR;
|
||||
|
||||
/* Re-reate the scalar variable. */
|
||||
if ((did = H5Dcreate(grpid, VAR_NAME, H5T_NATIVE_INT,
|
||||
if ((did = H5Dcreate1(grpid, VAR_NAME, H5T_NATIVE_INT,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Add an attribute. */
|
||||
if ((attid = H5Acreate(did, "Some_Attribute", H5T_NATIVE_FLOAT, spaceid,
|
||||
if ((attid = H5Acreate1(did, "Some_Attribute", H5T_NATIVE_FLOAT, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, H5T_NATIVE_FLOAT, &val) < 0) ERR;
|
||||
|
||||
@ -260,7 +260,7 @@ main()
|
||||
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
|
||||
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, ELEMENTS_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, ELEMENTS_NAME)) < 0) ERR;
|
||||
|
||||
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
|
||||
if (num_obj != 1) ERR;
|
||||
@ -318,7 +318,7 @@ main()
|
||||
if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
|
||||
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
dimsize[0] = maxdimsize[0] = NX;
|
||||
dimsize[1] = maxdimsize[1] = NY;
|
||||
@ -336,7 +336,7 @@ main()
|
||||
if (H5Pset_deflate(plistid, DEFLATE_LEVEL) < 0) ERR;
|
||||
|
||||
/* Create the variable. */
|
||||
if ((datasetid = H5Dcreate(grpid, SIMPLE_VAR_NAME, H5T_NATIVE_INT,
|
||||
if ((datasetid = H5Dcreate1(grpid, SIMPLE_VAR_NAME, H5T_NATIVE_INT,
|
||||
spaceid, plistid)) < 0) ERR;
|
||||
|
||||
/* Write the data. */
|
||||
@ -354,7 +354,7 @@ main()
|
||||
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
|
||||
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
if ((datasetid = H5Dopen1(grpid, SIMPLE_VAR_NAME)) < 0) ERR;
|
||||
if ((spaceid = H5Dget_space(datasetid)) < 0)
|
||||
@ -408,7 +408,7 @@ main()
|
||||
|
||||
/* Open file and read fill value of the variable. */
|
||||
if ((fileid = H5Fopen(file_in, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((datasetid = H5Dopen1(grpid, VAR_NAME2)) < 0) ERR;
|
||||
if ((propid = H5Dget_create_plist(datasetid)) < 0) ERR;
|
||||
if (H5Pfill_value_defined(propid, &fill_status) < 0) ERR;
|
||||
@ -461,7 +461,7 @@ main()
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
|
||||
|
||||
/* Open root group. */
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Create 1 D data space with unlimited dimension. */
|
||||
dimsize[0] = 0;
|
||||
@ -480,7 +480,7 @@ main()
|
||||
{
|
||||
sprintf(var_name, "var_%d", v);
|
||||
/* printf("creating var %s\n", var_name);*/
|
||||
if ((datasetid[v] = H5Dcreate(grpid, var_name, H5T_NATIVE_INT,
|
||||
if ((datasetid[v] = H5Dcreate1(grpid, var_name, H5T_NATIVE_INT,
|
||||
spaceid, plistid)) < 0) ERR_RET;
|
||||
}
|
||||
|
||||
@ -499,7 +499,7 @@ main()
|
||||
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
|
||||
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
if (H5Pclose(fapl_id) < 0 ||
|
||||
H5Gclose(grpid) < 0 ||
|
||||
@ -525,7 +525,7 @@ main()
|
||||
if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
|
||||
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
|
||||
|
||||
@ -544,12 +544,12 @@ main()
|
||||
|
||||
/* Create the variable. This will not work, because only
|
||||
* chunked datasets can use filters, and scalars can't be
|
||||
* chunked. The H5Dcreate() call will fail. */
|
||||
if ((datasetid = H5Dcreate(grpid, SIMPLE_VAR_NAME1, H5T_NATIVE_INT,
|
||||
* chunked. The H5Dcreate1() call will fail. */
|
||||
if ((datasetid = H5Dcreate1(grpid, SIMPLE_VAR_NAME1, H5T_NATIVE_INT,
|
||||
spaceid, plistid)) > 0) ERR;
|
||||
|
||||
/* Turn on error messages back on. */
|
||||
H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)&H5Eprint, stderr);
|
||||
H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)&H5Eprint1, stderr);
|
||||
|
||||
if (H5Pclose(fapl_id) < 0 ||
|
||||
H5Sclose(spaceid) < 0 ||
|
||||
@ -576,7 +576,7 @@ main()
|
||||
if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
|
||||
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
|
||||
|
||||
@ -586,7 +586,7 @@ main()
|
||||
if (H5Pset_layout(plistid, H5D_COMPACT) < 0)ERR;
|
||||
|
||||
/* Create the variable. */
|
||||
if ((datasetid = H5Dcreate(grpid, SIMPLE_VAR_NAME1, H5T_NATIVE_INT,
|
||||
if ((datasetid = H5Dcreate1(grpid, SIMPLE_VAR_NAME1, H5T_NATIVE_INT,
|
||||
spaceid, plistid)) < 0) ERR;
|
||||
|
||||
/* Write the data. */
|
||||
@ -607,7 +607,7 @@ main()
|
||||
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
|
||||
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
if ((datasetid = H5Dopen1(grpid, SIMPLE_VAR_NAME1)) < 0) ERR;
|
||||
if ((spaceid = H5Dget_space(datasetid)) < 0) ERR;
|
||||
@ -643,7 +643,7 @@ main()
|
||||
if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED|H5P_CRT_ORDER_INDEXED) < 0) ERR;
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) ERR;
|
||||
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
|
||||
|
||||
@ -659,12 +659,12 @@ main()
|
||||
|
||||
/* Create the variable. This will not work, because only
|
||||
* chunked datasets can use filters, and scalars can't be
|
||||
* chunked. The H5Dcreate() call will fail. */
|
||||
if ((datasetid = H5Dcreate(grpid, SIMPLE_VAR_NAME1, H5T_NATIVE_INT,
|
||||
* chunked. The H5Dcreate1() call will fail. */
|
||||
if ((datasetid = H5Dcreate1(grpid, SIMPLE_VAR_NAME1, H5T_NATIVE_INT,
|
||||
spaceid, plistid)) > 0) ERR;
|
||||
|
||||
/* Turn on error messages back on. */
|
||||
H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)&H5Eprint, stderr);
|
||||
H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)&H5Eprint1, stderr);
|
||||
|
||||
if (H5Pclose(fapl_id) < 0 ||
|
||||
H5Sclose(spaceid) < 0 ||
|
||||
|
@ -49,7 +49,7 @@ main()
|
||||
/* Open file. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GRP_NAME1, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GRP_NAME1, 0)) < 0) ERR;
|
||||
|
||||
/* Create string type. */
|
||||
if ((typeid = H5Tcopy(H5T_C_S1)) < 0) ERR;
|
||||
@ -59,7 +59,7 @@ main()
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((plistid = H5Pcreate(H5P_DATASET_CREATE)) < 0) ERR;
|
||||
if (H5Pset_fill_value(plistid, typeid, &f1) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate(grpid, VAR_NAME1, typeid,
|
||||
if ((datasetid = H5Dcreate1(grpid, VAR_NAME1, typeid,
|
||||
spaceid, plistid)) < 0) ERR;
|
||||
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
|
||||
data) < 0) ERR;
|
||||
|
@ -40,7 +40,7 @@ main()
|
||||
/* Open file. */
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate(fileid, GROUP_NAME, 0)) < 0) ERR;
|
||||
if ((grpid = H5Gcreate1(fileid, GROUP_NAME, 0)) < 0) ERR;
|
||||
|
||||
/* Create VLEN type. */
|
||||
if ((typeid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) ERR;
|
||||
@ -51,7 +51,7 @@ main()
|
||||
|
||||
/* Write an attribute of this vlen type. */
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, data) < 0) ERR;
|
||||
if (H5Aclose(attid) < 0) ERR;
|
||||
@ -61,7 +61,7 @@ main()
|
||||
|
||||
/* Reopen the file and read the vlen data. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, GROUP_NAME)) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, GROUP_NAME)) < 0) ERR;
|
||||
if ((attid = H5Aopen_name(grpid, ATT_NAME)) < 0) ERR;
|
||||
if ((spaceid = H5Aget_space(attid)) < 0) ERR;
|
||||
if ((typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
@ -120,7 +120,7 @@ main()
|
||||
/* /\* Create file. *\/ */
|
||||
/* if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, */
|
||||
/* H5P_DEFAULT)) < 0) ERR; */
|
||||
/* if ((grpid = H5Gcreate(fileid, "grp1", 0)) < 0) ERR; */
|
||||
/* if ((grpid = H5Gcreate1(fileid, "grp1", 0)) < 0) ERR; */
|
||||
|
||||
/* /\* Create VLEN type. *\/ */
|
||||
/* if ((vlen_typeid = H5Tvlen_create(H5T_NATIVE_FLOAT)) < 0) ERR; */
|
||||
@ -135,7 +135,7 @@ main()
|
||||
/* if (H5Tcommit(grpid, "sea_sounding_type", compound_typeid) < 0) ERR; */
|
||||
|
||||
/* if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR; */
|
||||
/* if ((datasetid = H5Dcreate(grpid, "sea_sounding_dataset", compound_typeid, */
|
||||
/* if ((datasetid = H5Dcreate1(grpid, "sea_sounding_dataset", compound_typeid, */
|
||||
/* spaceid, H5P_DEFAULT)) < 0) ERR; */
|
||||
/* if (H5Dwrite(datasetid, compound_typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT, */
|
||||
/* data) < 0) ERR; */
|
||||
|
@ -54,14 +54,14 @@ main()
|
||||
if ((typeid = H5Tcreate(H5T_COMPOUND, sizeof(struct s1))) < 0) ERR;
|
||||
if (H5Tinsert(typeid, "c1", HOFFSET(struct s1, c1), H5T_NATIVE_UCHAR) < 0) ERR;
|
||||
if (H5Tinsert(typeid, "d", HOFFSET(struct s1, d), H5T_NATIVE_DOUBLE) < 0) ERR;
|
||||
if (H5Tcommit(fileid, COMPOUND_NAME, typeid) < 0) ERR;
|
||||
if (H5Tcommit1(fileid, COMPOUND_NAME, typeid) < 0) ERR;
|
||||
|
||||
/* Create a space. */
|
||||
dims[0] = DIM1_LEN;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create a dataset of this compound type. */
|
||||
if ((datasetid = H5Dcreate(fileid, VAR_NAME, typeid, spaceid,
|
||||
if ((datasetid = H5Dcreate1(fileid, VAR_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Write some data. */
|
||||
|
@ -34,7 +34,7 @@
|
||||
static herr_t
|
||||
h5catch(void* ignored)
|
||||
{
|
||||
H5Eprint(NULL);
|
||||
H5Eprint1(NULL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@ -1008,7 +1008,7 @@ hdf5_set_log_level()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (set_auto((H5E_auto_t)&H5Eprint, stderr) < 0)
|
||||
if (set_auto((H5E_auto_t)&H5Eprint1, stderr) < 0)
|
||||
LOG((0, "H5Eset_auto failed!"));
|
||||
LOG((1, "HDF5 error messages turned on."));
|
||||
}
|
||||
@ -1020,7 +1020,7 @@ void
|
||||
nc_log_hdf5(void)
|
||||
{
|
||||
#ifdef USE_HDF5
|
||||
H5Eprint(NULL);
|
||||
H5Eprint1(NULL);
|
||||
#endif /* USE_HDF5 */
|
||||
}
|
||||
|
||||
|
@ -1979,7 +1979,7 @@ read_type(NC_GRP_INFO_T *grp, hid_t hdf_typeid, char *type_name)
|
||||
if ((ndims = H5Tget_array_ndims(member_hdf_typeid)) < 0)
|
||||
return NC_EHDFERR;
|
||||
|
||||
if (H5Tget_array_dims(member_hdf_typeid, dims, NULL) != ndims)
|
||||
if (H5Tget_array_dims(member_hdf_typeid, dims) != ndims)
|
||||
return NC_EHDFERR;
|
||||
|
||||
for (d = 0; d < ndims; d++)
|
||||
|
@ -550,8 +550,8 @@ put_att_grpa(NC_GRP_INFO_T *grp, int varid, NC_ATT_INFO_T *att)
|
||||
|
||||
/* Re-create the attribute with the type and length
|
||||
reflecting the new value (or values). */
|
||||
if ((attid = H5Acreate(locid, att->hdr.name, file_typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0)
|
||||
if ((attid = H5Acreate1(locid, att->hdr.name, file_typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0)
|
||||
BAIL(NC_EATTMETA);
|
||||
|
||||
/* Write the values, (even if length is zero). */
|
||||
@ -572,7 +572,7 @@ put_att_grpa(NC_GRP_INFO_T *grp, int varid, NC_ATT_INFO_T *att)
|
||||
/* The attribute does not exist yet. */
|
||||
|
||||
/* Create the attribute. */
|
||||
if ((attid = H5Acreate(locid, att->hdr.name, file_typeid, spaceid,
|
||||
if ((attid = H5Acreate1(locid, att->hdr.name, file_typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0)
|
||||
BAIL(NC_EATTMETA);
|
||||
|
||||
@ -663,7 +663,7 @@ write_coord_dimids(NC_VAR_INFO_T *var)
|
||||
BAIL(NC_EHDFERR);
|
||||
|
||||
/* Create the attribute. */
|
||||
if ((c_attid = H5Acreate(hdf5_var->hdf_datasetid, COORDINATES,
|
||||
if ((c_attid = H5Acreate1(hdf5_var->hdf_datasetid, COORDINATES,
|
||||
H5T_NATIVE_INT, c_spaceid, H5P_DEFAULT)) < 0)
|
||||
BAIL(NC_EHDFERR);
|
||||
|
||||
@ -708,7 +708,7 @@ write_netcdf4_dimid(hid_t datasetid, int dimid)
|
||||
H5P_DEFAULT, H5P_DEFAULT);
|
||||
else
|
||||
/* Create the attribute if needed. */
|
||||
dimid_attid = H5Acreate(datasetid, NC_DIMID_ATT_NAME,
|
||||
dimid_attid = H5Acreate1(datasetid, NC_DIMID_ATT_NAME,
|
||||
H5T_NATIVE_INT, dimid_spaceid, H5P_DEFAULT);
|
||||
if (dimid_attid < 0)
|
||||
BAIL(NC_EHDFERR);
|
||||
@ -1158,8 +1158,8 @@ commit_type(NC_GRP_INFO_T *grp, NC_TYPE_INFO_T *type)
|
||||
|
||||
for (d = 0; d < field->ndims; d++)
|
||||
dims[d] = field->dim_size[d];
|
||||
if ((hdf_typeid = H5Tarray_create(hdf_base_typeid, field->ndims,
|
||||
dims, NULL)) < 0)
|
||||
if ((hdf_typeid = H5Tarray_create1(hdf_base_typeid, field->ndims,
|
||||
dims, NULL)) < 0)
|
||||
{
|
||||
if (H5Tclose(hdf_base_typeid) < 0)
|
||||
return NC_EHDFERR;
|
||||
@ -1227,7 +1227,7 @@ commit_type(NC_GRP_INFO_T *grp, NC_TYPE_INFO_T *type)
|
||||
}
|
||||
|
||||
/* Commit the type. */
|
||||
if (H5Tcommit(hdf5_grp->hdf_grpid, type->hdr.name, hdf5_type->hdf_typeid) < 0)
|
||||
if (H5Tcommit1(hdf5_grp->hdf_grpid, type->hdr.name, hdf5_type->hdf_typeid) < 0)
|
||||
return NC_EHDFERR;
|
||||
type->committed = NC_TRUE;
|
||||
LOG((4, "just committed type %s, HDF typeid: 0x%x", type->hdr.name,
|
||||
@ -1272,7 +1272,7 @@ write_nc3_strict_att(hid_t hdf_grpid)
|
||||
* strict netcdf-3 rules. */
|
||||
if ((spaceid = H5Screate(H5S_SCALAR)) < 0)
|
||||
BAIL(NC_EFILEMETA);
|
||||
if ((attid = H5Acreate(hdf_grpid, NC3_STRICT_ATT_NAME,
|
||||
if ((attid = H5Acreate1(hdf_grpid, NC3_STRICT_ATT_NAME,
|
||||
H5T_NATIVE_INT, spaceid, H5P_DEFAULT)) < 0)
|
||||
BAIL(NC_EFILEMETA);
|
||||
if (H5Awrite(attid, H5T_NATIVE_INT, &one) < 0)
|
||||
@ -2532,7 +2532,7 @@ NC4_walk(hid_t gid, int* countp)
|
||||
otype = H5Gget_objtype_by_idx(gid,(size_t)i);
|
||||
switch(otype) {
|
||||
case H5G_GROUP:
|
||||
grpid = H5Gopen(gid,name);
|
||||
grpid = H5Gopen1(gid,name);
|
||||
NC4_walk(grpid,countp);
|
||||
H5Gclose(grpid);
|
||||
break;
|
||||
@ -2540,7 +2540,7 @@ NC4_walk(hid_t gid, int* countp)
|
||||
/* Check for phony_dim */
|
||||
if(strcmp(name,"phony_dim")==0)
|
||||
*countp = *countp + 1;
|
||||
dsid = H5Dopen(gid,name);
|
||||
dsid = H5Dopen1(gid,name);
|
||||
na = H5Aget_num_attrs(dsid);
|
||||
for(j = 0; j < na; j++) {
|
||||
hid_t aid = H5Aopen_idx(dsid,(unsigned int) j);
|
||||
|
@ -339,7 +339,7 @@ NC4_write_ncproperties(NC_FILE_INFO_T* h5)
|
||||
/* Create NCPROPS attribute */
|
||||
if((aspace = H5Screate(H5S_SCALAR)) < 0)
|
||||
{retval = NC_EFILEMETA; goto done;}
|
||||
if ((attid = H5Acreate(hdf5grpid, NCPROPS, atype, aspace, H5P_DEFAULT)) < 0)
|
||||
if ((attid = H5Acreate1(hdf5grpid, NCPROPS, atype, aspace, H5P_DEFAULT)) < 0)
|
||||
{retval = NC_EFILEMETA; goto done;}
|
||||
if (H5Awrite(attid, atype, prov->ncproperties) < 0)
|
||||
{retval = NC_EFILEMETA; goto done;}
|
||||
|
@ -739,7 +739,7 @@ NCZ_set_log_level()
|
||||
else
|
||||
{
|
||||
#ifdef LOOK
|
||||
if (set_auto((H5E_auto_t)&H5Eprint, stderr) < 0)
|
||||
if (set_auto((H5E_auto_t)&H5Eprint1, stderr) < 0)
|
||||
LOG((0, "H5Eset_auto failed!"));
|
||||
#endif
|
||||
LOG((1, "NCZ error messages turned on."));
|
||||
|
@ -22,7 +22,7 @@ redistribution conditions.
|
||||
|
||||
#ifdef USE_HDF5
|
||||
#include <hdf5.h>
|
||||
extern int H5Eprint1(FILE * stream);
|
||||
extern int H5Eprint11(FILE * stream);
|
||||
#endif
|
||||
|
||||
#define FLAGS4 (NC_INMEMORY|NC_NETCDF4|NC_CLOBBER)
|
||||
|
@ -24,7 +24,6 @@ See \ref copyright file for more info.
|
||||
|
||||
#ifdef USE_HDF5
|
||||
#include <hdf5.h>
|
||||
extern int H5Eprint1(FILE * stream);
|
||||
#endif
|
||||
|
||||
static int
|
||||
|
@ -81,7 +81,7 @@ writeszip()
|
||||
lcpl_id = H5Pcreate (H5P_LINK_CREATE);
|
||||
dapl_id = H5Pcreate (H5P_DATASET_ACCESS);
|
||||
|
||||
dataset32 = H5Dcreate (file, "datasetF32", H5T_NATIVE_FLOAT, data_space, lcpl_id, properties, dapl_id);
|
||||
dataset32 = H5Dcreate1 (file, "datasetF32", H5T_NATIVE_FLOAT, data_space, lcpl_id, properties, dapl_id);
|
||||
|
||||
/*
|
||||
* Write the array to the file. The datatype and dataspace
|
||||
@ -113,7 +113,7 @@ readszip()
|
||||
|
||||
file = H5Fopen (filename, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
properties = H5Pcreate(H5P_DATASET_ACCESS);
|
||||
dataset32 = H5Dopen(file, "datasetF32", properties);
|
||||
dataset32 = H5Dopen1(file, "datasetF32", properties);
|
||||
|
||||
/*
|
||||
* Read the array. This is similar to writing data,
|
||||
|
@ -298,7 +298,7 @@ init(int argc, char** argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
H5Eprint(stderr);
|
||||
H5Eprint1(stderr);
|
||||
init(argc,argv);
|
||||
if(test_bzip2() != NC_NOERR) ERRR;
|
||||
exit(nerrs > 0?1:0);
|
||||
|
@ -504,7 +504,7 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
H5Eprint(stderr);
|
||||
H5Eprint1(stderr);
|
||||
nc_set_log_level(1);
|
||||
#endif
|
||||
init(argc,argv);
|
||||
|
@ -410,7 +410,7 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
H5Eprint(stderr);
|
||||
H5Eprint1(stderr);
|
||||
nc_set_log_level(1);
|
||||
#endif
|
||||
init(argc,argv);
|
||||
|
@ -496,7 +496,7 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
H5Eprint(stderr);
|
||||
H5Eprint1(stderr);
|
||||
nc_set_log_level(1);
|
||||
#endif
|
||||
init(argc,argv);
|
||||
|
@ -359,7 +359,7 @@ int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
H5Eprint(stderr);
|
||||
H5Eprint1(stderr);
|
||||
nc_set_log_level(1);
|
||||
#endif
|
||||
init(argc,argv);
|
||||
|
@ -65,13 +65,13 @@ main()
|
||||
* cause overflows. */
|
||||
dims[0] = DIM1_LEN;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate(grpid, INT_VAR_NAME, H5T_NATIVE_INT,
|
||||
if ((datasetid = H5Dcreate1(grpid, INT_VAR_NAME, H5T_NATIVE_INT,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((schar_datasetid = H5Dcreate(grpid, SCHAR_VAR_NAME, H5T_NATIVE_SCHAR,
|
||||
if ((schar_datasetid = H5Dcreate1(grpid, SCHAR_VAR_NAME, H5T_NATIVE_SCHAR,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((double_datasetid = H5Dcreate(grpid, DOUBLE_VAR_NAME, H5T_NATIVE_DOUBLE,
|
||||
if ((double_datasetid = H5Dcreate1(grpid, DOUBLE_VAR_NAME, H5T_NATIVE_DOUBLE,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((float_datasetid = H5Dcreate(grpid, FLOAT_VAR_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((float_datasetid = H5Dcreate1(grpid, FLOAT_VAR_NAME, H5T_NATIVE_FLOAT,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Dwrite(datasetid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plistid,
|
||||
int_data_out) < 0) ERR;
|
||||
|
@ -55,23 +55,23 @@ main()
|
||||
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Create scalar datasets of variable- and fixed-length strings. */
|
||||
if ((vsdsetid = H5Dcreate (fileid, VS_VAR_NAME, vstypeid, scalar_spaceid,
|
||||
if ((vsdsetid = H5Dcreate1 (fileid, VS_VAR_NAME, vstypeid, scalar_spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Dwrite (vsdsetid, vstypeid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &vs)) ERR;
|
||||
if ((fsdsetid = H5Dcreate (fileid, FS_VAR_NAME, fstypeid, scalar_spaceid,
|
||||
if ((fsdsetid = H5Dcreate1 (fileid, FS_VAR_NAME, fstypeid, scalar_spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Dwrite (fsdsetid, fstypeid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &fsdata)) ERR;
|
||||
|
||||
/* Create 1D dataset of variable-length strings. */
|
||||
if ((v1ddsetid = H5Dcreate (fileid, V1D_VAR_NAME, vstypeid, v1dspaceid,
|
||||
if ((v1ddsetid = H5Dcreate1 (fileid, V1D_VAR_NAME, vstypeid, v1dspaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Dwrite (v1ddsetid, vstypeid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &v1ddata)) ERR;
|
||||
|
||||
/* Write scalar global attributes of these types. */
|
||||
if ((vsattid = H5Acreate(fileid, VS_ATT_NAME, vstypeid, scalar_spaceid,
|
||||
if ((vsattid = H5Acreate1(fileid, VS_ATT_NAME, vstypeid, scalar_spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(vsattid, vstypeid, &vs) < 0) ERR;
|
||||
if ((fsattid = H5Acreate(fileid, FS_ATT_NAME, fstypeid, scalar_spaceid,
|
||||
if ((fsattid = H5Acreate1(fileid, FS_ATT_NAME, fstypeid, scalar_spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(fsattid, fstypeid, &fsdata) < 0) ERR;
|
||||
|
||||
|
@ -40,7 +40,7 @@ main()
|
||||
if (H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) ERR;
|
||||
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, fapl_id)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
|
||||
for (i = 0; i < num_obj; i++)
|
||||
|
@ -90,15 +90,15 @@ main(int argc, char **argv)
|
||||
if ((pres_spaceid = H5Screate_simple(DIMS_2, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create our dimension scales. */
|
||||
if ((lat_dimscaleid = H5Dcreate(fileid, LAT_NAME, H5T_NATIVE_INT,
|
||||
if ((lat_dimscaleid = H5Dcreate1(fileid, LAT_NAME, H5T_NATIVE_INT,
|
||||
lat_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSset_scale(lat_dimscaleid, NULL) < 0) ERR;
|
||||
if ((lon_dimscaleid = H5Dcreate(fileid, LON_NAME, H5T_NATIVE_INT,
|
||||
if ((lon_dimscaleid = H5Dcreate1(fileid, LON_NAME, H5T_NATIVE_INT,
|
||||
lon_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSset_scale(lon_dimscaleid, NULL) < 0) ERR;
|
||||
|
||||
/* Create a variable which uses these two dimscales. */
|
||||
if ((pres_datasetid = H5Dcreate(fileid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((pres_datasetid = H5Dcreate1(fileid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
pres_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5DSattach_scale(pres_datasetid, lat_dimscaleid, 0) < 0) ERR;
|
||||
if (H5DSattach_scale(pres_datasetid, lon_dimscaleid, 1) < 0) ERR;
|
||||
@ -159,7 +159,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* Open the file. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Check it out. */
|
||||
if ((datasetid = H5Dopen1(grpid, PRES_NAME)) < 0) ERR;
|
||||
@ -209,7 +209,7 @@ main(int argc, char **argv)
|
||||
if ((pres_spaceid = H5Screate_simple(DIMS_2, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create a variable. It will not have dimension scales. */
|
||||
if ((pres_datasetid = H5Dcreate(fileid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((pres_datasetid = H5Dcreate1(fileid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
pres_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Ring down the curtain. */
|
||||
@ -245,7 +245,7 @@ main(int argc, char **argv)
|
||||
if ((pres_spaceid = H5Screate_simple(DIMS_2, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create a variable. It will not have dimension scales. */
|
||||
if ((pres_datasetid = H5Dcreate(fileid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((pres_datasetid = H5Dcreate1(fileid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
pres_spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Ring down the curtain. */
|
||||
@ -281,9 +281,9 @@ main(int argc, char **argv)
|
||||
if ((spaceid = H5Screate_simple(DIMS_2, dims, dims)) < 0) ERR;
|
||||
|
||||
/* Create two datasets. They will not have dimension scales. */
|
||||
if ((pres_datasetid = H5Dcreate(fileid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((pres_datasetid = H5Dcreate1(fileid, PRES_NAME, H5T_NATIVE_FLOAT,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((temp_datasetid = H5Dcreate(fileid, TEMP_NAME, H5T_NATIVE_FLOAT,
|
||||
if ((temp_datasetid = H5Dcreate1(fileid, TEMP_NAME, H5T_NATIVE_FLOAT,
|
||||
spaceid, H5P_DEFAULT)) < 0) ERR;
|
||||
|
||||
/* Ring down the curtain. */
|
||||
@ -328,7 +328,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* Write an attribute of this (string) type. */
|
||||
if ((spaceid = H5Screate_simple(1, dims, NULL)) < 0) ERR;
|
||||
if ((attid = H5Acreate(fileid, ATT_NAME2, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(fileid, ATT_NAME2, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, data) < 0) ERR;
|
||||
|
||||
|
@ -219,7 +219,7 @@ main(int argc, char **argv)
|
||||
if (H5Pset_chunk(propid, 1, dims)) ERR;
|
||||
if (H5Pset_szip(propid, H5_SZIP_EC_OPTION_MASK, 32)) ERR;
|
||||
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;
|
||||
if ((datasetid = H5Dcreate(grpid, BATTLE_RECORD, H5T_NATIVE_INT,
|
||||
if ((datasetid = H5Dcreate1(grpid, BATTLE_RECORD, H5T_NATIVE_INT,
|
||||
spaceid, propid)) < 0) ERR;
|
||||
if (H5Dwrite(datasetid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
|
||||
data_out) < 0) ERR;
|
||||
|
@ -52,7 +52,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* Write an attribute of this type. */
|
||||
if ((spaceid = H5Screate(H5S_SCALAR)) < 0) ERR;
|
||||
if ((attid = H5Acreate(grpid, ATT_NAME, typeid, spaceid,
|
||||
if ((attid = H5Acreate1(grpid, ATT_NAME, typeid, spaceid,
|
||||
H5P_DEFAULT)) < 0) ERR;
|
||||
if (H5Awrite(attid, typeid, &data) < 0) ERR;
|
||||
|
||||
@ -66,7 +66,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* Now reopen the file and check it out. */
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
if ((attid = H5Aopen_name(grpid, ATT_NAME)) < 0) ERR;
|
||||
if ((typeid = H5Aget_type(attid)) < 0) ERR;
|
||||
if ((spaceid = H5Aget_space(attid)) < 0) ERR;
|
||||
|
@ -309,7 +309,7 @@ init(int argc, char** argv)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
H5Eprint(stderr);
|
||||
H5Eprint1(stderr);
|
||||
init(argc,argv);
|
||||
if(test_multi() != NC_NOERR) ERRR;
|
||||
exit(nerrs > 0?1:0);
|
||||
|
@ -573,7 +573,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* Open one of the netCDF test files. */
|
||||
if ((fileid = H5Fopen(REF_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* How many objects in this group? */
|
||||
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
|
||||
@ -632,7 +632,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* Open one of the netCDF test files. */
|
||||
if ((fileid = H5Fopen(REF_FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* There is one att: open it by index. */
|
||||
if ((attid = H5Aopen_idx(grpid, 0)) < 0) ERR;
|
||||
|
@ -28,7 +28,7 @@ main()
|
||||
char obj_name[MAX_NAME];
|
||||
|
||||
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) ERR;
|
||||
if ((grpid = H5Gopen(fileid, "/")) < 0) ERR;
|
||||
if ((grpid = H5Gopen1(fileid, "/")) < 0) ERR;
|
||||
|
||||
/* Find the variables. Read their metadata and attributes. */
|
||||
if (H5Gget_num_objs(grpid, &num_obj) < 0) ERR;
|
||||
|
@ -306,7 +306,7 @@ dump(Format* format)
|
||||
|
||||
#ifdef H5
|
||||
if(format->debug) {
|
||||
H5Eset_auto2(H5E_DEFAULT,(H5E_auto2_t)H5Eprint,stderr);
|
||||
H5Eset_auto2(H5E_DEFAULT,(H5E_auto2_t)H5Eprint1,stderr);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -200,7 +200,7 @@ getoptions(int* argcp, char*** argvp)
|
||||
|
||||
if(options->debug) {
|
||||
#ifdef USE_HDF5
|
||||
H5Eset_auto2(H5E_DEFAULT,(H5E_auto2_t)H5Eprint,stderr);
|
||||
H5Eset_auto2(H5E_DEFAULT,(H5E_auto2_t)H5Eprint1,stderr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user