mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
[svn-r14144] Description:
Move H5Gget_objinfo() to deprecated symbols section and retarget internal usage to H5Lget_info()/H5Oget_info(). Misc. other code cleanups... Tested on: FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (kagiso) Linux/64 2.6 (smirom) AIX/32 5.3 (copper) Solaris/32 2.10 (linew) Mac OS X/32 10.4.10 (amazon)
This commit is contained in:
parent
15d118faed
commit
579284f422
@ -341,6 +341,7 @@ void CommonFG::move( const H5std_string& src, const H5std_string& dst ) const
|
||||
move( src.c_str(), dst.c_str() );
|
||||
}
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getObjinfo
|
||||
///\brief Returns information about an object.
|
||||
@ -402,6 +403,7 @@ void CommonFG::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const
|
||||
{
|
||||
getObjinfo( name.c_str(), statbuf );
|
||||
}
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Function: CommonFG::getLinkval
|
||||
|
@ -69,13 +69,6 @@ class H5_DLLCPP CommonFG {
|
||||
// Returns the number of objects in this group.
|
||||
hsize_t getNumObjs() const;
|
||||
|
||||
// Returns information about an HDF5 object, given by its name,
|
||||
// at this location.
|
||||
void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const;
|
||||
void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const;
|
||||
void getObjinfo(const char* name, H5G_stat_t& statbuf) const;
|
||||
void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const;
|
||||
|
||||
// Retrieves the name of an object in this group, given the
|
||||
// object's index.
|
||||
ssize_t getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const;
|
||||
@ -87,6 +80,13 @@ class H5_DLLCPP CommonFG {
|
||||
H5G_obj_t getObjTypeByIdx(hsize_t idx, H5std_string& type_name) const;
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Returns information about an HDF5 object, given by its name,
|
||||
// at this location.
|
||||
void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const;
|
||||
void getObjinfo(const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf) const;
|
||||
void getObjinfo(const char* name, H5G_stat_t& statbuf) const;
|
||||
void getObjinfo(const H5std_string& name, H5G_stat_t& statbuf) const;
|
||||
|
||||
// Iterates over the elements of this group - not implemented in
|
||||
// C++ style yet.
|
||||
int iterateElems(const char* name, int *idx, H5G_iterate_t op, void *op_data);
|
||||
|
@ -1026,7 +1026,9 @@ static void test_attr_dtype_shared()
|
||||
{
|
||||
int data=8; /* Data to write */
|
||||
int rdata=0; /* Read read in */
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
H5G_stat_t statbuf; /* Object's information */
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
h5_stat_size_t filesize; /* Size of file after modifications */
|
||||
|
||||
// Output message about test being performed
|
||||
@ -1054,9 +1056,11 @@ static void test_attr_dtype_shared()
|
||||
// Commit datatype to file
|
||||
dtype.commit(fid1, TYPE1_NAME);
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Check reference count on named datatype
|
||||
fid1.getObjinfo(TYPE1_NAME, statbuf);
|
||||
verify_val((int)statbuf.nlink, 1, "DataType::getObjinfo", __LINE__, __FILE__);
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Create dataspace for dataset
|
||||
DataSpace dspace;
|
||||
@ -1070,16 +1074,20 @@ static void test_attr_dtype_shared()
|
||||
// Create dataset
|
||||
DataSet dset = fid1.createDataSet(DSET1_NAME, dtype, dspace);
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Check reference count on named datatype
|
||||
fid1.getObjinfo(TYPE1_NAME, statbuf);
|
||||
verify_val((int)statbuf.nlink, 2, "H5File::getObjinfo", __LINE__, __FILE__);
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Create attribute on dataset
|
||||
Attribute attr = dset.createAttribute(ATTR1_NAME,dtype,dspace);
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Check reference count on named datatype
|
||||
fid1.getObjinfo(TYPE1_NAME, statbuf);
|
||||
verify_val((int)statbuf.nlink, 3, "DataSet::getObjinfo", __LINE__, __FILE__);
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Close attribute
|
||||
attr.close();
|
||||
@ -1087,16 +1095,20 @@ static void test_attr_dtype_shared()
|
||||
// Delete attribute
|
||||
dset.removeAttr(ATTR1_NAME);
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Check reference count on named datatype
|
||||
fid1.getObjinfo(TYPE1_NAME, statbuf);
|
||||
verify_val((int)statbuf.nlink, 2, "DataSet::getObjinfo after DataSet::removeAttr", __LINE__, __FILE__);
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Create attribute on dataset
|
||||
attr = dset.createAttribute(ATTR1_NAME,dtype,dspace);
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Check reference count on named datatype
|
||||
fid1.getObjinfo(TYPE1_NAME, statbuf);
|
||||
verify_val((int)statbuf.nlink, 3, "DataSet::createAttribute", __LINE__, __FILE__);
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Write data into the attribute
|
||||
attr.write(PredType::NATIVE_INT,&data);
|
||||
@ -1125,18 +1137,22 @@ static void test_attr_dtype_shared()
|
||||
delete attr2;
|
||||
delete dset2;
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Check reference count on named datatype
|
||||
fid1.getObjinfo(TYPE1_NAME, statbuf);
|
||||
verify_val((int)statbuf.nlink, 3, "DataSet::openAttribute", __LINE__, __FILE__);
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Unlink the dataset
|
||||
fid1.unlink(DSET1_NAME);
|
||||
|
||||
} // end of enclosing to test reference counts
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
// Check reference count on named datatype
|
||||
fid1.getObjinfo(TYPE1_NAME, statbuf);
|
||||
verify_val((int)statbuf.nlink, 1, "H5File::unlink", __LINE__, __FILE__);
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
// Unlink the named datatype
|
||||
fid1.unlink(TYPE1_NAME);
|
||||
|
@ -138,7 +138,7 @@ herr_t H5DSattach_scale(hid_t did,
|
||||
hobj_ref_t ref_j; /* iterator reference */
|
||||
hvl_t *buf; /* VL buffer to store in the attribute */
|
||||
hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
|
||||
H5G_stat_t sb1, sb2;
|
||||
H5O_info_t oi1, oi2;
|
||||
H5I_type_t it1, it2;
|
||||
int i, len;
|
||||
int found_ds=0;
|
||||
@ -152,15 +152,15 @@ herr_t H5DSattach_scale(hid_t did,
|
||||
return FAIL;
|
||||
|
||||
/* get info for the dataset in the parameter list */
|
||||
if (H5Gget_objinfo(did,".",TRUE,&sb1)<0)
|
||||
if(H5Oget_info(did, ".", &oi1, H5P_DEFAULT) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* get info for the scale in the parameter list */
|
||||
if (H5Gget_objinfo(dsid,".",TRUE,&sb2)<0)
|
||||
if(H5Oget_info(dsid, ".", &oi2, H5P_DEFAULT) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* same object, not valid */
|
||||
if (!memcmp(&sb1.fileno, &sb2.fileno, sizeof(sb1.fileno)) && !memcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno)))
|
||||
if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
|
||||
return FAIL;
|
||||
|
||||
/* get ID type */
|
||||
@ -329,18 +329,16 @@ herr_t H5DSattach_scale(hid_t did,
|
||||
goto out;
|
||||
|
||||
/* get info for DS in the parameter list */
|
||||
if (H5Gget_objinfo(dsid,".",TRUE,&sb1)<0)
|
||||
if(H5Oget_info(dsid, ".", &oi1, H5P_DEFAULT) < 0)
|
||||
goto out;
|
||||
|
||||
/* get info for this DS */
|
||||
if (H5Gget_objinfo(dsid_j,".",TRUE,&sb2)<0)
|
||||
if(H5Oget_info(dsid_j, ".", &oi2, H5P_DEFAULT) < 0)
|
||||
goto out;
|
||||
|
||||
/* same object, so this DS scale is already in this DIM IDX */
|
||||
if (!memcmp(&sb1.fileno, &sb2.fileno, sizeof(sb1.fileno)) && !memcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno)))
|
||||
{
|
||||
if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
|
||||
found_ds = 1;
|
||||
}
|
||||
|
||||
/* close the dereferenced dataset */
|
||||
if (H5Dclose(dsid_j)<0)
|
||||
@ -596,14 +594,14 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
hid_t tid = -1; /* attribute type ID */
|
||||
hid_t aid = -1; /* attribute ID */
|
||||
int rank; /* rank of dataset */
|
||||
ds_list_t *dsbuf=NULL; /* array of attribute data in the DS pointing to the dataset */
|
||||
ds_list_t *dsbufn=NULL; /* array of attribute data in the DS pointing to the dataset */
|
||||
hsize_t *dims=NULL; /* dimension of the "REFERENCE_LIST" array */
|
||||
ds_list_t *dsbuf = NULL; /* array of attribute data in the DS pointing to the dataset */
|
||||
ds_list_t *dsbufn = NULL; /* array of attribute data in the DS pointing to the dataset */
|
||||
hsize_t *dims = NULL; /* dimension of the "REFERENCE_LIST" array */
|
||||
hobj_ref_t ref; /* reference to the DS */
|
||||
hvl_t *buf=NULL; /* VL buffer to store in the attribute */
|
||||
hvl_t *buf = NULL; /* VL buffer to store in the attribute */
|
||||
unsigned i, j, jj;
|
||||
H5G_stat_t sb1, sb2, sb3, sb4;
|
||||
int found_dset=0, found_ds=0;
|
||||
H5O_info_t oi1, oi2, oi3, oi4;
|
||||
int found_dset = 0, found_ds = 0;
|
||||
H5I_type_t it1, it2;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -615,15 +613,15 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
return FAIL;
|
||||
|
||||
/* get info for the dataset in the parameter list */
|
||||
if (H5Gget_objinfo(did,".",TRUE,&sb1)<0)
|
||||
if(H5Oget_info(did, ".", &oi1, H5P_DEFAULT) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* get info for the scale in the parameter list */
|
||||
if (H5Gget_objinfo(dsid,".",TRUE,&sb2)<0)
|
||||
if(H5Oget_info(dsid, ".", &oi2, H5P_DEFAULT) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* same object, not valid */
|
||||
if (!memcmp(&sb1.fileno, &sb2.fileno, sizeof(sb1.fileno)) && !memcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno)))
|
||||
if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
|
||||
return FAIL;
|
||||
|
||||
/* get ID type */
|
||||
@ -709,20 +707,17 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
goto out;
|
||||
|
||||
/* get info for DS in the parameter list */
|
||||
if (H5Gget_objinfo(dsid,".",TRUE,&sb1)<0)
|
||||
if(H5Oget_info(dsid, ".", &oi1, H5P_DEFAULT) < 0)
|
||||
goto out;
|
||||
|
||||
/* get info for this DS */
|
||||
if (H5Gget_objinfo(dsid_j,".",TRUE,&sb2)<0)
|
||||
if(H5Oget_info(dsid_j, ".", &oi2, H5P_DEFAULT) < 0)
|
||||
goto out;
|
||||
|
||||
/* same object, reset */
|
||||
if (!memcmp(&sb1.fileno, &sb2.fileno, sizeof(sb1.fileno)) && !memcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno)))
|
||||
{
|
||||
if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr) {
|
||||
for(jj=j; jj<buf[idx].len-1; jj++)
|
||||
{
|
||||
((hobj_ref_t *)buf[idx].p)[jj] = ((hobj_ref_t *)buf[idx].p)[jj+1];
|
||||
}
|
||||
buf[idx].len--;
|
||||
|
||||
found_ds = 1;
|
||||
@ -794,21 +789,17 @@ herr_t H5DSdetach_scale(hid_t did,
|
||||
goto out;
|
||||
|
||||
/* get info for dataset in the parameter list */
|
||||
if (H5Gget_objinfo(did,".",TRUE,&sb3)<0)
|
||||
if(H5Oget_info(did, ".", &oi3, H5P_DEFAULT) < 0)
|
||||
goto out;
|
||||
|
||||
/* get info for this dataset */
|
||||
if (H5Gget_objinfo(did_i,".",TRUE,&sb4)<0)
|
||||
if(H5Oget_info(did_i, ".", &oi4, H5P_DEFAULT) < 0)
|
||||
goto out;
|
||||
|
||||
/* same object, reset. we want to detach only for this DIM */
|
||||
if (!memcmp(&sb3.fileno, &sb4.fileno, sizeof(sb3.fileno)) && !memcmp(&sb3.objno, &sb4.objno, sizeof(sb3.objno))
|
||||
&& (int)idx==dsbuf[i].dim_idx)
|
||||
{
|
||||
if(oi3.fileno == oi4.fileno && oi3.addr == oi4.addr && (int)idx == dsbuf[i].dim_idx) {
|
||||
for(jj=i; jj<nelmts-1; jj++)
|
||||
{
|
||||
dsbuf[jj] = dsbuf[jj+1];
|
||||
}
|
||||
nelmts--;
|
||||
found_dset=1;
|
||||
|
||||
@ -966,7 +957,7 @@ htri_t H5DSis_attached(hid_t did,
|
||||
hvl_t *buf; /* VL buffer to store in the attribute */
|
||||
hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */
|
||||
hid_t did_i; /* dataset ID in REFERENCE_LIST */
|
||||
H5G_stat_t sb1, sb2, sb3, sb4;
|
||||
H5O_info_t oi1, oi2, oi3, oi4;
|
||||
H5I_type_t it1, it2;
|
||||
int i;
|
||||
int found_dset=0, found_ds=0;
|
||||
@ -980,15 +971,15 @@ htri_t H5DSis_attached(hid_t did,
|
||||
return FAIL;
|
||||
|
||||
/* get info for the dataset in the parameter list */
|
||||
if (H5Gget_objinfo(did,".",TRUE,&sb1)<0)
|
||||
if(H5Oget_info(did, ".", &oi1, H5P_DEFAULT) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* get info for the scale in the parameter list */
|
||||
if (H5Gget_objinfo(dsid,".",TRUE,&sb2)<0)
|
||||
if(H5Oget_info(dsid, ".", &oi2, H5P_DEFAULT) < 0)
|
||||
return FAIL;
|
||||
|
||||
/* same object, not valid */
|
||||
if (!memcmp(&sb1.fileno, &sb2.fileno, sizeof(sb1.fileno)) && !memcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno)))
|
||||
if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
|
||||
return FAIL;
|
||||
|
||||
/* get ID type */
|
||||
@ -1062,18 +1053,16 @@ htri_t H5DSis_attached(hid_t did,
|
||||
goto out;
|
||||
|
||||
/* get info for DS in the parameter list */
|
||||
if (H5Gget_objinfo(dsid,".",TRUE,&sb1)<0)
|
||||
if(H5Oget_info(dsid, ".", &oi1, H5P_DEFAULT) < 0)
|
||||
goto out;
|
||||
|
||||
/* get info for this DS */
|
||||
if (H5Gget_objinfo(dsid_j,".",TRUE,&sb2)<0)
|
||||
if(H5Oget_info(dsid_j, ".", &oi2, H5P_DEFAULT) < 0)
|
||||
goto out;
|
||||
|
||||
/* same object */
|
||||
if (!memcmp(&sb1.fileno, &sb2.fileno, sizeof(sb1.fileno)) && !memcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno)))
|
||||
{
|
||||
if(oi1.fileno == oi2.fileno && oi1.addr == oi2.addr)
|
||||
found_ds = 1;
|
||||
}
|
||||
|
||||
/* close the dereferenced dataset */
|
||||
if (H5Dclose(dsid_j)<0)
|
||||
@ -1150,18 +1139,16 @@ htri_t H5DSis_attached(hid_t did,
|
||||
goto out;
|
||||
|
||||
/* get info for dataset in the parameter list */
|
||||
if (H5Gget_objinfo(did,".",TRUE,&sb3)<0)
|
||||
if(H5Oget_info(did, ".", &oi3, H5P_DEFAULT) < 0)
|
||||
goto out;
|
||||
|
||||
/* get info for this dataset */
|
||||
if (H5Gget_objinfo(did_i,".",TRUE,&sb4)<0)
|
||||
if(H5Oget_info(did_i, ".", &oi4, H5P_DEFAULT) < 0)
|
||||
goto out;
|
||||
|
||||
/* same object */
|
||||
if (!memcmp(&sb3.fileno, &sb4.fileno, sizeof(sb3.fileno)) && !memcmp(&sb3.objno, &sb4.objno, sizeof(sb3.objno))
|
||||
&& (int)idx==dsbuf[i].dim_idx) {
|
||||
if(oi3.fileno == oi4.fileno && oi3.addr == oi4.addr && (int)idx==dsbuf[i].dim_idx)
|
||||
found_dset=1;
|
||||
} /* if */
|
||||
|
||||
/* close the dereferenced dataset */
|
||||
if (H5Dclose(did_i)<0)
|
||||
|
511
hl/src/H5LT.c
511
hl/src/H5LT.c
@ -38,13 +38,11 @@ int indent = 0;
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5LT_open_id( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
int obj_type );
|
||||
|
||||
herr_t H5LT_close_id( hid_t obj_id,
|
||||
int obj_type );
|
||||
static herr_t H5LT_get_attribute_mem(hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
hid_t mem_type_id,
|
||||
void *data);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
@ -1121,16 +1119,10 @@ herr_t H5LTset_attribute_string( hid_t loc_id,
|
||||
hid_t attr_id;
|
||||
hid_t obj_id;
|
||||
int has_attr;
|
||||
H5G_stat_t statbuf;
|
||||
size_t attr_size;
|
||||
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo( loc_id, obj_name, 1, &statbuf )<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
if ((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0)
|
||||
return -1;
|
||||
|
||||
/* Create the attribute */
|
||||
@ -1176,14 +1168,14 @@ herr_t H5LTset_attribute_string( hid_t loc_id,
|
||||
goto out;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
if(H5Oclose(obj_id) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
|
||||
H5LT_close_id( obj_id, statbuf.type );
|
||||
H5Oclose(obj_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1219,14 +1211,9 @@ herr_t H5LT_set_attribute_numerical( hid_t loc_id,
|
||||
hid_t obj_id, sid, attr_id;
|
||||
hsize_t dim_size=size;
|
||||
int has_attr;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
if ((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0)
|
||||
return -1;
|
||||
|
||||
/* Create the data space for the attribute. */
|
||||
@ -1260,99 +1247,16 @@ herr_t H5LT_set_attribute_numerical( hid_t loc_id,
|
||||
goto out;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
if(H5Oclose(obj_id) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5LT_close_id( obj_id, statbuf.type );
|
||||
H5Oclose(obj_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5LT_open_id
|
||||
*
|
||||
* Purpose: Private function used by H5LT_set_attribute_*
|
||||
*
|
||||
* Return: Success: 0, Failure: -1
|
||||
*
|
||||
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
||||
*
|
||||
* Date: September 19, 2002
|
||||
*
|
||||
* Comments:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5LT_open_id( hid_t loc_id,
|
||||
const char *obj_name,
|
||||
int obj_type /*basic object type*/ )
|
||||
{
|
||||
hid_t obj_id = -1;
|
||||
|
||||
switch(obj_type) {
|
||||
case H5G_DATASET:
|
||||
/* Open the dataset. */
|
||||
if((obj_id = H5Dopen(loc_id, obj_name)) < 0)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
case H5G_GROUP:
|
||||
/* Open the group. */
|
||||
if((obj_id = H5Gopen2(loc_id, obj_name, H5P_DEFAULT)) < 0)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
return obj_id;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5LT_close_id
|
||||
*
|
||||
* Purpose: Private function used by H5LT_set_attribute_*
|
||||
*
|
||||
* Return: Success: 0, Failure: -1
|
||||
*
|
||||
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
||||
*
|
||||
* Date: September 19, 2002
|
||||
*
|
||||
* Comments:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
herr_t H5LT_close_id( hid_t obj_id,
|
||||
int obj_type /*basic object type*/ )
|
||||
{
|
||||
switch ( obj_type )
|
||||
{
|
||||
case H5G_DATASET:
|
||||
/* Close the dataset. */
|
||||
if ( H5Dclose( obj_id ) < 0 )
|
||||
return -1;
|
||||
break;
|
||||
|
||||
case H5G_GROUP:
|
||||
/* Close the group. */
|
||||
if ( H5Gclose( obj_id ) < 0 )
|
||||
return -1;
|
||||
break;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5LTset_attribute_char
|
||||
@ -1825,21 +1729,16 @@ herr_t H5LTget_attribute_ndims( hid_t loc_id,
|
||||
{
|
||||
hid_t attr_id;
|
||||
hid_t sid;
|
||||
H5G_stat_t statbuf;
|
||||
hid_t obj_id;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo( loc_id, obj_name, 1, &statbuf )<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
if ((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0)
|
||||
return -1;
|
||||
|
||||
/* Open the attribute. */
|
||||
if ( ( attr_id = H5Aopen_name( obj_id, attr_name ) ) < 0 )
|
||||
{
|
||||
H5LT_close_id( obj_id, statbuf.type );
|
||||
H5Oclose(obj_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1860,14 +1759,14 @@ herr_t H5LTget_attribute_ndims( hid_t loc_id,
|
||||
goto out;;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
if(H5Oclose(obj_id) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5Aclose( attr_id );
|
||||
H5LT_close_id( obj_id, statbuf.type );
|
||||
H5Oclose(obj_id);
|
||||
return -1;
|
||||
|
||||
}
|
||||
@ -1897,21 +1796,16 @@ herr_t H5LTget_attribute_info( hid_t loc_id,
|
||||
hid_t attr_id;
|
||||
hid_t tid;
|
||||
hid_t sid;
|
||||
H5G_stat_t statbuf;
|
||||
hid_t obj_id;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo( loc_id, obj_name, 1, &statbuf )<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
if ((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0)
|
||||
return -1;
|
||||
|
||||
/* Open the attribute. */
|
||||
if ( ( attr_id = H5Aopen_name( obj_id, attr_name ) ) < 0 )
|
||||
{
|
||||
H5LT_close_id( obj_id, statbuf.type );
|
||||
H5Oclose(obj_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1945,15 +1839,15 @@ herr_t H5LTget_attribute_info( hid_t loc_id,
|
||||
goto out;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
if(H5Oclose(obj_id) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5Tclose( tid );
|
||||
H5Aclose( attr_id );
|
||||
H5LT_close_id( obj_id, statbuf.type );
|
||||
H5Tclose(tid);
|
||||
H5Aclose(attr_id);
|
||||
H5Oclose(obj_id);
|
||||
return -1;
|
||||
|
||||
}
|
||||
@ -2695,17 +2589,11 @@ herr_t H5LTget_attribute_string( hid_t loc_id,
|
||||
const char *attr_name,
|
||||
char *data )
|
||||
{
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
if ((obj_id = H5Oopen( loc_id, obj_name, H5P_DEFAULT)) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
@ -2713,7 +2601,7 @@ herr_t H5LTget_attribute_string( hid_t loc_id,
|
||||
return -1;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
if(H5Oclose(obj_id) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
@ -2742,29 +2630,11 @@ herr_t H5LTget_attribute_char( hid_t loc_id,
|
||||
const char *attr_name,
|
||||
char *data )
|
||||
{
|
||||
/* Get the attribute */
|
||||
if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_CHAR, data) < 0)
|
||||
return -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
if ( H5LT_get_attribute_mem( obj_id, attr_name, H5T_NATIVE_CHAR, data ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -2789,29 +2659,11 @@ herr_t H5LTget_attribute_uchar( hid_t loc_id,
|
||||
const char *attr_name,
|
||||
unsigned char *data )
|
||||
{
|
||||
/* Get the attribute */
|
||||
if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_UCHAR, data) < 0)
|
||||
return -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
if ( H5LT_get_attribute_mem( obj_id, attr_name, H5T_NATIVE_UCHAR, data ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -2838,29 +2690,11 @@ herr_t H5LTget_attribute_short( hid_t loc_id,
|
||||
const char *attr_name,
|
||||
short *data )
|
||||
{
|
||||
/* Get the attribute */
|
||||
if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_SHORT, data) < 0)
|
||||
return -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
if ( H5LT_get_attribute_mem( obj_id, attr_name, H5T_NATIVE_SHORT, data ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -2885,29 +2719,11 @@ herr_t H5LTget_attribute_ushort( hid_t loc_id,
|
||||
const char *attr_name,
|
||||
unsigned short *data )
|
||||
{
|
||||
/* Get the attribute */
|
||||
if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_USHORT, data) < 0)
|
||||
return -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
if ( H5LT_get_attribute_mem( obj_id, attr_name, H5T_NATIVE_USHORT, data ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -2934,29 +2750,11 @@ herr_t H5LTget_attribute_int( hid_t loc_id,
|
||||
const char *attr_name,
|
||||
int *data )
|
||||
{
|
||||
/* Get the attribute */
|
||||
if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_INT, data) < 0)
|
||||
return -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
if ( H5LT_get_attribute_mem( obj_id, attr_name, H5T_NATIVE_INT, data ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -2981,29 +2779,11 @@ herr_t H5LTget_attribute_uint( hid_t loc_id,
|
||||
const char *attr_name,
|
||||
unsigned int *data )
|
||||
{
|
||||
/* Get the attribute */
|
||||
if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_UINT, data) < 0)
|
||||
return -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
if ( H5LT_get_attribute_mem( obj_id, attr_name, H5T_NATIVE_UINT, data ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -3030,30 +2810,13 @@ herr_t H5LTget_attribute_long( hid_t loc_id,
|
||||
const char *attr_name,
|
||||
long *data )
|
||||
{
|
||||
/* Get the attribute */
|
||||
if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_LONG, data) < 0)
|
||||
return -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
if ( H5LT_get_attribute_mem( obj_id, attr_name, H5T_NATIVE_LONG, data ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5LTget_attribute_long_long
|
||||
*
|
||||
@ -3076,29 +2839,11 @@ herr_t H5LTget_attribute_long_long( hid_t loc_id,
|
||||
const char *attr_name,
|
||||
long_long *data )
|
||||
{
|
||||
/* Get the attribute */
|
||||
if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_LLONG, data) < 0)
|
||||
return -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
if ( H5LT_get_attribute_mem( obj_id, attr_name, H5T_NATIVE_LLONG, data ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -3124,29 +2869,11 @@ herr_t H5LTget_attribute_ulong( hid_t loc_id,
|
||||
const char *attr_name,
|
||||
unsigned long *data )
|
||||
{
|
||||
/* Get the attribute */
|
||||
if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_ULONG, data) < 0)
|
||||
return -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
if ( H5LT_get_attribute_mem( obj_id, attr_name, H5T_NATIVE_ULONG, data ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -3174,29 +2901,11 @@ herr_t H5LTget_attribute_float( hid_t loc_id,
|
||||
const char *attr_name,
|
||||
float *data )
|
||||
{
|
||||
/* Get the attribute */
|
||||
if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_FLOAT, data) < 0)
|
||||
return -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
if ( H5LT_get_attribute_mem( obj_id, attr_name, H5T_NATIVE_FLOAT, data ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -3224,29 +2933,11 @@ herr_t H5LTget_attribute_double( hid_t loc_id,
|
||||
const char *attr_name,
|
||||
double *data )
|
||||
{
|
||||
/* Get the attribute */
|
||||
if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_DOUBLE, data) < 0)
|
||||
return -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
if ( H5LT_get_attribute_mem( obj_id, attr_name, H5T_NATIVE_DOUBLE, data ) < 0 )
|
||||
return -1;
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -3275,31 +2966,11 @@ herr_t H5LTget_attribute( hid_t loc_id,
|
||||
hid_t mem_type_id,
|
||||
void *data )
|
||||
{
|
||||
/* Get the attribute */
|
||||
if(H5LT_get_attribute_mem(loc_id, obj_name, attr_name, mem_type_id, data) < 0)
|
||||
return -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t obj_id;
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
/* Get the type of object */
|
||||
if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0)
|
||||
return -1;
|
||||
|
||||
/* Open the object */
|
||||
if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0)
|
||||
return -1;
|
||||
|
||||
/* Get the attribute */
|
||||
if ( H5LT_get_attribute_mem( obj_id, attr_name, mem_type_id, data ) < 0 )
|
||||
{
|
||||
H5LT_close_id( obj_id, statbuf.type );
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Close the object */
|
||||
if ( H5LT_close_id( obj_id, statbuf.type ) < 0 )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -3328,29 +2999,41 @@ herr_t H5LTget_attribute( hid_t loc_id,
|
||||
*/
|
||||
|
||||
|
||||
herr_t H5LT_get_attribute_mem( hid_t obj_id,
|
||||
static herr_t H5LT_get_attribute_mem(hid_t loc_id,
|
||||
const char *obj_name,
|
||||
const char *attr_name,
|
||||
hid_t mem_type_id,
|
||||
void *data )
|
||||
void *data)
|
||||
{
|
||||
/* identifiers */
|
||||
hid_t obj_id = -1;
|
||||
hid_t attr_id = -1;
|
||||
|
||||
/* identifiers */
|
||||
hid_t attr_id;
|
||||
/* Open the object */
|
||||
if((obj_id = H5Oopen(loc_id, obj_name, H5P_DEFAULT)) < 0)
|
||||
goto out;
|
||||
|
||||
if ( ( attr_id = H5Aopen_name( obj_id, attr_name ) ) < 0 )
|
||||
return -1;
|
||||
if((attr_id = H5Aopen_name(obj_id, attr_name)) < 0)
|
||||
goto out;
|
||||
|
||||
if ( H5Aread( attr_id, mem_type_id, data ) < 0 )
|
||||
goto out;
|
||||
if(H5Aread(attr_id, mem_type_id, data) < 0)
|
||||
goto out;
|
||||
|
||||
if ( H5Aclose( attr_id ) < 0 )
|
||||
return -1;
|
||||
if(H5Aclose(attr_id) < 0)
|
||||
goto out;
|
||||
attr_id = -1;
|
||||
|
||||
return 0;
|
||||
/* Close the object */
|
||||
if(H5Oclose(obj_id) < 0)
|
||||
goto out;
|
||||
obj_id = -1;
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
H5Aclose( attr_id );
|
||||
return -1;
|
||||
if(attr_id > 0)
|
||||
H5Aclose(attr_id);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
|
@ -27,11 +27,6 @@
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
H5_HLDLL herr_t H5LT_get_attribute_mem( hid_t obj_id,
|
||||
const char *attr_name,
|
||||
hid_t mem_type_id,
|
||||
void *data );
|
||||
|
||||
H5_HLDLL herr_t H5LT_get_attribute_disk( hid_t obj_id,
|
||||
const char *attr_name,
|
||||
void *data );
|
||||
|
@ -63,11 +63,9 @@ H5_DLLVAR hid_t H5E_ERR_CLS_g;
|
||||
|
||||
/*
|
||||
* One often needs to temporarily disable automatic error reporting when
|
||||
* trying something that's likely or expected to fail. For instance, to
|
||||
* determine if an object exists one can call H5Gget_objinfo() which will fail if
|
||||
* the object doesn't exist. The code to try can be nested between calls to
|
||||
* H5Eget_auto() and H5Eset_auto(), but it's easier just to use this macro
|
||||
* like:
|
||||
* trying something that's likely or expected to fail. The code to try can
|
||||
* be nested between calls to H5Eget_auto() and H5Eset_auto(), but it's
|
||||
* easier just to use this macro like:
|
||||
* H5E_BEGIN_TRY {
|
||||
* ...stuff here that's likely to fail...
|
||||
* } H5E_END_TRY;
|
||||
|
@ -87,7 +87,7 @@ H5FL_BLK_DEFINE_STATIC(meta_accum);
|
||||
/*
|
||||
* Global count of the number of H5FD_t's handed out. This is used as a
|
||||
* "serial number" for files that are currently open and is used for the
|
||||
* 'fileno' field in H5G_stat_t. However, if a VFL driver is not able
|
||||
* 'fileno' field in H5O_info_t. However, if a VFL driver is not able
|
||||
* to detect whether two files are the same, a file that has been opened
|
||||
* by H5Fopen more than once with that VFL driver will have two different
|
||||
* serial numbers. :-/
|
||||
|
@ -57,6 +57,7 @@
|
||||
/* Local Typedefs */
|
||||
/******************/
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
/* User data for path traversal routine for getting object info */
|
||||
typedef struct {
|
||||
H5G_stat_t *statbuf; /* Stat buffer about object */
|
||||
@ -75,17 +76,16 @@ typedef struct {
|
||||
/* Local Prototypes */
|
||||
/********************/
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
static herr_t H5G_link_hard(hid_t cur_loc_id, const char *cur_name,
|
||||
hid_t new_loc_id, const char *new_name);
|
||||
static herr_t H5G_move(hid_t src_loc_id, const char *src_name,
|
||||
hid_t dst_loc_id, const char *dst_name);
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
static herr_t H5G_get_objinfo_cb(H5G_loc_t *grp_loc/*in*/, const char *name,
|
||||
const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/,
|
||||
H5G_own_loc_t *own_loc/*out*/);
|
||||
static herr_t H5G_get_objinfo(const H5G_loc_t *loc, const char *name,
|
||||
hbool_t follow_link, H5G_stat_t *statbuf/*out*/, hid_t dxpl_id);
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
|
||||
/*********************/
|
||||
@ -837,50 +837,6 @@ done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5Gget_num_objs() */
|
||||
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Gget_objtype_by_idx
|
||||
*
|
||||
* Purpose: Returns the type of objects in the group by giving index.
|
||||
*
|
||||
* Note: Deprecated in favor of H5Lget_info/H5Oget_info
|
||||
*
|
||||
* Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3)
|
||||
* Failure: H5G_UNKNOWN
|
||||
*
|
||||
* Programmer: Raymond Lu
|
||||
* Nov 20, 2002
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
H5G_obj_t
|
||||
H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx)
|
||||
{
|
||||
H5G_loc_t loc; /* Object location */
|
||||
H5O_type_t obj_type; /* Type of object at location */
|
||||
H5G_obj_t ret_value;
|
||||
|
||||
FUNC_ENTER_API(H5Gget_objtype_by_idx, H5G_UNKNOWN)
|
||||
H5TRACE2("Go", "ih", loc_id, idx);
|
||||
|
||||
/* Check args */
|
||||
if(H5G_loc(loc_id, &loc) < 0)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "not a location ID")
|
||||
if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_dxpl_id) < 0)
|
||||
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type")
|
||||
if(obj_type != H5O_TYPE_GROUP)
|
||||
HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a group")
|
||||
|
||||
/* Call internal function*/
|
||||
if((ret_value = H5G_obj_get_type_by_idx(loc.oloc, idx, H5AC_ind_dxpl_id)) == H5G_UNKNOWN)
|
||||
HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "can't get object type")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5Gget_objtype_by_idx() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Gget_objinfo
|
||||
@ -1072,3 +1028,47 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5G_get_objinfo() */
|
||||
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Gget_objtype_by_idx
|
||||
*
|
||||
* Purpose: Returns the type of objects in the group by giving index.
|
||||
*
|
||||
* Note: Deprecated in favor of H5Lget_info/H5Oget_info
|
||||
*
|
||||
* Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3)
|
||||
* Failure: H5G_UNKNOWN
|
||||
*
|
||||
* Programmer: Raymond Lu
|
||||
* Nov 20, 2002
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
H5G_obj_t
|
||||
H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx)
|
||||
{
|
||||
H5G_loc_t loc; /* Object location */
|
||||
H5O_type_t obj_type; /* Type of object at location */
|
||||
H5G_obj_t ret_value;
|
||||
|
||||
FUNC_ENTER_API(H5Gget_objtype_by_idx, H5G_UNKNOWN)
|
||||
H5TRACE2("Go", "ih", loc_id, idx);
|
||||
|
||||
/* Check args */
|
||||
if(H5G_loc(loc_id, &loc) < 0)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "not a location ID")
|
||||
if(H5O_obj_type(loc.oloc, &obj_type, H5AC_ind_dxpl_id) < 0)
|
||||
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "can't get object type")
|
||||
if(obj_type != H5O_TYPE_GROUP)
|
||||
HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "not a group")
|
||||
|
||||
/* Call internal function*/
|
||||
if((ret_value = H5G_obj_get_type_by_idx(loc.oloc, idx, H5AC_ind_dxpl_id)) == H5G_UNKNOWN)
|
||||
HGOTO_ERROR(H5E_SYM, H5E_BADTYPE, FAIL, "can't get object type")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5Gget_objtype_by_idx() */
|
||||
|
||||
|
@ -39,14 +39,6 @@
|
||||
/* Public Macros */
|
||||
/*****************/
|
||||
|
||||
/* Deprecated macros, for backward compatibility */
|
||||
|
||||
/* Macros for types of objects in a group (see H5G_obj_t definition) */
|
||||
#define H5G_NTYPES 256 /* Max possible number of types */
|
||||
#define H5G_NLIBTYPES 8 /* Number of internal types */
|
||||
#define H5G_NUSERTYPES (H5G_NTYPES-H5G_NLIBTYPES)
|
||||
#define H5G_USERTYPE(X) (8+(X)) /* User defined types */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -71,38 +63,6 @@ typedef struct H5G_info_t {
|
||||
int64_t max_corder; /* Current max. creation order value for group */
|
||||
} H5G_info_t;
|
||||
|
||||
/* Deprecated typedefs, for backward compatibility */
|
||||
|
||||
/*
|
||||
* An object has a certain type. The first few numbers are reserved for use
|
||||
* internally by HDF5. Users may add their own types with higher values. The
|
||||
* values are never stored in the file -- they only exist while an
|
||||
* application is running. An object may satisfy the `isa' function for more
|
||||
* than one type.
|
||||
*/
|
||||
typedef enum H5G_obj_t {
|
||||
H5G_UNKNOWN = -1, /* Unknown object type */
|
||||
H5G_GROUP, /* Object is a group */
|
||||
H5G_DATASET, /* Object is a dataset */
|
||||
H5G_TYPE, /* Object is a named data type */
|
||||
H5G_LINK, /* Object is a symbolic link */
|
||||
H5G_UDLINK, /* Object is a user-defined link */
|
||||
H5G_RESERVED_5, /* Reserved for future use */
|
||||
H5G_RESERVED_6, /* Reserved for future use */
|
||||
H5G_RESERVED_7 /* Reserved for future use */
|
||||
} H5G_obj_t;
|
||||
|
||||
/* Information about an object */
|
||||
typedef struct H5G_stat_t {
|
||||
unsigned long fileno[2]; /*file number */
|
||||
unsigned long objno[2]; /*object number */
|
||||
unsigned nlink; /*number of hard links to object*/
|
||||
H5G_obj_t type; /*basic object type */
|
||||
time_t mtime; /*modification time */
|
||||
size_t linklen; /*symbolic link value length */
|
||||
H5O_stat_t ohdr; /* Object header information */
|
||||
} H5G_stat_t;
|
||||
|
||||
/********************/
|
||||
/* Public Variables */
|
||||
/********************/
|
||||
@ -128,11 +88,28 @@ H5_DLL herr_t H5Gclose(hid_t group_id);
|
||||
*
|
||||
* Use of these functions and variables is deprecated.
|
||||
*/
|
||||
/*
|
||||
* An object has a certain type. The first few numbers are reserved for use
|
||||
* internally by HDF5. Users may add their own types with higher values. The
|
||||
* values are never stored in the file -- they only exist while an
|
||||
* application is running. An object may satisfy the `isa' function for more
|
||||
* than one type.
|
||||
*/
|
||||
typedef enum H5G_obj_t {
|
||||
H5G_UNKNOWN = -1, /* Unknown object type */
|
||||
H5G_GROUP, /* Object is a group */
|
||||
H5G_DATASET, /* Object is a dataset */
|
||||
H5G_TYPE, /* Object is a named data type */
|
||||
H5G_LINK, /* Object is a symbolic link */
|
||||
H5G_UDLINK, /* Object is a user-defined link */
|
||||
H5G_RESERVED_5, /* Reserved for future use */
|
||||
H5G_RESERVED_6, /* Reserved for future use */
|
||||
H5G_RESERVED_7 /* Reserved for future use */
|
||||
} H5G_obj_t;
|
||||
|
||||
H5_DLL ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char* name,
|
||||
size_t size);
|
||||
H5_DLL H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx);
|
||||
H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name,
|
||||
hbool_t follow_link, H5G_stat_t *statbuf/*out*/);
|
||||
/* Symbols defined for compatibility with previous versions of the HDF5 API.
|
||||
*
|
||||
* Use of these symbols is deprecated.
|
||||
@ -148,12 +125,29 @@ H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name,
|
||||
#define H5G_LINK_SOFT H5L_TYPE_SOFT
|
||||
#define H5G_link_t H5L_type_t
|
||||
|
||||
/* Macros for types of objects in a group (see H5G_obj_t definition) */
|
||||
#define H5G_NTYPES 256 /* Max possible number of types */
|
||||
#define H5G_NLIBTYPES 8 /* Number of internal types */
|
||||
#define H5G_NUSERTYPES (H5G_NTYPES - H5G_NLIBTYPES)
|
||||
#define H5G_USERTYPE(X) (8 + (X)) /* User defined types */
|
||||
|
||||
|
||||
/* Typedefs */
|
||||
|
||||
/* Prototype for H5Giterate() operator */
|
||||
typedef herr_t (*H5G_iterate_t)(hid_t group, const char *name, void *op_data);
|
||||
|
||||
/* Information about an object */
|
||||
typedef struct H5G_stat_t {
|
||||
unsigned long fileno[2]; /*file number */
|
||||
unsigned long objno[2]; /*object number */
|
||||
unsigned nlink; /*number of hard links to object*/
|
||||
H5G_obj_t type; /*basic object type */
|
||||
time_t mtime; /*modification time */
|
||||
size_t linklen; /*symbolic link value length */
|
||||
H5O_stat_t ohdr; /* Object header information */
|
||||
} H5G_stat_t;
|
||||
|
||||
|
||||
/* Function prototypes */
|
||||
H5_DLL hid_t H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint);
|
||||
@ -175,6 +169,8 @@ H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize,
|
||||
H5_DLL herr_t H5Giterate(hid_t loc_id, const char *name, int *idx,
|
||||
H5G_iterate_t op, void *op_data);
|
||||
H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs);
|
||||
H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name,
|
||||
hbool_t follow_link, H5G_stat_t *statbuf/*out*/);
|
||||
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
|
@ -77,20 +77,14 @@
|
||||
/*******************/
|
||||
/* Public Typedefs */
|
||||
/*******************/
|
||||
/* A struct that's part of the H5G_stat_t routine (deprecated) */
|
||||
typedef struct H5O_stat_t {
|
||||
hsize_t size; /* Total size of object header in file */
|
||||
hsize_t free; /* Free space within object header */
|
||||
unsigned nmesgs; /* Number of object header messages */
|
||||
unsigned nchunks; /* Number of object header chunks */
|
||||
} H5O_stat_t;
|
||||
|
||||
/* Types of objects in file */
|
||||
typedef enum H5O_type_t {
|
||||
H5O_TYPE_UNKNOWN = -1, /* Unknown object type */
|
||||
H5O_TYPE_GROUP, /* Object is a group */
|
||||
H5O_TYPE_DATASET, /* Object is a dataset */
|
||||
H5O_TYPE_NAMED_DATATYPE /* Object is a named data type */
|
||||
H5O_TYPE_NAMED_DATATYPE, /* Object is a named data type */
|
||||
H5O_TYPE_NTYPES /* Number of different object types (must be last!) */
|
||||
} H5O_type_t;
|
||||
|
||||
/* Information struct for object (for H5Oget_info/H5Oget_info_by_idx) */
|
||||
@ -162,6 +156,28 @@ H5_DLL ssize_t H5Oget_comment(hid_t loc_id, const char *name, char *comment,
|
||||
size_t bufsize, hid_t lapl_id);
|
||||
H5_DLL herr_t H5Oclose(hid_t object_id);
|
||||
|
||||
/* Symbols defined for compatibility with previous versions of the HDF5 API.
|
||||
*
|
||||
* Use of these symbols is deprecated.
|
||||
*/
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
|
||||
/* Macros */
|
||||
|
||||
/* Typedefs */
|
||||
|
||||
/* A struct that's part of the H5G_stat_t routine (deprecated) */
|
||||
typedef struct H5O_stat_t {
|
||||
hsize_t size; /* Total size of object header in file */
|
||||
hsize_t free; /* Free space within object header */
|
||||
unsigned nmesgs; /* Number of object header messages */
|
||||
unsigned nchunks; /* Number of object header chunks */
|
||||
} H5O_stat_t;
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -165,11 +165,10 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, unsigned UNUSED mesg_flags,
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
|
||||
for(i = 0; i < sdim->rank; i++) {
|
||||
H5F_DECODE_LENGTH(f, p, sdim->size[i]);
|
||||
#ifndef H5_HAVE_LARGE_HSIZET
|
||||
|
||||
/* Rudimentary check for overflow of the dimension size */
|
||||
if(sdim->size[i] == 0)
|
||||
HGOTO_ERROR(H5E_DATASPACE, H5E_BADSIZE, NULL, "invalid size detected")
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
} /* end for */
|
||||
|
||||
if(flags & H5S_VALID_MAX) {
|
||||
|
@ -1026,7 +1026,7 @@ H5T_conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
|
||||
* the addresses in the file must be) and just get out now, there
|
||||
* is no need to convert the object reference. Yes, this is
|
||||
* icky and non-portable, but I can't think of a better way to
|
||||
* support allowing the objno in the H5G_stat_t struct and the
|
||||
* support allowing the objno in the H5O_info_t struct and the
|
||||
* hobj_ref_t type to be compared directly without introducing a
|
||||
* "native" hobj_ref_t datatype and I think that would break a
|
||||
* lot of existing programs. -QAK
|
||||
|
@ -412,13 +412,12 @@
|
||||
# define SIZET_MAX ((size_t)(ssize_t)(-1))
|
||||
# define SSIZET_MAX ((ssize_t)(((size_t)1<<(8*sizeof(ssize_t)-1))-1))
|
||||
#endif
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
|
||||
/*
|
||||
* Maximum & minimum values for our typedefs.
|
||||
*/
|
||||
#define HSIZET_MAX ((hsize_t)ULLONG_MAX)
|
||||
#define HSSIZET_MAX ((hssize_t)LLONG_MAX)
|
||||
#else /* H5_HAVE_LARGE_HSIZET */
|
||||
#define HSIZET_MAX ((hsize_t)SIZET_MAX)
|
||||
#define HSSIZET_MAX ((hssize_t)SSIZET_MAX)
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
#define HSSIZET_MIN (~(HSSIZET_MAX))
|
||||
|
||||
/*
|
||||
|
@ -148,23 +148,17 @@ typedef long_long ssize_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The sizes of file objects have their own types defined here. If large
|
||||
* sizes are enabled then use a 64-bit data type, otherwise use the size of
|
||||
* memory objects.
|
||||
* The sizes of file objects have their own types defined here, use a 64-bit
|
||||
* type.
|
||||
*/
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
# if H5_SIZEOF_LONG_LONG>=8
|
||||
#if H5_SIZEOF_LONG_LONG >= 8
|
||||
typedef unsigned long_long hsize_t;
|
||||
typedef signed long_long hssize_t;
|
||||
# define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG
|
||||
# define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG
|
||||
# endif
|
||||
#else /* H5_HAVE_LARGE_HSIZET */
|
||||
typedef size_t hsize_t;
|
||||
typedef ssize_t hssize_t;
|
||||
# define H5_SIZEOF_HSIZE_T H5_SIZEOF_SIZE_T
|
||||
# define H5_SIZEOF_HSSIZE_T H5_SIZEOF_SIZE_T
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
#else
|
||||
# error "nothing appropriate for hsize_t"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* File addresses have their own types.
|
||||
|
@ -695,6 +695,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
|
||||
}
|
||||
break;
|
||||
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
case 's':
|
||||
if(ptr) {
|
||||
if(vp)
|
||||
@ -707,6 +708,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
|
||||
fprintf(out, "0x%lx", (unsigned long)statbuf);
|
||||
}
|
||||
break;
|
||||
#endif /* H5_NO_DEPRECATED_SYMBOLS */
|
||||
|
||||
default:
|
||||
fprintf(out, "BADTYPE(G%c)", type[1]);
|
||||
|
@ -4362,7 +4362,7 @@ test_latest(void)
|
||||
hid_t file = (-1); /* File ID */
|
||||
hid_t tid1 = (-1), tid2 = (-1); /* Datatype ID */
|
||||
hid_t fapl = (-1); /* File access property list */
|
||||
H5G_stat_t sb; /* Stat buffer for committed datatype */
|
||||
H5O_info_t oi; /* Stat buffer for committed datatype */
|
||||
hsize_t old_dtype_oh_size; /* Size of object header with "old" format */
|
||||
hsize_t new_dtype_oh_size; /* Size of object header with "new" format */
|
||||
char filename[1024]; /* Buffer for filename */
|
||||
@ -4396,9 +4396,9 @@ test_latest(void)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Get information about datatype on disk */
|
||||
if(H5Gget_objinfo(file, compnd_type, TRUE, &sb) < 0)
|
||||
if(H5Oget_info(file, compnd_type, &oi, H5P_DEFAULT) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
old_dtype_oh_size = sb.ohdr.size;
|
||||
old_dtype_oh_size = oi.hdr.space.total;
|
||||
|
||||
/* Close datatype */
|
||||
if(H5Tclose(tid2) < 0)
|
||||
@ -4421,11 +4421,11 @@ test_latest(void)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Get information about datatype on disk */
|
||||
if(H5Gget_objinfo(file, compnd_type, TRUE, &sb) < 0)
|
||||
if(H5Oget_info(file, compnd_type, &oi, H5P_DEFAULT) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Check that the object header info is still the same */
|
||||
if(old_dtype_oh_size != sb.ohdr.size)
|
||||
if(old_dtype_oh_size != oi.hdr.space.total)
|
||||
TEST_ERROR
|
||||
|
||||
/* Close datatype */
|
||||
@ -4457,9 +4457,9 @@ test_latest(void)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Get information about datatype on disk */
|
||||
if(H5Gget_objinfo(file, compnd_type, TRUE, &sb) < 0)
|
||||
if(H5Oget_info(file, compnd_type, &oi, H5P_DEFAULT) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
new_dtype_oh_size = sb.ohdr.size;
|
||||
new_dtype_oh_size = oi.hdr.space.total;
|
||||
|
||||
/* Check that the new format is smaller than the old format */
|
||||
if(old_dtype_oh_size <= new_dtype_oh_size)
|
||||
@ -4486,11 +4486,11 @@ test_latest(void)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Get information about datatype on disk */
|
||||
if(H5Gget_objinfo(file, compnd_type, TRUE, &sb) < 0)
|
||||
if(H5Oget_info(file, compnd_type, &oi, H5P_DEFAULT) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Check that the object header info is still the same */
|
||||
if(new_dtype_oh_size != sb.ohdr.size)
|
||||
if(new_dtype_oh_size != oi.hdr.space.total)
|
||||
TEST_ERROR
|
||||
|
||||
/* Close datatype */
|
||||
|
@ -47,11 +47,7 @@ const char *FILENAME[] = {
|
||||
#define TEST_DATATYPE H5T_NATIVE_UCHAR
|
||||
|
||||
#define TEST_CHUNK_SIZE 50
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
#define TEST_SPARSE_SIZE 1000000
|
||||
#else /* H5_HAVE_LARGE_HSIZET */
|
||||
#define TEST_SPARSE_SIZE 1200
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
|
||||
hsize_t chunk_dims[H5O_LAYOUT_NDIMS];
|
||||
hsize_t zero[H5O_LAYOUT_NDIMS];
|
||||
|
303
test/links.c
303
test/links.c
@ -126,32 +126,32 @@ mklinks(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Create a file */
|
||||
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
|
||||
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
|
||||
if ((scalar=H5Screate_simple (1, size, size)) < 0) TEST_ERROR
|
||||
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
|
||||
if((scalar = H5Screate_simple(1, size, size)) < 0) TEST_ERROR
|
||||
|
||||
/* Create a group */
|
||||
if((grp = H5Gcreate2(file, "grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if(H5Gclose (grp) < 0) TEST_ERROR
|
||||
if(H5Gclose(grp) < 0) TEST_ERROR
|
||||
|
||||
/* Create a dataset */
|
||||
if ((d1=H5Dcreate (file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if (H5Dclose (d1) < 0) TEST_ERROR
|
||||
if((d1 = H5Dcreate(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if(H5Dclose(d1) < 0) TEST_ERROR
|
||||
|
||||
/* Create a hard link */
|
||||
if (H5Lcreate_hard (file, "d1", H5L_SAME_LOC, "grp1/hard", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Lcreate_hard(file, "d1", H5L_SAME_LOC, "grp1/hard", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* Create a symbolic link */
|
||||
if (H5Lcreate_soft ("/d1", file, "grp1/soft", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Lcreate_soft("/d1", file, "grp1/soft", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* Create a symbolic link to something that doesn't exist */
|
||||
if (H5Lcreate_soft ("foobar", file, "grp1/dangle", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Lcreate_soft("foobar", file, "grp1/dangle", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* Create a recursive symbolic link */
|
||||
if (H5Lcreate_soft ("/grp1/recursive", file, "/grp1/recursive", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Lcreate_soft("/grp1/recursive", file, "/grp1/recursive", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* Close */
|
||||
if (H5Sclose (scalar) < 0) TEST_ERROR
|
||||
if (H5Fclose (file) < 0) TEST_ERROR
|
||||
if(H5Sclose(scalar) < 0) TEST_ERROR
|
||||
if(H5Fclose(file) < 0) TEST_ERROR
|
||||
|
||||
PASSED();
|
||||
return 0;
|
||||
@ -194,12 +194,12 @@ new_links(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Create two files */
|
||||
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
|
||||
if ((file_a=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
|
||||
if((file_a = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
|
||||
|
||||
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
|
||||
if ((file_b=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
|
||||
if((file_b = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
|
||||
|
||||
if ((scalar=H5Screate_simple (1, size, size)) < 0) TEST_ERROR
|
||||
if((scalar = H5Screate_simple (1, size, size)) < 0) TEST_ERROR
|
||||
|
||||
/* Create two groups in each file */
|
||||
if((grp1_a = H5Gcreate2(file_a, "grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
@ -208,8 +208,8 @@ new_links(hid_t fapl, hbool_t new_format)
|
||||
if((grp2_b = H5Gcreate2(file_b, "grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Create datasets */
|
||||
if((dset1=H5Dcreate(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((dset2=H5Dcreate(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((dset1 = H5Dcreate(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if((dset2 = H5Dcreate(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Create links within a file. Both of source and destination use
|
||||
* H5L_SAME_LOC. Both hard and soft links should fail. */
|
||||
@ -232,30 +232,30 @@ new_links(hid_t fapl, hbool_t new_format)
|
||||
if(H5Lcreate_hard(grp1_a, "dataset2", grp2_a, "hard2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* Close dataspace and files */
|
||||
if (H5Sclose (scalar) < 0) TEST_ERROR
|
||||
if (H5Dclose(dset1) < 0) TEST_ERROR
|
||||
if (H5Dclose(dset2) < 0) TEST_ERROR
|
||||
if (H5Gclose (grp1_a) < 0) TEST_ERROR
|
||||
if (H5Gclose (grp2_a) < 0) TEST_ERROR
|
||||
if (H5Gclose (grp1_b) < 0) TEST_ERROR
|
||||
if (H5Gclose (grp2_b) < 0) TEST_ERROR
|
||||
if (H5Fclose (file_a) < 0) TEST_ERROR
|
||||
if (H5Fclose (file_b) < 0) TEST_ERROR
|
||||
if(H5Sclose(scalar) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset1) < 0) TEST_ERROR
|
||||
if(H5Dclose(dset2) < 0) TEST_ERROR
|
||||
if(H5Gclose(grp1_a) < 0) TEST_ERROR
|
||||
if(H5Gclose(grp2_a) < 0) TEST_ERROR
|
||||
if(H5Gclose(grp1_b) < 0) TEST_ERROR
|
||||
if(H5Gclose(grp2_b) < 0) TEST_ERROR
|
||||
if(H5Fclose(file_a) < 0) TEST_ERROR
|
||||
if(H5Fclose(file_b) < 0) TEST_ERROR
|
||||
|
||||
PASSED();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Sclose (scalar);
|
||||
H5Dclose (dset1);
|
||||
H5Dclose (dset2);
|
||||
H5Gclose (grp1_a);
|
||||
H5Gclose (grp2_a);
|
||||
H5Gclose (grp1_b);
|
||||
H5Gclose (grp2_b);
|
||||
H5Fclose (file_a);
|
||||
H5Fclose (file_b);
|
||||
H5Sclose(scalar);
|
||||
H5Dclose(dset1);
|
||||
H5Dclose(dset2);
|
||||
H5Gclose(grp1_a);
|
||||
H5Gclose(grp2_a);
|
||||
H5Gclose(grp1_b);
|
||||
H5Gclose(grp2_b);
|
||||
H5Fclose(file_a);
|
||||
H5Fclose(file_b);
|
||||
} H5E_END_TRY;
|
||||
return -1;
|
||||
}
|
||||
@ -282,7 +282,8 @@ static int
|
||||
cklinks(hid_t fapl, hbool_t new_format)
|
||||
{
|
||||
hid_t file;
|
||||
H5G_stat_t sb1, sb2;
|
||||
H5O_info_t oinfo1, oinfo2;
|
||||
H5L_info_t linfo2;
|
||||
char linkval[LINK_BUF_SIZE];
|
||||
char filename[NAME_BUF_SIZE];
|
||||
herr_t status;
|
||||
@ -297,14 +298,14 @@ cklinks(hid_t fapl, hbool_t new_format)
|
||||
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Hard link */
|
||||
if(H5Gget_objinfo(file, "d1", TRUE, &sb1) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(file, "grp1/hard", TRUE, &sb2) < 0) FAIL_STACK_ERROR
|
||||
if(H5G_DATASET != sb2.type) {
|
||||
if(H5Oget_info(file, "d1", &oinfo1, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file, "grp1/hard", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5O_TYPE_DATASET != oinfo2.type) {
|
||||
H5_FAILED();
|
||||
printf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
if(HDmemcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno))) {
|
||||
if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) {
|
||||
H5_FAILED();
|
||||
puts(" Hard link test failed. Link seems not to point to the ");
|
||||
puts(" expected file location.");
|
||||
@ -314,13 +315,13 @@ cklinks(hid_t fapl, hbool_t new_format)
|
||||
if(H5Lexists(file, "grp1/hard", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
|
||||
|
||||
/* Symbolic link */
|
||||
if(H5Gget_objinfo(file, "grp1/soft", TRUE, &sb2) < 0) FAIL_STACK_ERROR
|
||||
if(H5G_DATASET != sb2.type) {
|
||||
if(H5Oget_info(file, "grp1/soft", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5O_TYPE_DATASET != oinfo2.type) {
|
||||
H5_FAILED();
|
||||
printf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
if(HDmemcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno))) {
|
||||
if(H5F_addr_ne(oinfo1.addr, oinfo2.addr)) {
|
||||
H5_FAILED();
|
||||
puts(" Soft link test failed. Link seems not to point to the ");
|
||||
puts(" expected file location.");
|
||||
@ -336,15 +337,15 @@ cklinks(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Dangling link */
|
||||
H5E_BEGIN_TRY {
|
||||
status = H5Gget_objinfo(file, "grp1/dangle", TRUE, &sb2);
|
||||
status = H5Oget_info(file, "grp1/dangle", &oinfo2, H5P_DEFAULT);
|
||||
} H5E_END_TRY;
|
||||
if(status >= 0) {
|
||||
H5_FAILED();
|
||||
puts(" H5Gget_objinfo() should have failed for a dangling link.");
|
||||
puts(" H5Oget_info() should have failed for a dangling link.");
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
if(H5Gget_objinfo(file, "grp1/dangle", FALSE, &sb2) < 0) FAIL_STACK_ERROR
|
||||
if(H5G_LINK != sb2.type) {
|
||||
if(H5Lget_info(file, "grp1/dangle", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5L_TYPE_SOFT != linfo2.type) {
|
||||
H5_FAILED();
|
||||
printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__);
|
||||
TEST_ERROR
|
||||
@ -363,15 +364,15 @@ cklinks(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Recursive link */
|
||||
H5E_BEGIN_TRY {
|
||||
status = H5Gget_objinfo(file, "grp1/recursive", TRUE, &sb2);
|
||||
status = H5Oget_info(file, "grp1/recursive", &oinfo2, H5P_DEFAULT);
|
||||
} H5E_END_TRY;
|
||||
if(status >= 0) {
|
||||
H5_FAILED();
|
||||
puts(" H5Gget_objinfo() should have failed for a recursive link.");
|
||||
puts(" H5Oget_info() should have failed for a recursive link.");
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
if(H5Gget_objinfo(file, "grp1/recursive", FALSE, &sb2) < 0) FAIL_STACK_ERROR
|
||||
if(H5G_LINK != sb2.type) {
|
||||
if(H5Lget_info(file, "grp1/recursive", &linfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5L_TYPE_SOFT != linfo2.type) {
|
||||
H5_FAILED();
|
||||
printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__);
|
||||
TEST_ERROR
|
||||
@ -420,7 +421,7 @@ static int
|
||||
ck_new_links(hid_t fapl, hbool_t new_format)
|
||||
{
|
||||
hid_t file;
|
||||
H5G_stat_t sb_dset, sb_hard1, sb_hard2;
|
||||
H5O_info_t oi_dset, oi_hard1, oi_hard2;
|
||||
char filename[NAME_BUF_SIZE];
|
||||
|
||||
if(new_format)
|
||||
@ -430,23 +431,23 @@ ck_new_links(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Open the file */
|
||||
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
|
||||
if ((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
|
||||
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
|
||||
|
||||
/* Get hard link info */
|
||||
if(H5Gget_objinfo(file, "/grp1/dataset2", TRUE, &sb_dset) < 0)
|
||||
if(H5Oget_info(file, "/grp1/dataset2", &oi_dset, H5P_DEFAULT) < 0)
|
||||
TEST_ERROR
|
||||
if(H5Gget_objinfo(file, "/grp1/hard1", TRUE, &sb_hard1) < 0)
|
||||
if(H5Oget_info(file, "/grp1/hard1", &oi_hard1, H5P_DEFAULT) < 0)
|
||||
TEST_ERROR
|
||||
if(H5Gget_objinfo(file, "/grp2/hard2", TRUE, &sb_hard2) < 0)
|
||||
if(H5Oget_info(file, "/grp2/hard2", &oi_hard2, H5P_DEFAULT) < 0)
|
||||
TEST_ERROR
|
||||
|
||||
/* Check hard links */
|
||||
if(H5G_DATASET!=sb_hard1.type || H5G_DATASET!=sb_hard2.type) {
|
||||
if(H5O_TYPE_DATASET != oi_hard1.type || H5O_TYPE_DATASET != oi_hard2.type) {
|
||||
H5_FAILED();
|
||||
printf(" %d: Unexpected object type should have been a dataset\n", __LINE__);
|
||||
TEST_ERROR
|
||||
}
|
||||
if(HDmemcmp(&sb_dset.objno, &sb_hard1.objno, sizeof(sb_dset.objno)) || HDmemcmp(&sb_dset.objno, &sb_hard2.objno, sizeof(sb_dset.objno))) {
|
||||
if(H5F_addr_ne(oi_dset.addr, oi_hard1.addr) || H5F_addr_ne(oi_dset.addr, oi_hard2.addr)) {
|
||||
H5_FAILED();
|
||||
puts(" Hard link test failed. Link seems not to point to the ");
|
||||
puts(" expected file location.");
|
||||
@ -455,10 +456,11 @@ ck_new_links(hid_t fapl, hbool_t new_format)
|
||||
|
||||
/* Cleanup */
|
||||
if(H5Fclose(file) < 0) TEST_ERROR
|
||||
|
||||
PASSED();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -1302,7 +1304,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
|
||||
hid_t fcpl_id=-1; /* Group creation property list ID */
|
||||
hid_t lcpl_id=-1;
|
||||
hid_t lcpl2_id=-1;
|
||||
H5G_stat_t statbuf;
|
||||
H5O_info_t oinfo;
|
||||
H5L_info_t linfo;
|
||||
H5T_cset_t old_cset;
|
||||
int64_t old_corder; /* Creation order value of link */
|
||||
@ -1341,13 +1343,13 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
|
||||
|
||||
/* Get the group's link's information */
|
||||
if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Gget_objinfo(file_id, "group", TRUE, &statbuf) < 0) TEST_ERROR
|
||||
if(H5Oget_info(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
old_cset = linfo.cset;
|
||||
if(old_cset != H5T_CSET_UTF8) TEST_ERROR
|
||||
if(linfo.corder_valid != TRUE) TEST_ERROR
|
||||
old_corder = linfo.corder;
|
||||
if(old_corder != 0) TEST_ERROR
|
||||
old_modification_time = statbuf.mtime;
|
||||
old_modification_time = oinfo.mtime;
|
||||
|
||||
/* If this test happens too quickly, the times will all be the same. Make sure the time changes. */
|
||||
curr_time = HDtime(NULL);
|
||||
@ -1360,16 +1362,16 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
|
||||
|
||||
/* Get the link's character set & modification time . They should be unchanged */
|
||||
if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Gget_objinfo(file_id, "group", TRUE, &statbuf) < 0) TEST_ERROR
|
||||
if(old_modification_time != statbuf.mtime) TEST_ERROR
|
||||
if(H5Oget_info(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(old_modification_time != oinfo.mtime) TEST_ERROR
|
||||
if(old_cset != linfo.cset) TEST_ERROR
|
||||
if(linfo.corder_valid != TRUE) TEST_ERROR
|
||||
if(old_corder != linfo.corder) TEST_ERROR
|
||||
|
||||
/* Create a new link to the group. It should have a different creation order value but the same modification time */
|
||||
if(H5Lcreate_hard(file_id, "group", file_id, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Gget_objinfo(file_id, "group2", TRUE, &statbuf) < 0) TEST_ERROR
|
||||
if(old_modification_time != statbuf.mtime) TEST_ERROR
|
||||
if(H5Oget_info(file_id, "group2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(old_modification_time != oinfo.mtime) TEST_ERROR
|
||||
if(H5Lget_info(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(old_corder == linfo.corder) TEST_ERROR
|
||||
if(linfo.corder_valid != TRUE) TEST_ERROR
|
||||
@ -1381,8 +1383,8 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
|
||||
* should not change.
|
||||
*/
|
||||
if(H5Lcopy(file_id, "group", file_id, "group_copied", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Gget_objinfo(file_id, "group_copied", TRUE, &statbuf) < 0) TEST_ERROR
|
||||
if(old_modification_time != statbuf.mtime) TEST_ERROR
|
||||
if(H5Oget_info(file_id, "group_copied", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(old_modification_time != oinfo.mtime) TEST_ERROR
|
||||
if(H5Lget_info(file_id, "group_copied", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(linfo.corder_valid != TRUE) TEST_ERROR
|
||||
if(linfo.corder != 2) TEST_ERROR
|
||||
@ -1392,8 +1394,8 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
|
||||
|
||||
/* Move the link with the default property list. */
|
||||
if(H5Lmove(file_id, "group_copied", file_id, "group_copied2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Gget_objinfo(file_id, "group_copied2", TRUE, &statbuf) < 0) TEST_ERROR
|
||||
if(old_modification_time != statbuf.mtime) TEST_ERROR
|
||||
if(H5Oget_info(file_id, "group_copied2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(old_modification_time != oinfo.mtime) TEST_ERROR
|
||||
if(H5Lget_info(file_id, "group_copied2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(linfo.corder_valid != TRUE) TEST_ERROR
|
||||
if(linfo.corder != 3) TEST_ERROR
|
||||
@ -1402,8 +1404,8 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
|
||||
if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR
|
||||
|
||||
/* Check that the original link is unchanged */
|
||||
if(H5Gget_objinfo(file_id, "group", TRUE, &statbuf) < 0) TEST_ERROR
|
||||
if(old_modification_time != statbuf.mtime) TEST_ERROR
|
||||
if(H5Oget_info(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(old_modification_time != oinfo.mtime) TEST_ERROR
|
||||
if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(linfo.corder_valid != TRUE) TEST_ERROR
|
||||
if(old_corder != linfo.corder) TEST_ERROR
|
||||
@ -1413,8 +1415,8 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
|
||||
* Its creation order value will change, but modification time should not
|
||||
* change. */
|
||||
if(H5Lmove(file_id, "group", file_id, "group_moved", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Gget_objinfo(file_id, "group_moved", TRUE, &statbuf) < 0) TEST_ERROR
|
||||
if(old_modification_time != statbuf.mtime) TEST_ERROR
|
||||
if(H5Oget_info(file_id, "group_moved", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(old_modification_time != oinfo.mtime) TEST_ERROR
|
||||
if(H5Lget_info(file_id, "group_moved", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(linfo.corder_valid != TRUE) TEST_ERROR
|
||||
if(linfo.corder != 4) TEST_ERROR
|
||||
@ -1424,8 +1426,8 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
|
||||
|
||||
/* Move the link again using the default property list. */
|
||||
if(H5Lmove(file_id, "group_moved", file_id, "group_moved_again", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Gget_objinfo(file_id, "group_moved_again", TRUE, &statbuf) < 0) TEST_ERROR
|
||||
if(old_modification_time != statbuf.mtime) TEST_ERROR
|
||||
if(H5Oget_info(file_id, "group_moved_again", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(old_modification_time != oinfo.mtime) TEST_ERROR
|
||||
if(H5Lget_info(file_id, "group_moved_again", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(linfo.corder_valid != TRUE) TEST_ERROR
|
||||
if(linfo.corder != 5) TEST_ERROR
|
||||
@ -1600,7 +1602,7 @@ external_link_root(hid_t fapl, hbool_t new_format)
|
||||
{
|
||||
hid_t fid = (-1); /* File ID */
|
||||
hid_t gid = (-1), gid2 = (-1); /* Group IDs */
|
||||
H5G_stat_t sb; /* Object information */
|
||||
H5L_info_t linfo; /* Link information */
|
||||
char objname[NAME_BUF_SIZE]; /* Object name */
|
||||
ssize_t name_len; /* Length of object name */
|
||||
char filename1[NAME_BUF_SIZE];
|
||||
@ -1618,7 +1620,7 @@ external_link_root(hid_t fapl, hbool_t new_format)
|
||||
h5_fixname(FILENAME[4], fapl, filename2, sizeof filename2);
|
||||
|
||||
/* Create file to point to */
|
||||
if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
|
||||
if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
|
||||
|
||||
/* Close file */
|
||||
if(H5Fclose(fid) < 0) TEST_ERROR
|
||||
@ -1627,20 +1629,20 @@ external_link_root(hid_t fapl, hbool_t new_format)
|
||||
if(H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE) TEST_ERROR
|
||||
|
||||
/* Create file with link to first file */
|
||||
if((fid=H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
|
||||
if((fid = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
|
||||
|
||||
/* Create external link to object in first file */
|
||||
if(H5Lcreate_external(filename1, "/", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* Check information for external link */
|
||||
if (H5Gget_objinfo(fid, "ext_link", FALSE, &sb) < 0) goto error;
|
||||
if (H5G_UDLINK!=sb.type) {
|
||||
if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error;
|
||||
if(H5L_TYPE_EXTERNAL != linfo.type) {
|
||||
H5_FAILED();
|
||||
puts(" Unexpected object type - should have been an external link");
|
||||
goto error;
|
||||
}
|
||||
if(H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Lunpack_elink_val(objname, sb.linklen, NULL, &file, &path) < 0) TEST_ERROR
|
||||
if(H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0) TEST_ERROR
|
||||
if(HDstrcmp(file, filename1)) {
|
||||
H5_FAILED();
|
||||
puts(" External link file name incorrect");
|
||||
@ -2602,8 +2604,8 @@ external_link_query(hid_t fapl, hbool_t new_format)
|
||||
hid_t gid = (-1); /* Group IDs */
|
||||
const char *file_name; /* Name of the file the external link points to */
|
||||
const char *object_name; /* Name of the object the external link points to */
|
||||
H5G_stat_t sb; /* Object information */
|
||||
H5L_info_t li; /* Link information */
|
||||
H5O_info_t oi; /* Object information */
|
||||
H5L_info_t li; /* Link information */
|
||||
char filename1[NAME_BUF_SIZE],
|
||||
filename2[NAME_BUF_SIZE], /* Names of files to externally link across */
|
||||
query_buf[NAME_BUF_SIZE]; /* Buffer to hold query result */
|
||||
@ -2647,12 +2649,12 @@ external_link_query(hid_t fapl, hbool_t new_format)
|
||||
|
||||
|
||||
/* Open first file */
|
||||
if((fid=H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
|
||||
if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
|
||||
|
||||
/* Get size of buffer for external link */
|
||||
if(H5Lget_info(fid, "src", &li, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1))) TEST_ERROR
|
||||
if (H5L_TYPE_EXTERNAL != li.type) {
|
||||
if(H5L_TYPE_EXTERNAL != li.type) {
|
||||
H5_FAILED();
|
||||
puts(" Unexpected link class - should have been an external link");
|
||||
goto error;
|
||||
@ -2665,12 +2667,12 @@ external_link_query(hid_t fapl, hbool_t new_format)
|
||||
if(H5Lunpack_elink_val(query_buf, li.u.val_size, NULL, &file_name, &object_name) < 0) TEST_ERROR
|
||||
|
||||
/* Compare the file and object names */
|
||||
if(strcmp(file_name, filename2)) TEST_ERROR
|
||||
if(strcmp(object_name, "/dst")) TEST_ERROR
|
||||
if(HDstrcmp(file_name, filename2)) TEST_ERROR
|
||||
if(HDstrcmp(object_name, "/dst")) TEST_ERROR
|
||||
|
||||
/* Query information about object that external link points to */
|
||||
if (H5Gget_objinfo(fid, "src", TRUE, &sb) < 0) goto error;
|
||||
if (H5G_GROUP != sb.type) {
|
||||
if(H5Oget_info(fid, "src", &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5O_TYPE_GROUP != oi.type) {
|
||||
H5_FAILED();
|
||||
puts(" Unexpected object type - should have been a group");
|
||||
goto error;
|
||||
@ -2699,10 +2701,10 @@ external_link_query(hid_t fapl, hbool_t new_format)
|
||||
PASSED();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Gclose (gid);
|
||||
H5Fclose (fid);
|
||||
H5Gclose(gid);
|
||||
H5Fclose(fid);
|
||||
} H5E_END_TRY;
|
||||
return -1;
|
||||
} /* end external_link_query() */
|
||||
@ -3339,14 +3341,14 @@ external_link_closing(hid_t fapl, hbool_t new_format)
|
||||
hid_t fid1 = (-1), fid2 = (-1), fid3 = (-1), fid4=(-1);
|
||||
hid_t gid=(-1), tid=(-1), tid2=(-1), sid=(-1), did=(-1);
|
||||
hid_t lcpl_id=(-1);
|
||||
hsize_t dims[2];
|
||||
hsize_t dims[2];
|
||||
char filename1[NAME_BUF_SIZE],
|
||||
filename2[NAME_BUF_SIZE],
|
||||
filename3[NAME_BUF_SIZE],
|
||||
filename4[NAME_BUF_SIZE], /* Names of files to externally link across */
|
||||
buf[NAME_BUF_SIZE]; /* misc. buffer */
|
||||
H5L_info_t li;
|
||||
H5G_stat_t sb;
|
||||
H5L_info_t li;
|
||||
H5O_info_t oi;
|
||||
hobj_ref_t obj_ref;
|
||||
|
||||
if(new_format)
|
||||
@ -3403,9 +3405,8 @@ external_link_closing(hid_t fapl, hbool_t new_format)
|
||||
/* Test that getting info works */
|
||||
if(H5Lget_info(fid1, "elink/elink/elink/type1", &li, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Lget_info(fid1, "elink/elink/elink", &li, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Gget_objinfo(fid1, "elink/elink/elink/type1", TRUE, &sb) < 0) TEST_ERROR
|
||||
if(H5Gget_objinfo(fid1, "elink/elink/elink", TRUE, &sb) < 0) TEST_ERROR
|
||||
if(H5Gget_objinfo(fid1, "elink/elink/elink", FALSE, &sb) < 0) TEST_ERROR
|
||||
if(H5Oget_info(fid1, "elink/elink/elink/type1", &oi, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Oget_info(fid1, "elink/elink/elink", &oi, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* Test move */
|
||||
if(H5Lmove(fid1, "elink/elink/elink/group1", fid1,
|
||||
@ -3492,7 +3493,7 @@ external_link_closing(hid_t fapl, hbool_t new_format)
|
||||
if(H5Gclose(gid) < 0) TEST_ERROR
|
||||
if((gid = H5Gcreate2(fid1, "elink/elink2/group2/group3/group4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
if(H5Gclose(gid) < 0) TEST_ERROR
|
||||
if(H5Gget_objinfo(fid1, "elink/elink2/group2/group3/group4", TRUE, &sb) < 0) TEST_ERROR
|
||||
if(H5Oget_info(fid1, "elink/elink2/group2/group3/group4", &oi, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* Add a few regular groups and a soft link in file2 using intermediate group creation */
|
||||
if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) TEST_ERROR
|
||||
@ -4322,9 +4323,8 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
|
||||
{
|
||||
hid_t fid = (-1); /* File ID */
|
||||
hid_t gid = (-1); /* Group ID */
|
||||
hid_t lcpl = (-1); /* Link Creation PL */
|
||||
H5G_stat_t sb; /* Object information */
|
||||
H5L_info_t li; /* Link information */
|
||||
hid_t lcpl = (-1); /* Link Creation PL */
|
||||
H5L_info_t li; /* Link information */
|
||||
char ud_target_name[] = UD_CB_TARGET; /* Link target name */
|
||||
char filename[NAME_BUF_SIZE];
|
||||
char query_buf[NAME_BUF_SIZE];
|
||||
@ -4422,8 +4422,6 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
|
||||
if(H5Lget_info(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(li.u.val_size != 0) TEST_ERROR
|
||||
if(li.type != UD_CB_TYPE) TEST_ERROR
|
||||
if(H5Gget_objinfo(fid, UD_CB_LINK_NAME, FALSE, &sb) < 0) FAIL_STACK_ERROR
|
||||
if(sb.type != H5G_UDLINK) TEST_ERROR
|
||||
|
||||
/* Unregister the UD hard links */
|
||||
if(H5Lunregister(UD_HARD_TYPE) < 0) FAIL_STACK_ERROR
|
||||
@ -4442,8 +4440,8 @@ error:
|
||||
} H5E_END_TRY;
|
||||
return -1;
|
||||
} /* end ud_callbacks() */
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: lapl_udata
|
||||
*
|
||||
@ -5176,9 +5174,9 @@ linkinfo(hid_t fapl, hbool_t new_format)
|
||||
char filename[NAME_BUF_SIZE];
|
||||
|
||||
if(new_format)
|
||||
TESTING("link type field in H5Gget_objinfo (w/new group format)")
|
||||
TESTING("link type field in H5Lget_info (w/new group format)")
|
||||
else
|
||||
TESTING("link type field in H5Gget_objinfo")
|
||||
TESTING("link type field in H5Lget_info")
|
||||
|
||||
/* Set up filename and create file*/
|
||||
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
|
||||
@ -6401,18 +6399,14 @@ link_info_by_idx_old(hid_t fapl)
|
||||
|
||||
/* Check for creating hard or soft link */
|
||||
if(hard_link) {
|
||||
H5G_stat_t sb; /* Buffer for querying object's info */
|
||||
H5O_info_t oi; /* Buffer for querying object's info */
|
||||
|
||||
/* Create group */
|
||||
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Retrieve group's address on disk */
|
||||
if(H5Gget_objinfo(group_id2, ".", FALSE, &sb) < 0) TEST_ERROR
|
||||
#if H5_SIZEOF_UINT64_T > H5_SIZEOF_LONG
|
||||
objno[u] = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
#else
|
||||
objno[u] = (haddr_t)sb.objno[0];
|
||||
#endif
|
||||
if(H5Oget_info(group_id2, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
objno[u] = oi.addr;
|
||||
|
||||
/* Close group */
|
||||
if(H5Gclose(group_id2) < 0) TEST_ERROR
|
||||
@ -6895,7 +6889,7 @@ delete_by_idx_old(hid_t fapl)
|
||||
|
||||
/* Create several links */
|
||||
for(u = 0; u < CORDER_NLINKS; u++) {
|
||||
H5G_stat_t sb; /* Buffer for querying object's info */
|
||||
H5O_info_t oi; /* Buffer for querying object's info */
|
||||
|
||||
/* Make name for link */
|
||||
sprintf(objname, "filler %02u", u);
|
||||
@ -6904,12 +6898,8 @@ delete_by_idx_old(hid_t fapl)
|
||||
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Retrieve group's address on disk */
|
||||
if(H5Gget_objinfo(group_id2, ".", FALSE, &sb) < 0) TEST_ERROR
|
||||
#if H5_SIZEOF_UINT64_T > H5_SIZEOF_LONG
|
||||
objno[u] = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
#else
|
||||
objno[u] = (haddr_t)sb.objno[0];
|
||||
#endif
|
||||
if(H5Oget_info(group_id2, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
objno[u] = oi.addr;
|
||||
|
||||
/* Close group */
|
||||
if(H5Gclose(group_id2) < 0) TEST_ERROR
|
||||
@ -6972,7 +6962,7 @@ delete_by_idx_old(hid_t fapl)
|
||||
|
||||
/* Create several links */
|
||||
for(u = 0; u < CORDER_NLINKS; u++) {
|
||||
H5G_stat_t sb; /* Buffer for querying object's info */
|
||||
H5O_info_t oi; /* Buffer for querying object's info */
|
||||
|
||||
/* Make name for link */
|
||||
sprintf(objname, "filler %02u", u);
|
||||
@ -6981,12 +6971,8 @@ delete_by_idx_old(hid_t fapl)
|
||||
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Retrieve group's address on disk */
|
||||
if(H5Gget_objinfo(group_id2, ".", FALSE, &sb) < 0) TEST_ERROR
|
||||
#if H5_SIZEOF_UINT64_T > H5_SIZEOF_LONG
|
||||
objno[u] = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
#else
|
||||
objno[u] = (haddr_t)sb.objno[0];
|
||||
#endif
|
||||
if(H5Oget_info(group_id2, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
objno[u] = oi.addr;
|
||||
|
||||
/* Close group */
|
||||
if(H5Gclose(group_id2) < 0) TEST_ERROR
|
||||
@ -7960,8 +7946,7 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
|
||||
{
|
||||
char mntname[NAME_BUF_SIZE]; /* Link value */
|
||||
hid_t group_id; /* ID of group to test */
|
||||
H5G_stat_t sb; /* Buffer for querying object's info */
|
||||
haddr_t obj_addr; /* Address of object in file */
|
||||
H5O_info_t oi; /* Buffer for querying object's info */
|
||||
haddr_t mnt_root_addr; /* Address of root group in file to mount */
|
||||
hid_t obj_id; /* ID of object opened */
|
||||
unsigned mnt_idx; /* Index to mount group on */
|
||||
@ -7986,21 +7971,16 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
|
||||
if((obj_id = H5Oopen_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Get the object's information */
|
||||
if(H5Gget_objinfo(obj_id, ".", FALSE, &sb) < 0) TEST_ERROR
|
||||
#if H5_SIZEOF_UINT64_T > H5_SIZEOF_LONG
|
||||
obj_addr = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
#else
|
||||
obj_addr = (haddr_t)sb.objno[0];
|
||||
#endif
|
||||
if(H5Oget_info(obj_id, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* Check that the object is the correct one */
|
||||
if(order == H5_ITER_INC) {
|
||||
if(H5F_addr_ne(obj_addr, objno[u])) TEST_ERROR
|
||||
if(H5F_addr_ne(oi.addr, objno[u])) TEST_ERROR
|
||||
} /* end if */
|
||||
else if(order == H5_ITER_DEC) {
|
||||
unsigned dec_u = max_links - (u + 1); /* Decreasing mapped index */
|
||||
|
||||
if(H5F_addr_ne(obj_addr, objno[dec_u])) TEST_ERROR
|
||||
if(H5F_addr_ne(oi.addr, objno[dec_u])) TEST_ERROR
|
||||
} /* end if */
|
||||
else {
|
||||
/* XXX: What to do about native order? */
|
||||
@ -8017,12 +7997,8 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
|
||||
*/
|
||||
|
||||
/* Get the address of the root group in the file to mount */
|
||||
if(H5Gget_objinfo(mount_file_id, "/", FALSE, &sb) < 0) TEST_ERROR
|
||||
#if H5_SIZEOF_UINT64_T > H5_SIZEOF_LONG
|
||||
mnt_root_addr = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
#else
|
||||
mnt_root_addr = (haddr_t)sb.objno[0];
|
||||
#endif
|
||||
if(H5Oget_info(mount_file_id, "/", &oi, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
mnt_root_addr = oi.addr;
|
||||
|
||||
/* Mount a file over a group in main group */
|
||||
mnt_idx = 2;
|
||||
@ -8033,16 +8009,11 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
|
||||
if((obj_id = H5Oopen_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)mnt_idx, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Get the object's information */
|
||||
if(H5Gget_objinfo(obj_id, ".", FALSE, &sb) < 0) TEST_ERROR
|
||||
#if H5_SIZEOF_UINT64_T > H5_SIZEOF_LONG
|
||||
obj_addr = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
#else
|
||||
obj_addr = (haddr_t)sb.objno[0];
|
||||
#endif
|
||||
if(H5Oget_info(obj_id, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* Check that the object is the root of the mounted file and not in the previous file */
|
||||
if(H5F_addr_ne(obj_addr, mnt_root_addr)) TEST_ERROR
|
||||
if(H5F_addr_eq(obj_addr, objno[mnt_idx])) TEST_ERROR
|
||||
if(H5F_addr_ne(oi.addr, mnt_root_addr)) TEST_ERROR
|
||||
if(H5F_addr_eq(oi.addr, objno[mnt_idx])) TEST_ERROR
|
||||
|
||||
/* Close object */
|
||||
if(H5Oclose(obj_id) < 0) TEST_ERROR
|
||||
@ -8086,7 +8057,7 @@ open_by_idx(hid_t fapl)
|
||||
hbool_t use_index; /* Use index on creation order values */
|
||||
unsigned max_compact; /* Maximum # of links to store in group compactly */
|
||||
unsigned min_dense; /* Minimum # of links to store in group "densely" */
|
||||
H5G_stat_t sb; /* Buffer for querying object's info */
|
||||
H5O_info_t oi; /* Buffer for querying object's info */
|
||||
char filename[NAME_BUF_SIZE];/* File name */
|
||||
char objname[NAME_BUF_SIZE]; /* Object name */
|
||||
char valname[NAME_BUF_SIZE]; /* Link value */
|
||||
@ -8189,12 +8160,8 @@ open_by_idx(hid_t fapl)
|
||||
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Retrieve group's address on disk */
|
||||
if(H5Gget_objinfo(group_id2, ".", FALSE, &sb) < 0) TEST_ERROR
|
||||
#if H5_SIZEOF_UINT64_T > H5_SIZEOF_LONG
|
||||
objno[u] = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
#else
|
||||
objno[u] = (haddr_t)sb.objno[0];
|
||||
#endif
|
||||
if(H5Oget_info(group_id2, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
objno[u] = oi.addr;
|
||||
|
||||
/* Close group created */
|
||||
if(H5Gclose(group_id2) < 0) TEST_ERROR
|
||||
@ -8228,12 +8195,8 @@ open_by_idx(hid_t fapl)
|
||||
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Retrieve group's address on disk */
|
||||
if(H5Gget_objinfo(group_id2, ".", FALSE, &sb) < 0) TEST_ERROR
|
||||
#if H5_SIZEOF_UINT64_T > H5_SIZEOF_LONG
|
||||
objno[u] = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
#else
|
||||
objno[u] = (haddr_t)sb.objno[0];
|
||||
#endif
|
||||
if(H5Oget_info(group_id2, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
objno[u] = oi.addr;
|
||||
|
||||
/* Close group created */
|
||||
if(H5Gclose(group_id2) < 0) TEST_ERROR
|
||||
@ -8319,7 +8282,7 @@ open_by_idx_old(hid_t fapl)
|
||||
hid_t group_id = (-1); /* Group ID */
|
||||
hid_t soft_group_id = (-1); /* Group ID for soft links */
|
||||
H5_iter_order_t order; /* Order within in the index */
|
||||
H5G_stat_t sb; /* Buffer for querying object's info */
|
||||
H5O_info_t oi; /* Buffer for querying object's info */
|
||||
char filename[NAME_BUF_SIZE];/* File name */
|
||||
char objname[NAME_BUF_SIZE]; /* Object name */
|
||||
char valname[NAME_BUF_SIZE]; /* Link value */
|
||||
@ -8374,12 +8337,8 @@ open_by_idx_old(hid_t fapl)
|
||||
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
|
||||
|
||||
/* Retrieve group's address on disk */
|
||||
if(H5Gget_objinfo(group_id2, ".", FALSE, &sb) < 0) TEST_ERROR
|
||||
#if H5_SIZEOF_UINT64_T > H5_SIZEOF_LONG
|
||||
objno[u] = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
#else
|
||||
objno[u] = (haddr_t)sb.objno[0];
|
||||
#endif
|
||||
if(H5Oget_info(group_id2, ".", &oi, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
objno[u] = oi.addr;
|
||||
|
||||
/* Close group created */
|
||||
if(H5Gclose(group_id2) < 0) TEST_ERROR
|
||||
|
83
test/mount.c
83
test/mount.c
@ -254,7 +254,7 @@ static int
|
||||
test_hide(hid_t fapl)
|
||||
{
|
||||
hid_t file1 = -1, file2 = -1, grp = -1;
|
||||
H5G_stat_t sb1, sb2;
|
||||
H5O_info_t oi1, oi2;
|
||||
char filename1[1024], filename2[1024];
|
||||
|
||||
TESTING("name hiding under mount point");
|
||||
@ -266,7 +266,7 @@ test_hide(hid_t fapl)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Get information about file1:/mnt1/file1 for later */
|
||||
if(H5Gget_objinfo(file1, "/mnt1/file1", TRUE, &sb1) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file1, "/mnt1/file1", &oi1, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Build the virtual file */
|
||||
if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
@ -285,8 +285,8 @@ test_hide(hid_t fapl)
|
||||
* The original objects under file1:/mnt1 are still accessible by their
|
||||
* other names. This is a rather stupid test but demonstrates a point.
|
||||
*/
|
||||
if(H5Gget_objinfo(file1, "/file1", TRUE, &sb2) < 0) FAIL_STACK_ERROR
|
||||
if(HDmemcmp(&sb1.fileno, &sb2.fileno, sizeof(sb1.fileno)) || HDmemcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno))) {
|
||||
if(H5Oget_info(file1, "/file1", &oi2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(oi1.fileno != oi2.fileno || H5F_addr_ne(oi1.addr, oi2.addr)) {
|
||||
H5_FAILED();
|
||||
puts(" Hard link failed for hidden object.");
|
||||
TEST_ERROR
|
||||
@ -331,7 +331,7 @@ static int
|
||||
test_assoc(hid_t fapl)
|
||||
{
|
||||
hid_t file1 = -1, file2 = -1;
|
||||
H5G_stat_t sb1, sb2;
|
||||
H5O_info_t oi1, oi2;
|
||||
char filename1[1024], filename2[1024];
|
||||
|
||||
TESTING("mount point open");
|
||||
@ -344,7 +344,7 @@ test_assoc(hid_t fapl)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Get information about the root of file2 */
|
||||
if(H5Gget_objinfo(file2, "/", TRUE, &sb1) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file2, "/", &oi1, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Create the virtual file */
|
||||
if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
@ -353,8 +353,8 @@ test_assoc(hid_t fapl)
|
||||
* Get info about the mount point -- should be the same as the root group
|
||||
* of file2.
|
||||
*/
|
||||
if(H5Gget_objinfo(file1, "/mnt1", TRUE, &sb2) < 0) FAIL_STACK_ERROR
|
||||
if(HDmemcmp(&sb1.fileno, &sb2.fileno, sizeof(sb1.fileno)) || HDmemcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno))) {
|
||||
if(H5Oget_info(file1, "/mnt1", &oi2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(oi1.fileno != oi2.fileno || H5F_addr_ne(oi1.addr, oi2.addr)) {
|
||||
H5_FAILED();
|
||||
puts(" Association failed.");
|
||||
TEST_ERROR
|
||||
@ -523,6 +523,7 @@ static int
|
||||
test_preopen(hid_t fapl)
|
||||
{
|
||||
hid_t file1 = -1, file2 = -1, grp = -1;
|
||||
H5O_info_t oinfo;
|
||||
char filename1[1024], filename2[1024];
|
||||
|
||||
TESTING("preopening objects under the mount point");
|
||||
@ -540,7 +541,7 @@ test_preopen(hid_t fapl)
|
||||
if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Now access the thing we previously opened */
|
||||
if(H5Gget_objinfo(grp, ".", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(grp, ".", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Shut down */
|
||||
if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR
|
||||
@ -584,6 +585,7 @@ test_postopen(hid_t fapl)
|
||||
{
|
||||
|
||||
hid_t file1 = -1, file2 = -1, grp = -1;
|
||||
H5O_info_t oinfo;
|
||||
char filename1[1024], filename2[1024];
|
||||
|
||||
TESTING("open object access after unmount");
|
||||
@ -603,10 +605,10 @@ test_postopen(hid_t fapl)
|
||||
if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Now access the thing we previously opened */
|
||||
if(H5Gget_objinfo(grp, ".", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(grp, ".", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Try accessing it from the file */
|
||||
if(H5Gget_objinfo(file2, "/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file2, "/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Shut down */
|
||||
if(H5Gclose(grp) < 0) FAIL_STACK_ERROR
|
||||
@ -648,8 +650,9 @@ static int
|
||||
test_unlink(hid_t fapl)
|
||||
{
|
||||
hid_t file1 = -1, file2 = -1, mnt = -1, root = -1;
|
||||
herr_t status;
|
||||
H5O_info_t oinfo;
|
||||
char filename1[1024], filename2[1024];
|
||||
herr_t status;
|
||||
|
||||
TESTING("mount point unlinking");
|
||||
h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1);
|
||||
@ -675,12 +678,12 @@ test_unlink(hid_t fapl)
|
||||
* before the H5Fmount() and thus refers to the mount point itself rather
|
||||
* than the group mounted there.
|
||||
*/
|
||||
if(H5Gget_objinfo(file1, "/mnt_unlink/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(mnt, "/mnt_unlink/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(root, "/mnt_unlink/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(root, "file2", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file1, "/mnt_unlink/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(mnt, "/mnt_unlink/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(root, "/mnt_unlink/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(root, "file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
H5E_BEGIN_TRY {
|
||||
status = H5Gget_objinfo(mnt, "file2", TRUE, NULL);
|
||||
status = H5Oget_info(mnt, "file2", &oinfo, H5P_DEFAULT);
|
||||
} H5E_END_TRY;
|
||||
if(status >= 0) {
|
||||
H5_FAILED();
|
||||
@ -695,9 +698,9 @@ test_unlink(hid_t fapl)
|
||||
* We should still be able to get to "/file2" of file2 by starting at
|
||||
* `root' which is still open, but not by name.
|
||||
*/
|
||||
if(H5Gget_objinfo(root, "file2", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(root, "file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
H5E_BEGIN_TRY {
|
||||
status = H5Gget_objinfo(mnt, "file2", TRUE, NULL);
|
||||
status = H5Oget_info(mnt, "file2", &oinfo, H5P_DEFAULT);
|
||||
} H5E_END_TRY;
|
||||
if(status >= 0) {
|
||||
H5_FAILED();
|
||||
@ -705,7 +708,7 @@ test_unlink(hid_t fapl)
|
||||
TEST_ERROR
|
||||
} /* end if */
|
||||
H5E_BEGIN_TRY {
|
||||
status = H5Gget_objinfo(file2, "/mnt_unlink/file2", TRUE, NULL);
|
||||
status = H5Oget_info(file2, "/mnt_unlink/file2", &oinfo, H5P_DEFAULT);
|
||||
} H5E_END_TRY;
|
||||
if(status >= 0) {
|
||||
H5_FAILED();
|
||||
@ -776,6 +779,7 @@ static int
|
||||
test_mvmpt(hid_t fapl)
|
||||
{
|
||||
hid_t file1 = -1, file2 = -1;
|
||||
H5O_info_t oinfo;
|
||||
char filename1[1024], filename2[1024];
|
||||
|
||||
TESTING("mount point renaming");
|
||||
@ -792,7 +796,7 @@ test_mvmpt(hid_t fapl)
|
||||
if(H5Lmove(file1, "/mnt_move_a", H5L_SAME_LOC, "/mnt_move_b", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Access something under the new name */
|
||||
if(H5Gget_objinfo(file1, "/mnt_move_b/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file1, "/mnt_move_b/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Shut down */
|
||||
if(H5Funmount(file1, "/mnt_move_b") < 0) FAIL_STACK_ERROR
|
||||
@ -921,6 +925,7 @@ static int
|
||||
test_uniformity(hid_t fapl)
|
||||
{
|
||||
hid_t file1 = -1, file2 = -1;
|
||||
H5O_info_t oinfo;
|
||||
char filename1[1024], filename2[1024];
|
||||
|
||||
TESTING("file handle uniformity");
|
||||
@ -934,18 +939,18 @@ test_uniformity(hid_t fapl)
|
||||
if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Access some things from the file1 handle */
|
||||
if(H5Gget_objinfo(file1, "/", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(file1, "/mnt1", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(file1, "mnt1", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(file1, "/mnt1/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(file1, "mnt1/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file1, "/", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file1, "/mnt1", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file1, "mnt1", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file1, "/mnt1/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file1, "mnt1/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Access the same things from the file2 handle */
|
||||
if(H5Gget_objinfo(file2, "/", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(file2, "/mnt1", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(file2, "mnt1", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(file2, "/mnt1/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(file2, "mnt1/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file2, "/", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file2, "/mnt1", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file2, "mnt1", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file2, "/mnt1/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file2, "mnt1/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Shut down */
|
||||
if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR
|
||||
@ -984,6 +989,7 @@ static int
|
||||
test_close(hid_t fapl)
|
||||
{
|
||||
hid_t file1 = -1, file2 = -1;
|
||||
H5O_info_t oinfo;
|
||||
char filename1[1024], filename2[1024];
|
||||
|
||||
TESTING("file handle close");
|
||||
@ -1001,7 +1007,7 @@ test_close(hid_t fapl)
|
||||
* still accessible through the file2 handle.
|
||||
*/
|
||||
if(H5Fclose(file1) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(file2, "/mnt1", TRUE, NULL) < 0) {
|
||||
if(H5Oget_info(file2, "/mnt1", &oinfo, H5P_DEFAULT) < 0) {
|
||||
H5_FAILED();
|
||||
puts(" File1 contents are not accessible!");
|
||||
TEST_ERROR
|
||||
@ -1022,7 +1028,7 @@ test_close(hid_t fapl)
|
||||
* Close file2. It is not actually closed because it's a child of file1.
|
||||
*/
|
||||
if(H5Fclose(file2) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(file1, "/mnt1/file2", TRUE, NULL) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file1, "/mnt1/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Fclose(file1) < 0) FAIL_STACK_ERROR
|
||||
|
||||
/* Check that all file IDs have been closed */
|
||||
@ -2255,9 +2261,10 @@ test_fcdegree_strong(hid_t fapl)
|
||||
hid_t fid1 = -1, fid2 = -1; /* File IDs */
|
||||
hid_t gidA = -1, gidM = -1, gidAM = -1; /* Group IDs */
|
||||
hid_t fapl_id = -1; /* FAPL IDs */
|
||||
herr_t ret; /* Generic return value */
|
||||
H5O_info_t oinfo;
|
||||
char filename1[1024],
|
||||
filename2[1024]; /* Name of files to mount */
|
||||
herr_t ret; /* Generic return value */
|
||||
|
||||
TESTING("'strong' file close degree");
|
||||
|
||||
@ -2323,9 +2330,9 @@ test_fcdegree_strong(hid_t fapl)
|
||||
TEST_ERROR
|
||||
|
||||
/* Check that objects are still open */
|
||||
if (H5Gget_objinfo(gidA, ".", TRUE, NULL) < 0)
|
||||
if(H5Oget_info(gidA, ".", &oinfo, H5P_DEFAULT) < 0)
|
||||
TEST_ERROR
|
||||
if (H5Gget_objinfo(gidAM, ".", TRUE, NULL) < 0)
|
||||
if(H5Oget_info(gidAM, ".", &oinfo, H5P_DEFAULT) < 0)
|
||||
TEST_ERROR
|
||||
|
||||
/* Close file #2 (should close open objects also) */
|
||||
@ -2334,12 +2341,12 @@ test_fcdegree_strong(hid_t fapl)
|
||||
|
||||
/* Check that objects are closed */
|
||||
H5E_BEGIN_TRY {
|
||||
ret = H5Gget_objinfo(gidA, ".", TRUE, NULL);
|
||||
ret = H5Oget_info(gidA, ".", &oinfo, H5P_DEFAULT);
|
||||
} H5E_END_TRY;
|
||||
if(ret >= 0)
|
||||
TEST_ERROR
|
||||
H5E_BEGIN_TRY {
|
||||
ret = H5Gget_objinfo(gidAM, ".", TRUE, NULL);
|
||||
ret = H5Oget_info(gidAM, ".", &oinfo, H5P_DEFAULT);
|
||||
} H5E_END_TRY;
|
||||
if(ret >= 0)
|
||||
TEST_ERROR
|
||||
|
156
test/mtime.c
156
test/mtime.c
@ -63,7 +63,7 @@ main(void)
|
||||
hsize_t size[1] = {2};
|
||||
time_t now;
|
||||
struct tm *tm;
|
||||
H5G_stat_t sb1, sb2;
|
||||
H5O_info_t oi1, oi2;
|
||||
signed char buf1[32], buf2[32];
|
||||
char filename[1024];
|
||||
|
||||
@ -74,51 +74,51 @@ main(void)
|
||||
|
||||
/* Create the file, create a dataset, then close the file */
|
||||
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
|
||||
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
|
||||
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
|
||||
TEST_ERROR;
|
||||
if ((space=H5Screate_simple(1, size, NULL))<0) TEST_ERROR;
|
||||
if ((dset=H5Dcreate(file, "dset", H5T_NATIVE_SCHAR, space, H5P_DEFAULT))<0)
|
||||
if((space = H5Screate_simple(1, size, NULL)) < 0) TEST_ERROR;
|
||||
if((dset = H5Dcreate(file, "dset", H5T_NATIVE_SCHAR, space, H5P_DEFAULT)) < 0)
|
||||
TEST_ERROR;
|
||||
now = time(NULL);
|
||||
if (H5Dclose(dset)<0) TEST_ERROR;
|
||||
if (H5Sclose(space)<0) TEST_ERROR;
|
||||
if (H5Fclose(file)<0) TEST_ERROR;
|
||||
now = HDtime(NULL);
|
||||
if(H5Dclose(dset) < 0) TEST_ERROR;
|
||||
if(H5Sclose(space) < 0) TEST_ERROR;
|
||||
if(H5Fclose(file) < 0) TEST_ERROR;
|
||||
|
||||
/*
|
||||
* Open the file and get the modification time. We'll test the new
|
||||
* H5Gget_objinfo() arguments too: being able to stat something without
|
||||
* knowing its name.
|
||||
*/
|
||||
* Open the file and get the modification time. We'll test the
|
||||
* H5Oget_info() arguments too: being able to stat something without
|
||||
* knowing its name.
|
||||
*/
|
||||
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
|
||||
if ((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) TEST_ERROR;
|
||||
if (H5Gget_objinfo(file, "dset", TRUE, &sb1)<0) TEST_ERROR;
|
||||
if ((dset=H5Dopen(file, "dset"))<0) TEST_ERROR;
|
||||
if (H5Gget_objinfo(dset, ".", TRUE, &sb2)<0) TEST_ERROR;
|
||||
if (H5Dclose(dset)<0) TEST_ERROR;
|
||||
if (H5Fclose(file)<0) TEST_ERROR;
|
||||
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR;
|
||||
if(H5Oget_info(file, "dset", &oi1, H5P_DEFAULT) < 0) TEST_ERROR;
|
||||
if((dset = H5Dopen(file, "dset")) < 0) TEST_ERROR;
|
||||
if(H5Oget_info(dset, ".", &oi2, H5P_DEFAULT) < 0) TEST_ERROR;
|
||||
if(H5Dclose(dset) < 0) TEST_ERROR;
|
||||
if(H5Fclose(file) < 0) TEST_ERROR;
|
||||
|
||||
/* Compare times from the two ways of calling H5Gget_objinfo() */
|
||||
if (HDmemcmp(&sb1.objno, &sb2.objno, sizeof(sb1.objno)) || sb1.mtime!=sb2.mtime) {
|
||||
/* Compare addresses & times from the two ways of calling H5Oget_info() */
|
||||
if(oi1.addr != oi2.addr || oi1.mtime != oi2.mtime) {
|
||||
H5_FAILED();
|
||||
puts(" Calling H5Gget_objinfo() with the dataset ID returned");
|
||||
puts(" Calling H5Oget_info() with the dataset ID returned");
|
||||
puts(" different values than calling it with a file and dataset");
|
||||
puts(" name.");
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Compare times -- they must be within 60 seconds of one another */
|
||||
if (0==sb1.mtime) {
|
||||
if(0 == oi1.mtime) {
|
||||
SKIPPED();
|
||||
puts(" The modification time could not be decoded on this OS.");
|
||||
puts(" Modification times will be mantained in the file but");
|
||||
puts(" cannot be queried on this system. See H5O_mtime_decode().");
|
||||
return 0;
|
||||
} else if (fabs(HDdifftime(now, sb1.mtime))>60.0) {
|
||||
} else if(HDfabs(HDdifftime(now, oi1.mtime)) > 60.0) {
|
||||
H5_FAILED();
|
||||
tm = localtime(&(sb1.mtime));
|
||||
strftime((char*)buf1, sizeof buf1, "%Y-%m-%d %H:%M:%S", tm);
|
||||
tm = localtime(&now);
|
||||
strftime((char*)buf2, sizeof buf2, "%Y-%m-%d %H:%M:%S", tm);
|
||||
tm = HDlocaltime(&(oi1.mtime));
|
||||
HDstrftime((char*)buf1, sizeof buf1, "%Y-%m-%d %H:%M:%S", tm);
|
||||
tm = HDlocaltime(&now);
|
||||
HDstrftime((char*)buf2, sizeof buf2, "%Y-%m-%d %H:%M:%S", tm);
|
||||
printf(" got: %s\n ans: %s\n", buf1, buf2);
|
||||
goto error;
|
||||
}
|
||||
@ -131,32 +131,33 @@ main(void)
|
||||
TESTING("accessing old modification time messages");
|
||||
|
||||
{
|
||||
char testfile[512]="";
|
||||
char *srcdir = HDgetenv("srcdir");
|
||||
if (srcdir && ((HDstrlen(srcdir) + strlen(TESTFILE1) + 1) < sizeof(testfile))){
|
||||
HDstrcpy(testfile, srcdir);
|
||||
HDstrcat(testfile, "/");
|
||||
}
|
||||
HDstrcat(testfile, TESTFILE1);
|
||||
file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
if (file >= 0){
|
||||
if(H5Gget_objinfo(file, "/Dataset1", TRUE, &sb1)<0)
|
||||
TEST_ERROR;
|
||||
if(sb1.mtime!=MTIME1) {
|
||||
H5_FAILED();
|
||||
/* If this fails, examine H5Omtime.c. Modification time is very
|
||||
* system dependant (e.g., on Windows DST must be hardcoded). */
|
||||
puts(" Old modification time incorrect");
|
||||
goto error;
|
||||
char testfile[512]="";
|
||||
char *srcdir = HDgetenv("srcdir");
|
||||
|
||||
if(srcdir && ((HDstrlen(srcdir) + strlen(TESTFILE1) + 1) < sizeof(testfile))){
|
||||
HDstrcpy(testfile, srcdir);
|
||||
HDstrcat(testfile, "/");
|
||||
}
|
||||
if (H5Fclose(file)<0) TEST_ERROR;
|
||||
}
|
||||
else {
|
||||
H5_FAILED();
|
||||
printf("***cannot open the pre-created old modification test file (%s)\n",
|
||||
testfile);
|
||||
goto error;
|
||||
} /* end else */
|
||||
HDstrcat(testfile, TESTFILE1);
|
||||
file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
if(file >= 0){
|
||||
if(H5Oget_info(file, "/Dataset1", &oi1, H5P_DEFAULT) < 0)
|
||||
TEST_ERROR;
|
||||
if(oi1.mtime != MTIME1) {
|
||||
H5_FAILED();
|
||||
/* If this fails, examine H5Omtime.c. Modification time is very
|
||||
* system dependant (e.g., on Windows DST must be hardcoded). */
|
||||
puts(" Old modification time incorrect");
|
||||
goto error;
|
||||
}
|
||||
if(H5Fclose(file) < 0) TEST_ERROR;
|
||||
}
|
||||
else {
|
||||
H5_FAILED();
|
||||
printf("***cannot open the pre-created old modification test file (%s)\n",
|
||||
testfile);
|
||||
goto error;
|
||||
} /* end else */
|
||||
}
|
||||
PASSED();
|
||||
|
||||
@ -166,30 +167,31 @@ main(void)
|
||||
TESTING("accessing new modification time messages");
|
||||
|
||||
{
|
||||
char testfile[512]="";
|
||||
char *srcdir = HDgetenv("srcdir");
|
||||
if (srcdir && ((HDstrlen(srcdir) + strlen(TESTFILE2) + 1) < sizeof(testfile))){
|
||||
HDstrcpy(testfile, srcdir);
|
||||
HDstrcat(testfile, "/");
|
||||
}
|
||||
HDstrcat(testfile, TESTFILE2);
|
||||
file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
if (file >= 0){
|
||||
if(H5Gget_objinfo(file, "/Dataset1", TRUE, &sb2)<0)
|
||||
TEST_ERROR;
|
||||
if(sb2.mtime!=MTIME2) {
|
||||
H5_FAILED();
|
||||
puts(" Modification time incorrect.");
|
||||
goto error;
|
||||
char testfile[512]="";
|
||||
char *srcdir = HDgetenv("srcdir");
|
||||
|
||||
if(srcdir && ((HDstrlen(srcdir) + strlen(TESTFILE2) + 1) < sizeof(testfile))){
|
||||
HDstrcpy(testfile, srcdir);
|
||||
HDstrcat(testfile, "/");
|
||||
}
|
||||
if (H5Fclose(file)<0) TEST_ERROR;
|
||||
}
|
||||
else {
|
||||
H5_FAILED();
|
||||
printf("***cannot open the pre-created old modification test file (%s)\n",
|
||||
testfile);
|
||||
goto error;
|
||||
} /* end else */
|
||||
HDstrcat(testfile, TESTFILE2);
|
||||
file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
if(file >= 0){
|
||||
if(H5Oget_info(file, "/Dataset1", &oi2, H5P_DEFAULT) < 0)
|
||||
TEST_ERROR;
|
||||
if(oi2.mtime != MTIME2) {
|
||||
H5_FAILED();
|
||||
puts(" Modification time incorrect.");
|
||||
goto error;
|
||||
}
|
||||
if(H5Fclose(file) < 0) TEST_ERROR;
|
||||
}
|
||||
else {
|
||||
H5_FAILED();
|
||||
printf("***cannot open the pre-created old modification test file (%s)\n",
|
||||
testfile);
|
||||
goto error;
|
||||
} /* end else */
|
||||
}
|
||||
PASSED();
|
||||
|
||||
@ -199,9 +201,7 @@ main(void)
|
||||
return 0;
|
||||
|
||||
/* Something broke */
|
||||
error:
|
||||
error:
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -147,13 +147,13 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void
|
||||
addr_insert(H5G_stat_t *sb)
|
||||
addr_insert(H5O_info_t *oi)
|
||||
{
|
||||
size_t n;
|
||||
|
||||
/* Don't add it if the link count is 1 because such an object can only
|
||||
* be encountered once. */
|
||||
if(sb->nlink < 2)
|
||||
if(oi->rc < 2)
|
||||
return;
|
||||
|
||||
/* Extend the table */
|
||||
@ -164,11 +164,7 @@ addr_insert(H5G_stat_t *sb)
|
||||
|
||||
/* Insert the entry */
|
||||
n = idtab_g.nobjs++;
|
||||
#if H5_SIZEOF_UINT64_T > H5_SIZEOF_LONG
|
||||
idtab_g.obj[n] = (haddr_t)sb->objno[0] | ((haddr_t)sb->objno[1] << (8 * sizeof(long)));
|
||||
#else
|
||||
idtab_g.obj[n] = (haddr_t)sb->objno[0];
|
||||
#endif
|
||||
idtab_g.obj[n] = oi->addr;
|
||||
} /* end addr_insert() */
|
||||
|
||||
|
||||
@ -187,21 +183,16 @@ addr_insert(H5G_stat_t *sb)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static hbool_t
|
||||
addr_lookup(H5G_stat_t *sb)
|
||||
addr_lookup(H5O_info_t *oi)
|
||||
{
|
||||
haddr_t obj_addr; /* Object's address in the file */
|
||||
size_t n;
|
||||
|
||||
if(sb->nlink<2) return FALSE; /*only one link possible*/
|
||||
if(oi->rc < 2) return FALSE; /*only one link possible*/
|
||||
|
||||
#if H5_SIZEOF_UINT64_T > H5_SIZEOF_LONG
|
||||
obj_addr = (haddr_t)sb->objno[0] | ((haddr_t)sb->objno[1] << (8 * sizeof(long)));
|
||||
#else
|
||||
obj_addr = (haddr_t)sb->objno[0];
|
||||
#endif
|
||||
for(n = 0; n < idtab_g.nobjs; n++)
|
||||
if(idtab_g.obj[n] == obj_addr)
|
||||
if(H5F_addr_eq(idtab_g.obj[n], oi->addr))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
} /* end addr_lookup() */
|
||||
|
||||
@ -897,11 +888,12 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
|
||||
if((obj2_id = H5Rdereference(parent2, H5R_OBJECT, ref_buf2)) < 0) TEST_ERROR
|
||||
|
||||
/* break the infinite loop when the ref_object points to itself */
|
||||
if (obj_owner > 0) {
|
||||
H5G_stat_t stat1, stat2;
|
||||
if (H5Gget_objinfo(obj_owner, ".", 0, &stat1) < 0) TEST_ERROR
|
||||
if (H5Gget_objinfo(obj1_id, ".", 0, &stat2) < 0) TEST_ERROR
|
||||
if ( (stat1.objno[0] == stat2.objno[0]) && (stat1.objno[1] == stat2.objno[1]) ) {
|
||||
if(obj_owner > 0) {
|
||||
H5O_info_t oinfo1, oinfo2;
|
||||
|
||||
if(H5Oget_info(obj_owner, ".", &oinfo1, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Oget_info(obj1_id, ".", &oinfo2, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5F_addr_eq(oinfo1.addr, oinfo2.addr)) {
|
||||
if(H5Oclose(obj1_id) < 0) TEST_ERROR
|
||||
if(H5Oclose(obj2_id) < 0) TEST_ERROR
|
||||
return TRUE;
|
||||
@ -953,12 +945,12 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
|
||||
if((obj2_id = H5Rdereference(parent2, H5R_DATASET_REGION, ref_buf2)) < 0) TEST_ERROR
|
||||
|
||||
/* break the infinite loop when the ref_object points to itself */
|
||||
if (obj_owner > 0) {
|
||||
H5G_stat_t stat1, stat2;
|
||||
if (H5Gget_objinfo(obj_owner, ".", 0, &stat1) < 0) TEST_ERROR
|
||||
if (H5Gget_objinfo(obj1_id, ".", 0, &stat2) < 0) TEST_ERROR
|
||||
if(obj_owner > 0) {
|
||||
H5O_info_t oinfo1, oinfo2;
|
||||
|
||||
if ( (stat1.objno[0] == stat2.objno[0]) && (stat1.objno[1] == stat2.objno[1]) ) {
|
||||
if(H5Oget_info(obj_owner, ".", &oinfo1, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Oget_info(obj1_id, ".", &oinfo2, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5F_addr_eq(oinfo1.addr, oinfo2.addr)) {
|
||||
if(H5Oclose(obj1_id) < 0) TEST_ERROR
|
||||
if(H5Oclose(obj2_id) < 0) TEST_ERROR
|
||||
return TRUE;
|
||||
@ -1270,10 +1262,8 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
|
||||
char objname2[NAME_BUF_SIZE]; /* Name of object in group */
|
||||
H5G_obj_t objtype; /* Type of object in group */
|
||||
H5G_obj_t objtype2; /* Type of object in group */
|
||||
H5G_stat_t objstat; /* Object info */
|
||||
H5G_stat_t objstat2; /* Object info */
|
||||
H5L_info_t linfo; /* Link information */
|
||||
H5L_info_t linfo2; /* Link information */
|
||||
H5L_info_t linfo; /* Link information */
|
||||
H5L_info_t linfo2; /* Link information */
|
||||
hid_t oid, oid2; /* IDs of objects within group */
|
||||
|
||||
/* Loop over contents of groups */
|
||||
@ -1288,12 +1278,22 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
|
||||
if((objtype2 = H5Gget_objtype_by_idx(gid2, idx)) < 0) TEST_ERROR
|
||||
if(objtype != objtype2) TEST_ERROR
|
||||
|
||||
/* Compare some pieces of the H5G_stat_t */
|
||||
if(H5Gget_objinfo(gid, objname, FALSE, &objstat) < 0) TEST_ERROR
|
||||
if(H5Gget_objinfo(gid2, objname2, FALSE, &objstat2) < 0) TEST_ERROR
|
||||
if(objstat.type != objstat2.type) TEST_ERROR
|
||||
if(objstat.type != H5G_LINK && objstat.type != H5G_UDLINK) {
|
||||
if(objstat.nlink != objstat2.nlink) TEST_ERROR
|
||||
/* Get link info */
|
||||
if(H5Lget_info(gid, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Lget_info(gid2, objname2, &linfo2, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(linfo.type != linfo2.type) TEST_ERROR
|
||||
|
||||
/* Extra checks for "real" objects */
|
||||
if(linfo.type == H5L_TYPE_HARD) {
|
||||
H5O_info_t oinfo; /* Object info */
|
||||
H5O_info_t oinfo2; /* Object info */
|
||||
|
||||
/* Compare some pieces of the object info */
|
||||
if(H5Oget_info(gid, objname, &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Oget_info(gid2, objname2, &oinfo2, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
if(oinfo.type != oinfo2.type) TEST_ERROR
|
||||
if(oinfo.rc != oinfo2.rc) TEST_ERROR
|
||||
|
||||
/* If NULL messages are preserved, the number of messages
|
||||
* should be the same in the destination.
|
||||
@ -1301,23 +1301,19 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
|
||||
* of messages hasn't increased.
|
||||
*/
|
||||
if(H5O_COPY_PRESERVE_NULL_FLAG & copy_flags) {
|
||||
if(objstat.ohdr.nmesgs != objstat2.ohdr.nmesgs)
|
||||
if(oinfo.hdr.nmesgs != oinfo2.hdr.nmesgs)
|
||||
;
|
||||
else
|
||||
if(objstat.ohdr.nmesgs < objstat2.ohdr.nmesgs) TEST_ERROR
|
||||
if(oinfo.hdr.nmesgs < oinfo2.hdr.nmesgs) TEST_ERROR
|
||||
}
|
||||
|
||||
/* Check for object already having been compared */
|
||||
if(addr_lookup(&oinfo))
|
||||
continue;
|
||||
else
|
||||
addr_insert(&oinfo);
|
||||
} /* end if */
|
||||
|
||||
/* Get link info */
|
||||
if(H5Lget_info(gid, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(H5Lget_info(gid2, objname2, &linfo2, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* Check for object already having been compared */
|
||||
if(addr_lookup(&objstat))
|
||||
continue;
|
||||
else
|
||||
addr_insert(&objstat);
|
||||
|
||||
/* Compare objects within group */
|
||||
switch(objtype) {
|
||||
case H5G_LINK:
|
||||
@ -1385,7 +1381,7 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
|
||||
if(H5Lget_val(gid2, objname2, linkval2, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
|
||||
/* Compare link udata */
|
||||
if(HDmemcmp(linkval, linkval2, objstat.linklen)) TEST_ERROR
|
||||
if(HDmemcmp(linkval, linkval2, linfo.u.val_size)) TEST_ERROR
|
||||
}
|
||||
break;
|
||||
|
||||
|
30
test/stab.c
30
test/stab.c
@ -325,7 +325,7 @@ lifecycle(hid_t fapl2)
|
||||
unsigned est_num_entries; /* Estimated # of entries in group */
|
||||
unsigned est_name_len; /* Estimated length of entry name */
|
||||
unsigned nmsgs; /* Number of messages in group's header */
|
||||
H5G_stat_t obj_stat; /* Object info */
|
||||
H5O_info_t oinfo; /* Object info */
|
||||
char objname[NAME_BUF_SIZE]; /* Object name */
|
||||
char filename[NAME_BUF_SIZE];
|
||||
h5_stat_size_t empty_size; /* Size of an empty file */
|
||||
@ -416,15 +416,11 @@ lifecycle(hid_t fapl2)
|
||||
if(H5G_is_new_dense_test(gid) != FALSE) TEST_ERROR
|
||||
|
||||
/* Check that the object header is only one chunk and the space has been allocated correctly */
|
||||
if(H5Gget_objinfo(gid, ".", FALSE, &obj_stat) < 0) TEST_ERROR
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
if(obj_stat.ohdr.size != 151) TEST_ERROR
|
||||
#else /* H5_HAVE_LARGE_HSIZET */
|
||||
if(obj_stat.ohdr.size != 131) TEST_ERROR
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
if(obj_stat.ohdr.free != 0) TEST_ERROR
|
||||
if(obj_stat.ohdr.nmesgs != 6) TEST_ERROR
|
||||
if(obj_stat.ohdr.nchunks != 1) TEST_ERROR
|
||||
if(H5Oget_info(gid, ".", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(oinfo.hdr.space.total != 151) TEST_ERROR
|
||||
if(oinfo.hdr.space.free != 0) TEST_ERROR
|
||||
if(oinfo.hdr.nmesgs != 6) TEST_ERROR
|
||||
if(oinfo.hdr.nchunks != 1) TEST_ERROR
|
||||
|
||||
/* Create one more "bottom" group, which should push top group into using a symbol table */
|
||||
sprintf(objname, LIFECYCLE_BOTTOM_GROUP, u);
|
||||
@ -442,15 +438,11 @@ lifecycle(hid_t fapl2)
|
||||
if(H5G_is_new_dense_test(gid) != TRUE) TEST_ERROR
|
||||
|
||||
/* Check that the object header is still one chunk and the space has been allocated correctly */
|
||||
if(H5Gget_objinfo(gid, ".", FALSE, &obj_stat) < 0) TEST_ERROR
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
if(obj_stat.ohdr.size != 151) TEST_ERROR
|
||||
#else /* H5_HAVE_LARGE_HSIZET */
|
||||
if(obj_stat.ohdr.size != 131) TEST_ERROR
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
if(obj_stat.ohdr.free != 92) TEST_ERROR
|
||||
if(obj_stat.ohdr.nmesgs != 3) TEST_ERROR
|
||||
if(obj_stat.ohdr.nchunks != 1) TEST_ERROR
|
||||
if(H5Oget_info(gid, ".", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
|
||||
if(oinfo.hdr.space.total != 151) TEST_ERROR
|
||||
if(oinfo.hdr.space.free != 92) TEST_ERROR
|
||||
if(oinfo.hdr.nmesgs != 3) TEST_ERROR
|
||||
if(oinfo.hdr.nchunks != 1) TEST_ERROR
|
||||
|
||||
/* Unlink objects from top group */
|
||||
while(u >= LIFECYCLE_MIN_DENSE) {
|
||||
|
105
test/tattr.c
105
test/tattr.c
@ -1595,9 +1595,9 @@ test_attr_dtype_shared(hid_t fapl)
|
||||
hid_t space_id; /* Dataspace ID for dataset & attribute */
|
||||
hid_t type_id; /* Datatype ID for named datatype */
|
||||
hid_t attr_id; /* Attribute ID */
|
||||
int data=8; /* Data to write */
|
||||
int rdata=0; /* Read read in */
|
||||
H5G_stat_t statbuf; /* Object's information */
|
||||
int data = 8; /* Data to write */
|
||||
int rdata = 0; /* Read read in */
|
||||
H5O_info_t oinfo; /* Object's information */
|
||||
h5_stat_size_t empty_filesize; /* Size of empty file */
|
||||
h5_stat_size_t filesize; /* Size of file after modifications */
|
||||
herr_t ret; /* Generic return value */
|
||||
@ -1606,153 +1606,154 @@ test_attr_dtype_shared(hid_t fapl)
|
||||
MESSAGE(5, ("Testing Shared Datatypes with Attributes\n"));
|
||||
|
||||
/* Create a file */
|
||||
file_id=H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
|
||||
file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
|
||||
CHECK(file_id, FAIL, "H5Fopen");
|
||||
|
||||
/* Close file */
|
||||
ret=H5Fclose(file_id);
|
||||
ret = H5Fclose(file_id);
|
||||
CHECK(ret, FAIL, "H5Fclose");
|
||||
|
||||
/* Get size of file */
|
||||
empty_filesize=h5_get_file_size(FILENAME);
|
||||
if(empty_filesize<0)
|
||||
TestErrPrintf("Line %d: file size wrong!\n",__LINE__);
|
||||
empty_filesize = h5_get_file_size(FILENAME);
|
||||
if(empty_filesize < 0)
|
||||
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
|
||||
|
||||
|
||||
/* Re-open file */
|
||||
file_id=H5Fopen(FILENAME,H5F_ACC_RDWR,fapl);
|
||||
file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
|
||||
CHECK(file_id, FAIL, "H5Fopen");
|
||||
|
||||
/* Create a datatype to commit and use */
|
||||
type_id=H5Tcopy(H5T_NATIVE_INT);
|
||||
type_id = H5Tcopy(H5T_NATIVE_INT);
|
||||
CHECK(type_id, FAIL, "H5Tcopy");
|
||||
|
||||
/* Commit datatype to file */
|
||||
ret=H5Tcommit(file_id,TYPE1_NAME,type_id);
|
||||
ret = H5Tcommit(file_id, TYPE1_NAME, type_id);
|
||||
CHECK(ret, FAIL, "H5Tcommit");
|
||||
|
||||
/* Check reference count on named datatype */
|
||||
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.nlink, 1, "H5Tcommit");
|
||||
ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 1, "H5Tcommit");
|
||||
|
||||
/* Create dataspace for dataset */
|
||||
space_id=H5Screate(H5S_SCALAR);
|
||||
space_id = H5Screate(H5S_SCALAR);
|
||||
CHECK(space_id, FAIL, "H5Screate");
|
||||
|
||||
/* Create dataset */
|
||||
dset_id=H5Dcreate(file_id,DSET1_NAME,type_id,space_id,H5P_DEFAULT);
|
||||
dset_id = H5Dcreate(file_id, DSET1_NAME, type_id, space_id, H5P_DEFAULT);
|
||||
CHECK(dset_id, FAIL, "H5Dcreate");
|
||||
|
||||
/* Check reference count on named datatype */
|
||||
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.nlink, 2, "H5Dcreate");
|
||||
ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 2, "H5Dcreate");
|
||||
|
||||
/* Create attribute on dataset */
|
||||
attr_id=H5Acreate(dset_id,ATTR1_NAME,type_id,space_id,H5P_DEFAULT);
|
||||
attr_id = H5Acreate(dset_id, ATTR1_NAME, type_id, space_id, H5P_DEFAULT);
|
||||
CHECK(attr_id, FAIL, "H5Acreate");
|
||||
|
||||
/* Check reference count on named datatype */
|
||||
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.nlink, 3, "H5Acreate");
|
||||
ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 3, "H5Acreate");
|
||||
|
||||
/* Close attribute */
|
||||
ret=H5Aclose(attr_id);
|
||||
ret = H5Aclose(attr_id);
|
||||
CHECK(ret, FAIL, "H5Aclose");
|
||||
|
||||
/* Delete attribute */
|
||||
ret=H5Adelete(dset_id,ATTR1_NAME);
|
||||
ret = H5Adelete(dset_id, ATTR1_NAME);
|
||||
CHECK(ret, FAIL, "H5Adelete");
|
||||
|
||||
/* Check reference count on named datatype */
|
||||
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.nlink, 2, "H5Adelete");
|
||||
ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 2, "H5Adelete");
|
||||
|
||||
/* Create attribute on dataset */
|
||||
attr_id=H5Acreate(dset_id,ATTR1_NAME,type_id,space_id,H5P_DEFAULT);
|
||||
attr_id = H5Acreate(dset_id, ATTR1_NAME, type_id, space_id, H5P_DEFAULT);
|
||||
CHECK(attr_id, FAIL, "H5Acreate");
|
||||
|
||||
/* Check reference count on named datatype */
|
||||
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.nlink, 3, "H5Acreate");
|
||||
ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 3, "H5Acreate");
|
||||
|
||||
/* Write data into the attribute */
|
||||
ret=H5Awrite(attr_id,H5T_NATIVE_INT,&data);
|
||||
ret = H5Awrite(attr_id, H5T_NATIVE_INT, &data);
|
||||
CHECK(ret, FAIL, "H5Awrite");
|
||||
|
||||
/* Close attribute */
|
||||
ret=H5Aclose(attr_id);
|
||||
ret = H5Aclose(attr_id);
|
||||
CHECK(ret, FAIL, "H5Aclose");
|
||||
|
||||
/* Close dataset */
|
||||
ret=H5Dclose(dset_id);
|
||||
ret = H5Dclose(dset_id);
|
||||
CHECK(ret, FAIL, "H5Dclose");
|
||||
|
||||
/* Close dataspace */
|
||||
ret=H5Sclose(space_id);
|
||||
ret = H5Sclose(space_id);
|
||||
CHECK(ret, FAIL, "H5Sclose");
|
||||
|
||||
/* Close datatype */
|
||||
ret=H5Tclose(type_id);
|
||||
ret = H5Tclose(type_id);
|
||||
CHECK(ret, FAIL, "H5Tclose");
|
||||
|
||||
/* Close file */
|
||||
ret=H5Fclose(file_id);
|
||||
ret = H5Fclose(file_id);
|
||||
CHECK(ret, FAIL, "H5Fclose");
|
||||
|
||||
|
||||
/* Re-open file */
|
||||
file_id=H5Fopen(FILENAME,H5F_ACC_RDWR,fapl);
|
||||
file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
|
||||
CHECK(file_id, FAIL, "H5Fopen");
|
||||
|
||||
/* Open dataset */
|
||||
dset_id=H5Dopen(file_id,DSET1_NAME);
|
||||
dset_id = H5Dopen(file_id, DSET1_NAME);
|
||||
CHECK(dset_id, FAIL, "H5Dopen");
|
||||
|
||||
/* Open attribute */
|
||||
attr_id=H5Aopen_name(dset_id,ATTR1_NAME);
|
||||
attr_id = H5Aopen_name(dset_id, ATTR1_NAME);
|
||||
CHECK(attr_id, FAIL, "H5Aopen_name");
|
||||
|
||||
/* Read data from the attribute */
|
||||
ret=H5Aread(attr_id,H5T_NATIVE_INT,&rdata);
|
||||
ret = H5Aread(attr_id, H5T_NATIVE_INT, &rdata);
|
||||
CHECK(ret, FAIL, "H5Aread");
|
||||
VERIFY(data, rdata, "H5Aread");
|
||||
|
||||
/* Close attribute */
|
||||
ret=H5Aclose(attr_id);
|
||||
ret = H5Aclose(attr_id);
|
||||
CHECK(ret, FAIL, "H5Aclose");
|
||||
|
||||
/* Close dataset */
|
||||
ret=H5Dclose(dset_id);
|
||||
ret = H5Dclose(dset_id);
|
||||
CHECK(ret, FAIL, "H5Dclose");
|
||||
|
||||
/* Check reference count on named datatype */
|
||||
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.nlink, 3, "H5Gget_objinfo");
|
||||
ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 3, "H5Oget_info");
|
||||
|
||||
/* Unlink the dataset */
|
||||
ret = H5Ldelete(file_id, DSET1_NAME, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Ldelete");
|
||||
|
||||
/* Check reference count on named datatype */
|
||||
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.nlink, 1, "H5Gget_objinfo");
|
||||
ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 1, "H5Ldelete");
|
||||
|
||||
/* Unlink the named datatype */
|
||||
ret = H5Ldelete(file_id, TYPE1_NAME, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Ldelete");
|
||||
|
||||
/* Close file */
|
||||
ret=H5Fclose(file_id);
|
||||
ret = H5Fclose(file_id);
|
||||
CHECK(ret, FAIL, "H5Fclose");
|
||||
|
||||
/* Check size of file */
|
||||
filesize=h5_get_file_size(FILENAME);
|
||||
filesize = h5_get_file_size(FILENAME);
|
||||
VERIFY(filesize, empty_filesize, "h5_get_file_size");
|
||||
} /* test_attr_dtype_shared() */
|
||||
|
||||
|
@ -69,15 +69,16 @@
|
||||
}
|
||||
|
||||
/* Used to make certain a return value _is_ a value */
|
||||
#define VERIFY(x, val, where) do { \
|
||||
if (GetTestVerbosity()>=VERBO_HI) { \
|
||||
#define VERIFY(_x, _val, where) do { \
|
||||
long __x = (long)_x, __val = (long)_val; \
|
||||
if(GetTestVerbosity() >= VERBO_HI) { \
|
||||
print_func(" Call to routine: %15s at line %4d in %s had value " \
|
||||
"%ld \n", (where), (int)__LINE__, __FILE__, (long)(x)); \
|
||||
"%ld \n", (where), (int)__LINE__, __FILE__, __x); \
|
||||
} \
|
||||
if ((x) != (val)) { \
|
||||
if((__x) != (__val)) { \
|
||||
TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \
|
||||
"in %s\n", (where), (long)(val), (long)(x), (int)__LINE__, __FILE__); \
|
||||
H5Eprint2(H5E_DEFAULT, stdout); \
|
||||
"in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \
|
||||
H5Eprint2(H5E_DEFAULT, stdout); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
|
@ -1246,11 +1246,8 @@ test_file_freespace(void)
|
||||
/* Check that there is the right amount of free space in the file */
|
||||
free_space = H5Fget_freespace(file);
|
||||
CHECK(free_space, FAIL, "H5Fget_freespace");
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
VERIFY(free_space, 2376, "H5Fget_freespace");
|
||||
#else /* H5_HAVE_LARGE_HSIZET */
|
||||
VERIFY(free_space, 588, "H5Fget_freespace"); /* XXX: fix me */
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
|
||||
/* Delete datasets in file */
|
||||
for(u = 0; u < 10; u++) {
|
||||
sprintf(name, "Dataset %u", u);
|
||||
|
92
test/th5o.c
92
test/th5o.c
@ -378,7 +378,7 @@ test_h5o_refcount(void)
|
||||
{
|
||||
hid_t fid; /* HDF5 File ID */
|
||||
hid_t grp, dset, dtype, dspace; /* Object identifiers */
|
||||
H5G_stat_t sb; /* Statbuffer for H5Gget_objinfo */
|
||||
H5O_info_t oinfo; /* Object info struct */
|
||||
hsize_t dims[RANK];
|
||||
herr_t ret; /* Value returned from API calls */
|
||||
|
||||
@ -410,15 +410,15 @@ test_h5o_refcount(void)
|
||||
CHECK(ret, FAIL, "H5Sclose");
|
||||
|
||||
/* Get ref counts for each object. They should all be 1, since each object has a hard link. */
|
||||
ret = H5Gget_objinfo(fid, "group", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 1, "reference count in H5Gget_objinfo");
|
||||
ret = H5Gget_objinfo(fid, "datatype", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 1, "reference count in H5Gget_objinfo");
|
||||
ret = H5Gget_objinfo(fid, "dataset", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 1, "reference count in H5Gget_objinfo");
|
||||
ret = H5Oget_info(fid, "group", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 1, "reference count in H5Oget_info");
|
||||
ret = H5Oget_info(fid, "datatype", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 1, "reference count in H5Oget_info");
|
||||
ret = H5Oget_info(fid, "dataset", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 1, "reference count in H5Oget_info");
|
||||
|
||||
/* Increment each object's reference count. */
|
||||
ret = H5Oincr_refcount(grp);
|
||||
@ -429,15 +429,15 @@ test_h5o_refcount(void)
|
||||
CHECK(ret, FAIL, "H5Oincr_refcount");
|
||||
|
||||
/* Get ref counts for each object. They should all be 2 now. */
|
||||
ret = H5Gget_objinfo(fid, "group", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 2, "reference count in H5Gget_objinfo");
|
||||
ret = H5Gget_objinfo(fid, "datatype", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 2, "reference count in H5Gget_objinfo");
|
||||
ret = H5Gget_objinfo(fid, "dataset", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 2, "reference count in H5Gget_objinfo");
|
||||
ret = H5Oget_info(fid, "group", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 2, "reference count in H5Oget_info");
|
||||
ret = H5Oget_info(fid, "datatype", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 2, "reference count in H5Oget_info");
|
||||
ret = H5Oget_info(fid, "dataset", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 2, "reference count in H5Oget_info");
|
||||
|
||||
/* Decrement the reference counts and check that they decrease back to 1. */
|
||||
ret = H5Odecr_refcount(grp);
|
||||
@ -447,15 +447,15 @@ test_h5o_refcount(void)
|
||||
ret = H5Odecr_refcount(dset);
|
||||
CHECK(ret, FAIL, "H5Odecr_refcount");
|
||||
|
||||
ret = H5Gget_objinfo(fid, "group", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 1, "reference count in H5Gget_objinfo");
|
||||
ret = H5Gget_objinfo(fid, "datatype", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 1, "reference count in H5Gget_objinfo");
|
||||
ret = H5Gget_objinfo(fid, "dataset", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 1, "reference count in H5Gget_objinfo");
|
||||
ret = H5Oget_info(fid, "group", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 1, "reference count in H5Oget_info");
|
||||
ret = H5Oget_info(fid, "datatype", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 1, "reference count in H5Oget_info");
|
||||
ret = H5Oget_info(fid, "dataset", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 1, "reference count in H5Oget_info");
|
||||
|
||||
/* Increment the reference counts and then close the file to make sure the increment is permanant */
|
||||
ret = H5Oincr_refcount(grp);
|
||||
@ -485,15 +485,15 @@ test_h5o_refcount(void)
|
||||
dset = H5Dopen(fid, "dataset");
|
||||
CHECK(dset, FAIL, "H5Dopen");
|
||||
|
||||
ret = H5Gget_objinfo(fid, "group", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 2, "reference count in H5Gget_objinfo");
|
||||
ret = H5Gget_objinfo(fid, "datatype", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 2, "reference count in H5Gget_objinfo");
|
||||
ret = H5Gget_objinfo(fid, "dataset", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 2, "reference count in H5Gget_objinfo");
|
||||
ret = H5Oget_info(fid, "group", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 2, "reference count in H5Oget_info");
|
||||
ret = H5Oget_info(fid, "datatype", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 2, "reference count in H5Oget_info");
|
||||
ret = H5Oget_info(fid, "dataset", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 2, "reference count in H5Oget_info");
|
||||
|
||||
/* Decrement the reference counts and close the file */
|
||||
ret = H5Odecr_refcount(grp);
|
||||
@ -523,15 +523,15 @@ test_h5o_refcount(void)
|
||||
dset = H5Dopen(fid, "dataset");
|
||||
CHECK(dset, FAIL, "H5Dopen");
|
||||
|
||||
ret = H5Gget_objinfo(fid, "group", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 1, "reference count in H5Gget_objinfo");
|
||||
ret = H5Gget_objinfo(fid, "datatype", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 1, "reference count in H5Gget_objinfo");
|
||||
ret = H5Gget_objinfo(fid, "dataset", FALSE, &sb);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink, 1, "reference count in H5Gget_objinfo");
|
||||
ret = H5Oget_info(fid, "group", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 1, "reference count in H5Oget_info");
|
||||
ret = H5Oget_info(fid, "datatype", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 1, "reference count in H5Oget_info");
|
||||
ret = H5Oget_info(fid, "dataset", &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 1, "reference count in H5Oget_info");
|
||||
|
||||
/* Close the IDs */
|
||||
ret = H5Gclose(grp);
|
||||
|
@ -54,7 +54,7 @@ typedef enum {
|
||||
/* Custom group iteration callback data */
|
||||
typedef struct {
|
||||
char name[NAMELEN]; /* The name of the object */
|
||||
int type; /* The type of the object */
|
||||
H5O_type_t type; /* The type of the object */
|
||||
iter_enum command; /* The type of return value */
|
||||
} iter_info;
|
||||
|
||||
@ -547,7 +547,7 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info_t UNUSED *link_info,
|
||||
void *opdata)
|
||||
{
|
||||
const iter_info *test_info = (const iter_info *)opdata;
|
||||
H5G_stat_t statbuf;
|
||||
H5O_info_t oinfo;
|
||||
herr_t ret; /* Generic return value */
|
||||
|
||||
if(HDstrcmp(name, test_info->name)) {
|
||||
@ -558,11 +558,11 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info_t UNUSED *link_info,
|
||||
/*
|
||||
* Get type of the object and check it.
|
||||
*/
|
||||
ret = H5Gget_objinfo(loc_id, name, FALSE, &statbuf);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
ret = H5Oget_info(loc_id, name, &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
|
||||
if(test_info->type != statbuf.type) {
|
||||
TestErrPrintf("test_info->type = %d, statbuf.type = %d\n", test_info->type, statbuf.type);
|
||||
if(test_info->type != oinfo.type) {
|
||||
TestErrPrintf("test_info->type = %d, oinfo.type = %d\n", test_info->type, (int)oinfo.type);
|
||||
return(H5_ITER_ERROR);
|
||||
} /* end if */
|
||||
|
||||
|
181
test/tmisc.c
181
test/tmisc.c
@ -233,13 +233,8 @@ unsigned m13_rdata[MISC13_DIM1][MISC13_DIM2]; /* Data read from dataset
|
||||
#define MISC20_SPACE_RANK 2
|
||||
/* Make sure the product of the following 2 does not get too close to */
|
||||
/* 64 bits, risking an overflow. */
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
#define MISC20_SPACE_DIM0 (8*1024*1024*(uint64_t)1024)
|
||||
#define MISC20_SPACE_DIM1 ((256*1024*(uint64_t)1024)+1)
|
||||
#else /* H5_HAVE_LARGE_HSIZET */
|
||||
#define MISC20_SPACE_DIM0 (128*(uint64_t)1024)
|
||||
#define MISC20_SPACE_DIM1 ((4*(uint64_t)1024)+1)
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
#define MISC20_SPACE2_DIM0 8
|
||||
#define MISC20_SPACE2_DIM1 4
|
||||
|
||||
@ -610,7 +605,7 @@ test_misc3(void)
|
||||
|
||||
/****************************************************************
|
||||
**
|
||||
** test_misc4(): Test the that 'fileno' field in H5G_stat_t is
|
||||
** test_misc4(): Test the that 'fileno' field in H5O_info_t is
|
||||
** valid.
|
||||
**
|
||||
****************************************************************/
|
||||
@ -618,11 +613,11 @@ static void
|
||||
test_misc4(void)
|
||||
{
|
||||
hid_t file1, file2, group1, group2, group3;
|
||||
H5G_stat_t stat1, stat2, stat3;
|
||||
H5O_info_t oinfo1, oinfo2, oinfo3;
|
||||
herr_t ret;
|
||||
|
||||
/* Output message about test being performed */
|
||||
MESSAGE(5, ("Testing fileno working in H5G_stat_t\n"));
|
||||
MESSAGE(5, ("Testing fileno working in H5O_info_t\n"));
|
||||
|
||||
file1 = H5Fcreate(MISC4_FILE_1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
||||
CHECK(file1, FAIL, "H5Fcreate");
|
||||
@ -643,21 +638,21 @@ test_misc4(void)
|
||||
CHECK(group3, FAIL, "H5Gcreate2");
|
||||
|
||||
/* Get the stat information for each group */
|
||||
ret = H5Gget_objinfo(file1,MISC4_GROUP_1,0,&stat1);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
ret = H5Gget_objinfo(file1,MISC4_GROUP_2,0,&stat2);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
ret = H5Gget_objinfo(file2,MISC4_GROUP_1,0,&stat3);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
ret = H5Oget_info(file1, MISC4_GROUP_1, &oinfo1, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
ret = H5Oget_info(file1, MISC4_GROUP_2, &oinfo2, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
ret = H5Oget_info(file2, MISC4_GROUP_1, &oinfo3, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
|
||||
/* Verify that the fileno values are the same for groups from file1 */
|
||||
VERIFY(stat1.fileno[0],stat2.fileno[0],"H5Gget_objinfo");
|
||||
VERIFY(oinfo1.fileno, oinfo2.fileno, "H5Oget_info");
|
||||
|
||||
/* Verify that the fileno values are not the same between file1 & file2 */
|
||||
if(stat1.fileno[0]==stat3.fileno[0])
|
||||
TestErrPrintf("Error on line %d: stat1.fileno==stat3.fileno\n",__LINE__);
|
||||
if(stat2.fileno[0]==stat3.fileno[0])
|
||||
TestErrPrintf("Error on line %d: stat1.fileno==stat3.fileno\n",__LINE__);
|
||||
if(oinfo1.fileno == oinfo3.fileno)
|
||||
TestErrPrintf("Error on line %d: oinfo1.fileno != oinfo3.fileno\n", __LINE__);
|
||||
if(oinfo2.fileno == oinfo3.fileno)
|
||||
TestErrPrintf("Error on line %d: oinfo2.fileno != oinfo3.fileno\n", __LINE__);
|
||||
|
||||
/* Close the objects */
|
||||
ret = H5Gclose(group1);
|
||||
@ -2832,7 +2827,7 @@ test_misc17(void)
|
||||
|
||||
/****************************************************************
|
||||
**
|
||||
** test_misc18(): Test new object header information in H5G_stat_t
|
||||
** test_misc18(): Test new object header information in H5O_info_t
|
||||
** struct.
|
||||
**
|
||||
****************************************************************/
|
||||
@ -2843,7 +2838,7 @@ test_misc18(void)
|
||||
hid_t sid; /* 'Space ID */
|
||||
hid_t did1, did2; /* Dataset IDs */
|
||||
hid_t aid; /* Attribute ID */
|
||||
H5G_stat_t statbuf; /* Information about object */
|
||||
H5O_info_t oinfo; /* Information about object */
|
||||
char attr_name[32]; /* Attribute name buffer */
|
||||
unsigned u; /* Local index variable */
|
||||
herr_t ret; /* Generic return value */
|
||||
@ -2861,34 +2856,26 @@ test_misc18(void)
|
||||
CHECK(did1, FAIL, "H5Dcreate");
|
||||
|
||||
/* Get object information */
|
||||
ret = H5Gget_objinfo(fid,MISC18_DSET1_NAME,0,&statbuf);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.nmesgs, 6, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.nchunks, 1, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.size, 272, "H5Gget_objinfo");
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
VERIFY(statbuf.ohdr.free, 152, "H5Gget_objinfo");
|
||||
#else /* H5_HAVE_LARGE_HSIZET */
|
||||
VERIFY(statbuf.ohdr.free, 160, "H5Gget_objinfo");
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
VERIFY(statbuf.linklen, 0, "H5Gget_objinfo");
|
||||
ret = H5Oget_info(fid, MISC18_DSET1_NAME, &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.nmesgs, 6, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.nchunks, 1, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.space.total, 272, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.space.free, 152, "H5Oget_info");
|
||||
VERIFY(oinfo.num_attrs, 0, "H5Oget_info");
|
||||
|
||||
/* Create second dataset */
|
||||
did2 = H5Dcreate(fid, MISC18_DSET2_NAME, H5T_STD_U32LE, sid, H5P_DEFAULT);
|
||||
CHECK(did2, FAIL, "H5Screate_simple");
|
||||
|
||||
/* Get object information */
|
||||
ret = H5Gget_objinfo(fid,MISC18_DSET2_NAME,0,&statbuf);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.nmesgs, 6, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.nchunks, 1, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.size, 272, "H5Gget_objinfo");
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
VERIFY(statbuf.ohdr.free, 152, "H5Gget_objinfo");
|
||||
#else /* H5_HAVE_LARGE_HSIZET */
|
||||
VERIFY(statbuf.ohdr.free, 160, "H5Gget_objinfo");
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
VERIFY(statbuf.linklen, 0, "H5Gget_objinfo");
|
||||
ret = H5Oget_info(fid, MISC18_DSET2_NAME, &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.nmesgs, 6, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.nchunks, 1, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.space.total, 272, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.space.free, 152, "H5Oget_info");
|
||||
VERIFY(oinfo.num_attrs, 0, "H5Oget_info");
|
||||
|
||||
/* Loop creating attributes on each dataset, flushing them to the file each time */
|
||||
for(u=0; u<10; u++) {
|
||||
@ -2897,14 +2884,14 @@ test_misc18(void)
|
||||
|
||||
/* Create & close attribute on first dataset */
|
||||
aid = H5Acreate(did1, attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT);
|
||||
CHECK(aid, FAIL, "H5Gget_objinfo");
|
||||
CHECK(aid, FAIL, "H5Acreate");
|
||||
|
||||
ret = H5Aclose(aid);
|
||||
CHECK(ret, FAIL, "HAclose");
|
||||
|
||||
/* Create & close attribute on second dataset */
|
||||
aid = H5Acreate(did2, attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT);
|
||||
CHECK(aid, FAIL, "H5Gget_objinfo");
|
||||
CHECK(aid, FAIL, "H5Acreate");
|
||||
|
||||
ret = H5Aclose(aid);
|
||||
CHECK(ret, FAIL, "HAclose");
|
||||
@ -2915,36 +2902,22 @@ test_misc18(void)
|
||||
} /* end for */
|
||||
|
||||
/* Get object information for dataset #1 now */
|
||||
ret = H5Gget_objinfo(fid,MISC18_DSET1_NAME,0,&statbuf);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
VERIFY(statbuf.ohdr.nmesgs, 24, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.nchunks, 9, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.size, 888, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.free, 16, "H5Gget_objinfo");
|
||||
#else /* H5_HAVE_LARGE_HSIZET */
|
||||
VERIFY(statbuf.ohdr.nmesgs, 26, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.nchunks, 9, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.size, 888, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.free, 24, "H5Gget_objinfo");
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
VERIFY(statbuf.linklen, 0, "H5Gget_objinfo");
|
||||
ret = H5Oget_info(fid, MISC18_DSET1_NAME, &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.nmesgs, 24, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.nchunks, 9, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.space.total, 888, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.space.free, 16, "H5Oget_info");
|
||||
VERIFY(oinfo.num_attrs, 10, "H5Oget_info");
|
||||
|
||||
/* Get object information for dataset #2 now */
|
||||
ret = H5Gget_objinfo(fid,MISC18_DSET2_NAME,0,&statbuf);
|
||||
CHECK(ret, FAIL, "H5Gget_objinfo");
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
VERIFY(statbuf.ohdr.nmesgs, 24, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.nchunks, 9, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.size, 888, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.free, 16, "H5Gget_objinfo");
|
||||
#else /* H5_HAVE_LARGE_HSIZET */
|
||||
VERIFY(statbuf.ohdr.nmesgs, 26, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.nchunks, 9, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.size, 888, "H5Gget_objinfo");
|
||||
VERIFY(statbuf.ohdr.free, 24, "H5Gget_objinfo");
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
VERIFY(statbuf.linklen, 0, "H5Gget_objinfo");
|
||||
ret = H5Oget_info(fid, MISC18_DSET2_NAME, &oinfo, H5P_DEFAULT);
|
||||
CHECK(ret, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.nmesgs, 24, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.nchunks, 9, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.space.total, 888, "H5Oget_info");
|
||||
VERIFY(oinfo.hdr.space.free, 16, "H5Oget_info");
|
||||
VERIFY(oinfo.num_attrs, 10, "H5Oget_info");
|
||||
|
||||
/* Close second dataset */
|
||||
ret = H5Dclose(did2);
|
||||
@ -3426,10 +3399,8 @@ test_misc20(void)
|
||||
CHECK(dcpl, FAIL, "H5Pcreate");
|
||||
|
||||
/* Try to use chunked storage for this dataset */
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
ret = H5Pset_chunk(dcpl,rank,big_dims);
|
||||
ret = H5Pset_chunk(dcpl, rank, big_dims);
|
||||
VERIFY(ret, FAIL, "H5Pset_chunk");
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
|
||||
/* Verify that the storage for the dataset is the correct size and hasn't
|
||||
* been truncated.
|
||||
@ -3440,11 +3411,11 @@ test_misc20(void)
|
||||
CHECK(fid, FAIL, "H5Fcreate");
|
||||
|
||||
/* Create dataspace with _really_ big dimensions */
|
||||
sid = H5Screate_simple(rank,big_dims,NULL);
|
||||
sid = H5Screate_simple(rank, big_dims, NULL);
|
||||
CHECK(sid, FAIL, "H5Screate_simple");
|
||||
|
||||
/* Make certain that the dataset's storage doesn't get allocated :-) */
|
||||
ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE);
|
||||
ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE);
|
||||
CHECK(ret, FAIL, "H5Pset_alloc_time");
|
||||
|
||||
/* Create dataset with big dataspace */
|
||||
@ -3452,15 +3423,15 @@ test_misc20(void)
|
||||
CHECK(did, FAIL, "H5Dcreate");
|
||||
|
||||
/* Close datasset */
|
||||
ret=H5Dclose(did);
|
||||
ret = H5Dclose(did);
|
||||
CHECK(ret, FAIL, "H5Dclose");
|
||||
|
||||
/* Close dataspace */
|
||||
ret=H5Sclose(sid);
|
||||
ret = H5Sclose(sid);
|
||||
CHECK(ret, FAIL, "H5Sclose");
|
||||
|
||||
/* Create dataspace with small dimensions */
|
||||
sid = H5Screate_simple(rank,small_dims,NULL);
|
||||
sid = H5Screate_simple(rank, small_dims, NULL);
|
||||
CHECK(sid, FAIL, "H5Screate_simple");
|
||||
|
||||
/* Create dataset with big dataspace */
|
||||
@ -3468,15 +3439,15 @@ test_misc20(void)
|
||||
CHECK(did, FAIL, "H5Dcreate");
|
||||
|
||||
/* Close datasset */
|
||||
ret=H5Dclose(did);
|
||||
ret = H5Dclose(did);
|
||||
CHECK(ret, FAIL, "H5Dclose");
|
||||
|
||||
/* Close dataspace */
|
||||
ret=H5Sclose(sid);
|
||||
ret = H5Sclose(sid);
|
||||
CHECK(ret, FAIL, "H5Sclose");
|
||||
|
||||
/* Close dataset creation property list */
|
||||
ret=H5Pclose(dcpl);
|
||||
ret = H5Pclose(dcpl);
|
||||
CHECK(ret, FAIL, "H5Pclose");
|
||||
|
||||
/* Close file */
|
||||
@ -3494,15 +3465,15 @@ test_misc20(void)
|
||||
/* Get the layout version */
|
||||
ret = H5D_layout_version_test(did,&version);
|
||||
CHECK(ret, FAIL, "H5D_layout_version_test");
|
||||
VERIFY(version,3,"H5D_layout_version_test");
|
||||
VERIFY(version, 3, "H5D_layout_version_test");
|
||||
|
||||
/* Get the layout contiguous storage size */
|
||||
ret = H5D_layout_contig_size_test(did,&contig_size);
|
||||
CHECK(ret, FAIL, "H5D_layout_contig_size_test");
|
||||
VERIFY(contig_size, MISC20_SPACE_DIM0*MISC20_SPACE_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5D_layout_contig_size_test");
|
||||
VERIFY(contig_size, (MISC20_SPACE_DIM0 * MISC20_SPACE_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5D_layout_contig_size_test");
|
||||
|
||||
/* Close datasset */
|
||||
ret=H5Dclose(did);
|
||||
ret = H5Dclose(did);
|
||||
CHECK(ret, FAIL, "H5Dclose");
|
||||
|
||||
/* Open dataset with small dimensions */
|
||||
@ -3512,15 +3483,15 @@ test_misc20(void)
|
||||
/* Get the layout version */
|
||||
ret = H5D_layout_version_test(did,&version);
|
||||
CHECK(ret, FAIL, "H5D_layout_version_test");
|
||||
VERIFY(version,3,"H5D_layout_version_test");
|
||||
VERIFY(version, 3, "H5D_layout_version_test");
|
||||
|
||||
/* Get the layout contiguous storage size */
|
||||
ret = H5D_layout_contig_size_test(did,&contig_size);
|
||||
CHECK(ret, FAIL, "H5D_layout_contig_size_test");
|
||||
VERIFY(contig_size, MISC20_SPACE2_DIM0*MISC20_SPACE2_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5D_layout_contig_size_test");
|
||||
VERIFY(contig_size, (MISC20_SPACE2_DIM0 * MISC20_SPACE2_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5D_layout_contig_size_test");
|
||||
|
||||
/* Close datasset */
|
||||
ret=H5Dclose(did);
|
||||
ret = H5Dclose(did);
|
||||
CHECK(ret, FAIL, "H5Dclose");
|
||||
|
||||
/* Close file */
|
||||
@ -3530,7 +3501,7 @@ test_misc20(void)
|
||||
/* Verify that the storage size is computed correctly for older versions of layout info */
|
||||
|
||||
/* Generate the correct name for the test file, by prepending the source path */
|
||||
if (srcdir && ((HDstrlen(srcdir) + HDstrlen(MISC20_FILE_OLD) + 1) < sizeof(testfile))) {
|
||||
if(srcdir && ((HDstrlen(srcdir) + HDstrlen(MISC20_FILE_OLD) + 1) < sizeof(testfile))) {
|
||||
HDstrcpy(testfile, srcdir);
|
||||
HDstrcat(testfile, "/");
|
||||
}
|
||||
@ -3539,30 +3510,26 @@ test_misc20(void)
|
||||
/*
|
||||
* Open the old file and the dataset and get old settings.
|
||||
*/
|
||||
fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
CHECK(fid, FAIL, "H5Fopen");
|
||||
|
||||
/* Open dataset with small dimensions */
|
||||
did = H5Dopen(fid, MISC20_DSET_NAME);
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
CHECK(did, FAIL, "H5Dopen");
|
||||
|
||||
/* Get the layout version */
|
||||
ret = H5D_layout_version_test(did,&version);
|
||||
CHECK(ret, FAIL, "H5D_layout_version_test");
|
||||
VERIFY(version,2,"H5D_layout_version_test");
|
||||
VERIFY(version, 2, "H5D_layout_version_test");
|
||||
|
||||
/* Get the layout contiguous storage size */
|
||||
ret = H5D_layout_contig_size_test(did,&contig_size);
|
||||
CHECK(ret, FAIL, "H5D_layout_contig_size_test");
|
||||
VERIFY(contig_size, MISC20_SPACE_DIM0*MISC20_SPACE_DIM1*H5Tget_size(H5T_STD_I32LE), "H5D_layout_contig_size_test");
|
||||
VERIFY(contig_size, (MISC20_SPACE_DIM0 * MISC20_SPACE_DIM1 * H5Tget_size(H5T_STD_I32LE)), "H5D_layout_contig_size_test");
|
||||
|
||||
/* Close datasset */
|
||||
ret=H5Dclose(did);
|
||||
ret = H5Dclose(did);
|
||||
CHECK(ret, FAIL, "H5Dclose");
|
||||
#else /* H5_HAVE_LARGE_HSIZET */
|
||||
VERIFY(did, FAIL, "H5Dopen");
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
|
||||
/* Close file */
|
||||
ret = H5Fclose(fid);
|
||||
@ -3797,12 +3764,12 @@ test_misc22(void)
|
||||
static void
|
||||
test_misc23(void)
|
||||
{
|
||||
herr_t status;
|
||||
hsize_t dims[] = {10};
|
||||
hid_t file_id=0, group_id=0, type_id=0, space_id=0,
|
||||
tmp_id=0, create_id=H5P_DEFAULT, access_id=H5P_DEFAULT;
|
||||
char objname[MISC23_NAME_BUF_SIZE]; /* Name of object */
|
||||
H5G_stat_t sb;
|
||||
H5O_info_t oinfo;
|
||||
herr_t status;
|
||||
|
||||
/* Output message about test being performed */
|
||||
MESSAGE(5, ("Testing intermediate group creation\n"));
|
||||
@ -3869,7 +3836,7 @@ test_misc23(void)
|
||||
CHECK(tmp_id, FAIL, "H5Gcreate2");
|
||||
|
||||
/* Query that the name of the new group is correct */
|
||||
status = H5Iget_name( tmp_id, objname, (size_t)MISC23_NAME_BUF_SIZE );
|
||||
status = H5Iget_name(tmp_id, objname, (size_t)MISC23_NAME_BUF_SIZE);
|
||||
CHECK(status, FAIL, "H5Iget_name");
|
||||
VERIFY_STR(objname, "/A/B01/grp", "H5Iget_name");
|
||||
|
||||
@ -3880,9 +3847,9 @@ test_misc23(void)
|
||||
tmp_id = H5Gopen2(file_id, "/A/B01", H5P_DEFAULT);
|
||||
CHECK(tmp_id, FAIL, "H5Gopen2");
|
||||
|
||||
status = H5Gget_objinfo(tmp_id, ".", FALSE, &sb);
|
||||
CHECK(status, FAIL, "H5Gget_objinfo");
|
||||
VERIFY(sb.nlink,1,"H5Gget_objinfo");
|
||||
status = H5Oget_info(tmp_id, ".", &oinfo, H5P_DEFAULT);
|
||||
CHECK(status, FAIL, "H5Oget_info");
|
||||
VERIFY(oinfo.rc, 1, "H5Oget_info");
|
||||
|
||||
status = H5Gclose(tmp_id);
|
||||
CHECK(status, FAIL, "H5Gclose");
|
||||
@ -4841,7 +4808,7 @@ test_misc(void)
|
||||
test_misc1(); /* Test unlinking a dataset & immediately re-using name */
|
||||
test_misc2(); /* Test storing a VL-derived datatype in two different files */
|
||||
test_misc3(); /* Test reading from chunked dataset with non-zero fill value */
|
||||
test_misc4(); /* Test retrieving the fileno for various objects with H5Gget_objinfo() */
|
||||
test_misc4(); /* Test retrieving the fileno for various objects with H5Oget_info() */
|
||||
test_misc5(); /* Test several level deep nested compound & VL datatypes */
|
||||
test_misc6(); /* Test object header continuation code */
|
||||
test_misc7(); /* Test for sensible datatypes stored on disk */
|
||||
@ -4855,7 +4822,7 @@ test_misc(void)
|
||||
test_misc15(); /* Test that checking a file's access property list more than once works */
|
||||
test_misc16(); /* Test array of fixed-length string */
|
||||
test_misc17(); /* Test array of ASCII character */
|
||||
test_misc18(); /* Test new object header information in H5G_stat_t struct */
|
||||
test_misc18(); /* Test new object header information in H5O_info_t struct */
|
||||
test_misc19(); /* Test incrementing & decrementing ref count on IDs */
|
||||
test_misc20(); /* Test problems with truncated dimensions in version 2 of storage layout message */
|
||||
#if defined H5_HAVE_FILTER_SZIP
|
||||
|
24
test/tsohm.c
24
test/tsohm.c
@ -735,7 +735,7 @@ static void test_sohm_size1(void)
|
||||
h5_stat_size_t norm_final_filesize2;
|
||||
h5_stat_size_t sohm_final_filesize2;
|
||||
h5_stat_size_t sohm_btree_final_filesize2;
|
||||
H5G_stat_t statbuf;
|
||||
H5O_info_t oinfo;
|
||||
unsigned num_indexes = 1;
|
||||
unsigned index_flags = H5O_MESG_DTYPE_FLAG;
|
||||
unsigned min_mesg_size = 50;
|
||||
@ -776,11 +776,11 @@ static void test_sohm_size1(void)
|
||||
CHECK_I(file, "size1_helper");
|
||||
|
||||
/* Get the size of a dataset object header */
|
||||
ret = H5Gget_objinfo(file, DSETNAME[0], 0, &statbuf);
|
||||
CHECK_I(ret, "H5Gget_objinfo");
|
||||
ret = H5Oget_info(file, DSETNAME[0], &oinfo, H5P_DEFAULT);
|
||||
CHECK_I(ret, "H5Oget_info");
|
||||
ret = H5Fclose(file);
|
||||
CHECK_I(ret, "H5Fclose");
|
||||
norm_oh_size = statbuf.ohdr.size;
|
||||
norm_oh_size = oinfo.hdr.space.total;
|
||||
|
||||
/* Get the new file size */
|
||||
norm_final_filesize = h5_get_file_size(FILENAME);
|
||||
@ -832,11 +832,11 @@ static void test_sohm_size1(void)
|
||||
CHECK_I(file, "size1_helper");
|
||||
|
||||
/* Get the size of a dataset object header */
|
||||
ret = H5Gget_objinfo(file, DSETNAME[0], 0, &statbuf);
|
||||
CHECK_I(ret, "H5Gget_objinfo");
|
||||
ret = H5Oget_info(file, DSETNAME[0], &oinfo, H5P_DEFAULT);
|
||||
CHECK_I(ret, "H5Oget_info");
|
||||
ret = H5Fclose(file);
|
||||
CHECK_I(ret, "H5Fclose");
|
||||
sohm_oh_size = statbuf.ohdr.size;
|
||||
sohm_oh_size = oinfo.hdr.space.total;
|
||||
|
||||
/* Get the new file size */
|
||||
sohm_final_filesize = h5_get_file_size(FILENAME);
|
||||
@ -887,11 +887,11 @@ static void test_sohm_size1(void)
|
||||
CHECK_I(file, "size1_helper");
|
||||
|
||||
/* Get the size of a dataset object header */
|
||||
ret = H5Gget_objinfo(file, DSETNAME[0], 0, &statbuf);
|
||||
CHECK_I(ret, "H5Gget_objinfo");
|
||||
ret = H5Oget_info(file, DSETNAME[0], &oinfo, H5P_DEFAULT);
|
||||
CHECK_I(ret, "H5Oget_info");
|
||||
ret = H5Fclose(file);
|
||||
CHECK_I(ret, "H5Fclose");
|
||||
sohm_btree_oh_size = statbuf.ohdr.size;
|
||||
sohm_btree_oh_size = oinfo.hdr.space.total;
|
||||
|
||||
/* Get the new file size */
|
||||
sohm_btree_final_filesize = h5_get_file_size(FILENAME);
|
||||
@ -924,10 +924,10 @@ static void test_sohm_size1(void)
|
||||
* continuation message and a NULL message.
|
||||
|
||||
if(sohm_oh_size >= norm_oh_size)
|
||||
VERIFY(sohm_oh_size, 1, "H5Gget_objinfo");
|
||||
VERIFY(sohm_oh_size, 1, "H5Oget_info");
|
||||
*/
|
||||
if(sohm_oh_size != sohm_btree_oh_size)
|
||||
VERIFY(sohm_btree_oh_size, 1, "H5Gget_objinfo");
|
||||
VERIFY(sohm_btree_oh_size, 1, "H5Oget_info");
|
||||
|
||||
/* Both sohm files should be bigger than a normal file when empty.
|
||||
* It's hard to say whether a B-tree with no nodes allocated should be
|
||||
|
@ -439,7 +439,7 @@ static int
|
||||
check_new_move(hid_t fapl)
|
||||
{
|
||||
hid_t file;
|
||||
H5G_stat_t sb_hard1, sb_hard2;
|
||||
H5O_info_t oi_hard1, oi_hard2;
|
||||
char filename[1024];
|
||||
char linkval[1024];
|
||||
|
||||
@ -447,20 +447,24 @@ check_new_move(hid_t fapl)
|
||||
|
||||
/* Open file */
|
||||
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
|
||||
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR
|
||||
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Get hard link info */
|
||||
if(H5Gget_objinfo(file, "/group2/group_new_name", TRUE, &sb_hard1) < 0) FAIL_STACK_ERROR
|
||||
if(H5Gget_objinfo(file, "/group1/hard", TRUE, &sb_hard2) < 0) FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file, "/group2/group_new_name", &oi_hard1, H5P_DEFAULT) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
if(H5Oget_info(file, "/group1/hard", &oi_hard2, H5P_DEFAULT) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
|
||||
/* Check hard links */
|
||||
if(H5G_GROUP != sb_hard1.type || H5G_GROUP != sb_hard2.type)
|
||||
if(H5O_TYPE_GROUP != oi_hard1.type || H5O_TYPE_GROUP != oi_hard2.type)
|
||||
FAIL_PUTS_ERROR(" Unexpected object type, should have been a group")
|
||||
if(HDmemcmp(&sb_hard1.objno, &sb_hard2.objno, sizeof(sb_hard1.objno)))
|
||||
if(H5F_addr_ne(oi_hard1.addr, oi_hard2.addr))
|
||||
FAIL_PUTS_ERROR(" Hard link test failed. Link seems not to point to the expected file location.")
|
||||
|
||||
/* Check soft links */
|
||||
if(H5Lget_val(file, "group2/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(H5Lget_val(file, "group2/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0)
|
||||
FAIL_STACK_ERROR
|
||||
if(HDstrcmp(linkval, "/group1/group_move"))
|
||||
FAIL_PUTS_ERROR(" Soft link test failed. Wrong link value")
|
||||
|
||||
@ -2128,7 +2132,7 @@ test_full_group_compact(hid_t fapl)
|
||||
{
|
||||
hid_t file_id = -1;
|
||||
hid_t gid = -1, gid2 = -1; /* Group IDs */
|
||||
H5G_stat_t sb; /* Stat buffer for object */
|
||||
H5O_info_t oi; /* Stat buffer for object */
|
||||
char objname[128]; /* Buffer for name of objects to create */
|
||||
char objname2[128]; /* Buffer for name of objects to create */
|
||||
char filename[1024]; /* Buffer for filename */
|
||||
@ -2200,8 +2204,8 @@ test_full_group_compact(hid_t fapl)
|
||||
/* Check reference count on objects to keep */
|
||||
for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) {
|
||||
sprintf(objname, "/keep/keep %u\n", u);
|
||||
if(H5Gget_objinfo(file_id, objname, TRUE, &sb) < 0) FAIL_STACK_ERROR
|
||||
if(sb.nlink != 2) TEST_ERROR
|
||||
if(H5Oget_info(file_id, objname, &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(oi.rc != 2) TEST_ERROR
|
||||
} /* end for */
|
||||
|
||||
/* Close the file */
|
||||
@ -2217,8 +2221,8 @@ test_full_group_compact(hid_t fapl)
|
||||
/* Check reference count on objects to keep */
|
||||
for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) {
|
||||
sprintf(objname, "/keep/keep %u\n", u);
|
||||
if(H5Gget_objinfo(file_id, objname, TRUE, &sb) < 0) FAIL_STACK_ERROR
|
||||
if(sb.nlink != 1) TEST_ERROR
|
||||
if(H5Oget_info(file_id, objname, &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(oi.rc != 1) TEST_ERROR
|
||||
} /* end for */
|
||||
|
||||
/* Close the file */
|
||||
@ -2262,7 +2266,7 @@ test_full_group_dense(hid_t fapl)
|
||||
hid_t file_id = -1;
|
||||
hid_t gcpl = (-1); /* Group creation property list ID */
|
||||
hid_t gid = -1, gid2 = -1; /* Group IDs */
|
||||
H5G_stat_t sb; /* Stat buffer for object */
|
||||
H5O_info_t oi; /* Stat buffer for object */
|
||||
char objname[128]; /* Buffer for name of objects to create */
|
||||
char objname2[128]; /* Buffer for name of objects to create */
|
||||
char filename[1024]; /* Buffer for filename */
|
||||
@ -2346,8 +2350,8 @@ test_full_group_dense(hid_t fapl)
|
||||
/* Check reference count on objects to keep */
|
||||
for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) {
|
||||
sprintf(objname, "/keep/keep %u\n", u);
|
||||
if(H5Gget_objinfo(file_id, objname, TRUE, &sb) < 0) FAIL_STACK_ERROR
|
||||
if(sb.nlink != 2) TEST_ERROR
|
||||
if(H5Oget_info(file_id, objname, &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(oi.rc != 2) TEST_ERROR
|
||||
} /* end for */
|
||||
|
||||
/* Close the file */
|
||||
@ -2363,8 +2367,8 @@ test_full_group_dense(hid_t fapl)
|
||||
/* Check reference count on objects to keep */
|
||||
for(u = 0; u < FULL_GROUP_NUM_KEEP; u++) {
|
||||
sprintf(objname, "/keep/keep %u\n", u);
|
||||
if(H5Gget_objinfo(file_id, objname, TRUE, &sb) < 0) FAIL_STACK_ERROR
|
||||
if(sb.nlink != 1) TEST_ERROR
|
||||
if(H5Oget_info(file_id, objname, &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
|
||||
if(oi.rc != 1) TEST_ERROR
|
||||
} /* end for */
|
||||
|
||||
/* Close the file */
|
||||
|
@ -1017,10 +1017,8 @@ test_multi(void)
|
||||
/* Before any data is written, the raw data file is empty. So
|
||||
* the file size is only the size of b-tree + HADDR_MAX/4.
|
||||
*/
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
if(file_size < HADDR_MAX/4 || file_size > HADDR_MAX/2)
|
||||
TEST_ERROR;
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
|
||||
if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT))<0)
|
||||
TEST_ERROR;
|
||||
@ -1055,10 +1053,8 @@ test_multi(void)
|
||||
* beginning of raw data file is set at HADDR_MAX/2. It's supposed
|
||||
* to be (HADDR_MAX/2 + 128*128*4)
|
||||
*/
|
||||
#ifdef H5_HAVE_LARGE_HSIZET
|
||||
if(file_size < HADDR_MAX/2 || file_size > HADDR_MAX)
|
||||
TEST_ERROR;
|
||||
#endif /* H5_HAVE_LARGE_HSIZET */
|
||||
|
||||
if(H5Sclose(space)<0)
|
||||
TEST_ERROR;
|
||||
|
@ -65,29 +65,29 @@
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
int ret;
|
||||
const char *fname1 = NULL;
|
||||
const char *fname2 = NULL;
|
||||
const char *objname1 = NULL;
|
||||
const char *objname2 = NULL;
|
||||
hsize_t nfound=0;
|
||||
diff_opt_t options;
|
||||
int ret;
|
||||
const char *fname1 = NULL;
|
||||
const char *fname2 = NULL;
|
||||
const char *objname1 = NULL;
|
||||
const char *objname2 = NULL;
|
||||
hsize_t nfound=0;
|
||||
diff_opt_t options;
|
||||
|
||||
parse_input(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
|
||||
parse_input(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
|
||||
|
||||
nfound = h5diff(fname1,fname2,objname1,objname2,&options);
|
||||
nfound = h5diff(fname1,fname2,objname1,objname2,&options);
|
||||
|
||||
print_info(&options);
|
||||
print_info(&options);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* exit code
|
||||
* >0 if differences, 0 if no differences, <0 if error
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
/*-------------------------------------------------------------------------
|
||||
* exit code
|
||||
* >0 if differences, 0 if no differences, <0 if error
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
ret= (nfound==0 ? 0 : 1 );
|
||||
if (options.err_stat)
|
||||
ret=-1;
|
||||
return ret;
|
||||
ret = (nfound == 0 ? 0 : 1 );
|
||||
if(options.err_stat)
|
||||
ret = -1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -72,40 +72,40 @@ int main(int argc, const char *argv[])
|
||||
|
||||
if(g_nTasks == 1)
|
||||
{
|
||||
printf("Only 1 task available...doing serial diff\n");
|
||||
printf("Only 1 task available...doing serial diff\n");
|
||||
|
||||
g_Parallel = 0;
|
||||
g_Parallel = 0;
|
||||
|
||||
parse_input(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
|
||||
parse_input(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
|
||||
|
||||
nfound = h5diff(fname1,fname2,objname1,objname2,&options);
|
||||
nfound = h5diff(fname1, fname2, objname1, objname2, &options);
|
||||
|
||||
print_info(&options);
|
||||
print_info(&options);
|
||||
|
||||
MPI_Finalize();
|
||||
MPI_Finalize();
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Have the manager process the command-line */
|
||||
if(nID == 0)
|
||||
{
|
||||
parse_input(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
|
||||
parse_input(argc, argv, &fname1, &fname2, &objname1, &objname2, &options);
|
||||
|
||||
nfound = h5diff(fname1,fname2,objname1,objname2,&options);
|
||||
nfound = h5diff(fname1, fname2, objname1, objname2, &options);
|
||||
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
|
||||
print_info(&options);
|
||||
print_manager_output();
|
||||
print_info(&options);
|
||||
print_manager_output();
|
||||
|
||||
MPI_Finalize();
|
||||
MPI_Finalize();
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
/* All other tasks become workers and wait for assignments. */
|
||||
else
|
||||
ph5diff_worker(nID);
|
||||
ph5diff_worker(nID);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -66,17 +66,17 @@ static struct dispatch_t {
|
||||
herr_t (*close)(hid_t obj);
|
||||
herr_t (*list1)(hid_t obj);
|
||||
herr_t (*list2)(hid_t obj, const char *name);
|
||||
} dispatch_g[H5G_NLIBTYPES];
|
||||
} dispatch_g[H5O_TYPE_NTYPES];
|
||||
|
||||
#define DISPATCH(TYPE,NAME,OPEN,CLOSE,LIST1,LIST2) { \
|
||||
dispatch_g[TYPE].name = (NAME); \
|
||||
dispatch_g[TYPE].open = (OPEN); \
|
||||
#define DISPATCH(TYPE, NAME, OPEN, CLOSE, LIST1, LIST2) { \
|
||||
dispatch_g[TYPE].name = (NAME); \
|
||||
dispatch_g[TYPE].open = (OPEN); \
|
||||
dispatch_g[TYPE].close = (CLOSE); \
|
||||
dispatch_g[TYPE].list1 = (LIST1); \
|
||||
dispatch_g[TYPE].list2 = (LIST2); \
|
||||
}
|
||||
|
||||
static herr_t list (hid_t group, const char *name, const H5L_info_t *linfo, void *cd);
|
||||
static herr_t list(hid_t group, const char *name, const H5L_info_t *linfo, void *cd);
|
||||
static void display_type(hid_t type, int ind);
|
||||
static char *fix_name(const char *path, const char *base);
|
||||
|
||||
@ -145,30 +145,24 @@ usage: %s [OPTIONS] [OBJECTS...]\n\
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void
|
||||
sym_insert(H5G_stat_t *sb, const char *name)
|
||||
sym_insert(const H5O_info_t *oi, const char *name)
|
||||
{
|
||||
haddr_t objno; /* Compact form of object's location */
|
||||
int n;
|
||||
|
||||
/* Don't add it if the link count is 1 because such an object can only
|
||||
* have one name. */
|
||||
if (sb->nlink<2) return;
|
||||
if(oi->rc < 2)
|
||||
return;
|
||||
|
||||
/* Extend the table */
|
||||
if (idtab_g.nobjs>=idtab_g.nalloc) {
|
||||
if(idtab_g.nobjs >= idtab_g.nalloc) {
|
||||
idtab_g.nalloc = MAX(256, 2*idtab_g.nalloc);
|
||||
idtab_g.obj = realloc(idtab_g.obj,
|
||||
idtab_g.nalloc*sizeof(idtab_g.obj[0]));
|
||||
}
|
||||
idtab_g.obj = realloc(idtab_g.obj, idtab_g.nalloc*sizeof(idtab_g.obj[0]));
|
||||
} /* end if */
|
||||
|
||||
/* Insert the entry */
|
||||
n = idtab_g.nobjs++;
|
||||
#if H5_SIZEOF_UINT64_T > H5_SIZEOF_LONG
|
||||
objno = (haddr_t)sb->objno[0] | ((haddr_t)sb->objno[1] << (8 * sizeof(long)));
|
||||
#else
|
||||
objno = (haddr_t)sb->objno[0];
|
||||
#endif
|
||||
idtab_g.obj[n].id = objno;
|
||||
idtab_g.obj[n].id = oi->addr;
|
||||
idtab_g.obj[n].name = HDstrdup(name);
|
||||
}
|
||||
|
||||
@ -190,17 +184,18 @@ sym_insert(H5G_stat_t *sb, const char *name)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static char *
|
||||
sym_lookup(H5G_stat_t *sb)
|
||||
sym_lookup(const H5O_info_t *oi)
|
||||
{
|
||||
haddr_t objno; /* Compact form of object's location */
|
||||
int n;
|
||||
|
||||
if (sb->nlink<2) return NULL; /*only one name possible*/
|
||||
objno = (haddr_t)sb->objno[0] | ((haddr_t)sb->objno[1] << (8 * sizeof(long)));
|
||||
for (n=0; n<idtab_g.nobjs; n++) {
|
||||
if(idtab_g.obj[n].id == objno)
|
||||
/*only one name possible*/
|
||||
if(oi->rc < 2)
|
||||
return NULL;
|
||||
|
||||
for(n = 0; n < idtab_g.nobjs; n++)
|
||||
if(idtab_g.obj[n].id == oi->addr)
|
||||
return idtab_g.obj[n].name;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1173,21 +1168,18 @@ display_type(hid_t type, int ind)
|
||||
}
|
||||
|
||||
/* Shared? If so then print the type's OID */
|
||||
if (H5Tcommitted(type)) {
|
||||
H5G_stat_t sb;
|
||||
if(H5Tcommitted(type)) {
|
||||
H5O_info_t oi;
|
||||
|
||||
if (H5Gget_objinfo(type, ".", FALSE, &sb)>=0) {
|
||||
haddr_t objno; /* Compact form of object's location */
|
||||
|
||||
objno = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
if(H5Oget_info(type, ".", &oi, H5P_DEFAULT) >= 0)
|
||||
printf("shared-%lu:"H5_PRINTF_HADDR_FMT" ",
|
||||
sb.fileno[0], objno);
|
||||
} else
|
||||
oi.fileno, oi.addr);
|
||||
else
|
||||
printf("shared ");
|
||||
}
|
||||
} /* end if */
|
||||
|
||||
/* Print the type */
|
||||
if ((!simple_output_g && display_native_type(type, ind)) ||
|
||||
if((!simple_output_g && display_native_type(type, ind)) ||
|
||||
display_ieee_type(type, ind) ||
|
||||
display_int_type(type, ind) ||
|
||||
display_float_type(type, ind) ||
|
||||
@ -1707,108 +1699,6 @@ datatype_list2(hid_t type, const char UNUSED *name)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: slink_open
|
||||
*
|
||||
* Purpose: This gets called to open a symbolic link. Since symbolic
|
||||
* links don't correspond to actual objects we simply print the
|
||||
* link information and return failure.
|
||||
*
|
||||
* Return: Success: 0 - an invalid object but successful return
|
||||
* of this function.
|
||||
*
|
||||
* Failure: -1
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, August 27, 1998
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static hid_t
|
||||
slink_open(hid_t location, const char *name, hid_t UNUSED apl_id)
|
||||
{
|
||||
H5G_stat_t statbuf;
|
||||
|
||||
if(H5Gget_objinfo(location, name, FALSE, &statbuf) < 0)
|
||||
return -1;
|
||||
|
||||
if(statbuf.type == H5G_LINK) { /* Soft link */
|
||||
char *buf = HDmalloc(statbuf.linklen);
|
||||
|
||||
if(H5Lget_val(location, name, buf, statbuf.linklen, H5P_DEFAULT) < 0) {
|
||||
HDfree(buf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
HDfputs(buf, stdout);
|
||||
HDfree(buf);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: udlink_open
|
||||
*
|
||||
* Purpose: This gets called to open a user-defined link. Since these
|
||||
* links don't correspond to actual objects we simply print a message
|
||||
* and return failure.
|
||||
*
|
||||
* Return: Success: 0 - an invalid object but successful return
|
||||
* of this function.
|
||||
*
|
||||
* Failure: -1
|
||||
*
|
||||
* Programmer: James Laird
|
||||
* Tuesday, June 6, 2006
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static hid_t
|
||||
udlink_open(hid_t location, const char *name, hid_t UNUSED apl_id)
|
||||
{
|
||||
H5L_info_t linfo;
|
||||
char * buf = NULL;
|
||||
const char * filename;
|
||||
const char * path;
|
||||
|
||||
if(H5Lget_info(location, name, &linfo, H5P_DEFAULT) < 0)
|
||||
return -1;
|
||||
|
||||
switch(linfo.type) {
|
||||
/* For external links, try to display info for the object it points to */
|
||||
case H5L_TYPE_EXTERNAL:
|
||||
if((buf = HDmalloc(linfo.u.val_size)) == NULL)
|
||||
goto error;
|
||||
if(H5Lget_val(location, name, buf, linfo.u.val_size, H5P_DEFAULT) < 0)
|
||||
goto error;
|
||||
|
||||
if(H5Lunpack_elink_val(buf, linfo.u.val_size, NULL, &filename, &path) < 0)
|
||||
goto error;
|
||||
HDfputs("file: ", stdout);
|
||||
HDfputs(filename, stdout);
|
||||
HDfputs(" path: ", stdout);
|
||||
HDfputs(path, stdout);
|
||||
break;
|
||||
|
||||
default:
|
||||
HDfputs("cannot follow UD links", stdout);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
if(buf)
|
||||
HDfree(buf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: list
|
||||
@ -1830,102 +1720,162 @@ error:
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
list(hid_t group, const char *name, const H5L_info_t UNUSED *linfo, void *_iter)
|
||||
list(hid_t group, const char *name, const H5L_info_t *linfo, void *_iter)
|
||||
{
|
||||
hid_t obj = -1;
|
||||
char buf[512], comment[50], *fullname = NULL, *s = NULL;
|
||||
H5G_stat_t sb;
|
||||
haddr_t objno; /* Compact form of object's location */
|
||||
struct tm *tm;
|
||||
herr_t status;
|
||||
iter_t *iter = (iter_t*)_iter;
|
||||
char *fullname = NULL;
|
||||
int n;
|
||||
|
||||
/* Print the object name, either full name or base name */
|
||||
fullname = fix_name(iter->container, name);
|
||||
if (fullname_g) {
|
||||
if(fullname_g)
|
||||
n = display_string(stdout, fullname, TRUE);
|
||||
printf("%*s ", MAX(0, 24-n), "");
|
||||
} else {
|
||||
else
|
||||
n = display_string(stdout, name, TRUE);
|
||||
printf("%*s ", MAX(0, 24-n), "");
|
||||
}
|
||||
printf("%*s ", MAX(0, (24 - n)), "");
|
||||
|
||||
/* Get object information */
|
||||
H5E_BEGIN_TRY {
|
||||
status = H5Gget_objinfo(group, name, FALSE, &sb);
|
||||
} H5E_END_TRY;
|
||||
if(status < 0) {
|
||||
puts("**NOT FOUND**");
|
||||
return 0;
|
||||
} else if(sb.type < 0 || sb.type >= H5G_NTYPES) {
|
||||
printf("Unknown type(%d)", sb.type);
|
||||
sb.type = H5G_UNKNOWN;
|
||||
}
|
||||
if(sb.type >= 0 && dispatch_g[sb.type].name)
|
||||
fputs(dispatch_g[sb.type].name, stdout);
|
||||
objno = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
/* Actions on objects */
|
||||
if(linfo->type == H5L_TYPE_HARD) {
|
||||
H5O_info_t oi;
|
||||
char *s;
|
||||
hid_t obj;
|
||||
|
||||
/* If the object has already been printed then just show the object ID
|
||||
* and return. */
|
||||
if((s = sym_lookup(&sb))) {
|
||||
printf(", same as ");
|
||||
display_string(stdout, s, TRUE);
|
||||
printf("\n");
|
||||
goto done;
|
||||
} else {
|
||||
sym_insert(&sb, fullname);
|
||||
}
|
||||
/* Get object information */
|
||||
if(H5Oget_info(group, name, &oi, H5P_DEFAULT) < 0) {
|
||||
puts("**NOT FOUND**");
|
||||
return 0;
|
||||
} else if(oi.type < 0 || oi.type >= H5O_TYPE_NTYPES) {
|
||||
printf("Unknown type(%d)", (int)oi.type);
|
||||
oi.type = H5O_TYPE_UNKNOWN;
|
||||
}
|
||||
if(oi.type >= 0 && dispatch_g[oi.type].name)
|
||||
fputs(dispatch_g[oi.type].name, stdout);
|
||||
|
||||
/* Open the object. Not all objects can be opened. If this is the case
|
||||
* then return right away. */
|
||||
if(sb.type >= 0 &&
|
||||
(NULL == dispatch_g[sb.type].open ||
|
||||
(obj = (dispatch_g[sb.type].open)(group, name, H5P_DEFAULT)) < 0)) {
|
||||
printf(" *ERROR*\n");
|
||||
goto done;
|
||||
} /* end if */
|
||||
/* If the object has already been printed then just show the object ID
|
||||
* and return. */
|
||||
if((s = sym_lookup(&oi))) {
|
||||
printf(", same as ");
|
||||
display_string(stdout, s, TRUE);
|
||||
printf("\n");
|
||||
goto done;
|
||||
} /* end if */
|
||||
else
|
||||
sym_insert(&oi, fullname);
|
||||
|
||||
/* List the first line of information for the object. */
|
||||
if(sb.type >= 0 && dispatch_g[sb.type].list1)
|
||||
(dispatch_g[sb.type].list1)(obj);
|
||||
putchar('\n');
|
||||
/* Open the object. Not all objects can be opened. If this is the case
|
||||
* then return right away.
|
||||
*/
|
||||
if(oi.type >= 0 &&
|
||||
(NULL == dispatch_g[oi.type].open ||
|
||||
(obj = (dispatch_g[oi.type].open)(group, name, H5P_DEFAULT)) < 0)) {
|
||||
printf(" *ERROR*\n");
|
||||
goto done;
|
||||
} /* end if */
|
||||
|
||||
/* Show detailed information about the object, beginning with information
|
||||
* which is common to all objects. */
|
||||
if(verbose_g > 0 && H5G_LINK != sb.type && H5G_UDLINK != sb.type) {
|
||||
if(sb.type >= 0)
|
||||
H5Aiterate(obj, NULL, list_attr, NULL);
|
||||
printf(" %-10s %lu:"H5_PRINTF_HADDR_FMT"\n", "Location:", sb.fileno[0], objno);
|
||||
printf(" %-10s %u\n", "Links:", sb.nlink);
|
||||
if(sb.mtime > 0) {
|
||||
if(simple_output_g)
|
||||
tm = HDgmtime(&(sb.mtime));
|
||||
else
|
||||
tm = HDlocaltime(&(sb.mtime));
|
||||
if(tm) {
|
||||
HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm);
|
||||
printf(" %-10s %s\n", "Modified:", buf);
|
||||
/* List the first line of information for the object. */
|
||||
if(oi.type >= 0 && dispatch_g[oi.type].list1)
|
||||
(dispatch_g[oi.type].list1)(obj);
|
||||
putchar('\n');
|
||||
|
||||
/* Show detailed information about the object, beginning with information
|
||||
* which is common to all objects. */
|
||||
if(verbose_g > 0) {
|
||||
char comment[50];
|
||||
|
||||
/* Display attributes */
|
||||
if(oi.type >= 0)
|
||||
H5Aiterate(obj, NULL, list_attr, NULL);
|
||||
|
||||
/* Object location & reference count */
|
||||
printf(" %-10s %lu:"H5_PRINTF_HADDR_FMT"\n", "Location:", oi.fileno, oi.addr);
|
||||
printf(" %-10s %u\n", "Links:", (unsigned)oi.rc);
|
||||
|
||||
/* Modification time */
|
||||
if(oi.mtime > 0) {
|
||||
char buf[256];
|
||||
struct tm *tm;
|
||||
|
||||
if(simple_output_g)
|
||||
tm = HDgmtime(&(oi.mtime));
|
||||
else
|
||||
tm = HDlocaltime(&(oi.mtime));
|
||||
if(tm) {
|
||||
HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm);
|
||||
printf(" %-10s %s\n", "Modified:", buf);
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
|
||||
/* Object comment */
|
||||
comment[0] = '\0';
|
||||
H5Oget_comment(group, name, comment, sizeof(comment), H5P_DEFAULT);
|
||||
HDstrcpy(comment + sizeof(comment) - 4, "...");
|
||||
if(comment[0]) {
|
||||
printf(" %-10s \"", "Comment:");
|
||||
display_string(stdout, comment, FALSE);
|
||||
puts("\"");
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
comment[0] = '\0';
|
||||
H5Oget_comment(group, name, comment, sizeof(comment), H5P_DEFAULT);
|
||||
HDstrcpy(comment + sizeof(comment) - 4, "...");
|
||||
if(comment[0]) {
|
||||
printf(" %-10s \"", "Comment:");
|
||||
display_string(stdout, comment, FALSE);
|
||||
puts("\"");
|
||||
} /* end if */
|
||||
|
||||
/* Detailed list for object */
|
||||
if(oi.type >= 0 && dispatch_g[oi.type].list2)
|
||||
(dispatch_g[oi.type].list2)(obj, fullname);
|
||||
|
||||
/* Close the object. */
|
||||
if(oi.type >= 0 && dispatch_g[oi.type].close)
|
||||
(dispatch_g[oi.type].close)(obj);
|
||||
} /* end if */
|
||||
if(sb.type >= 0 && dispatch_g[sb.type].list2)
|
||||
(dispatch_g[sb.type].list2)(obj, fullname);
|
||||
/* Actions on links */
|
||||
else {
|
||||
char *buf;
|
||||
|
||||
HDfputs("-> ", stdout);
|
||||
switch(linfo->type) {
|
||||
case H5L_TYPE_SOFT:
|
||||
if((buf = HDmalloc(linfo->u.val_size)) == NULL)
|
||||
goto done;
|
||||
|
||||
if(H5Lget_val(group, name, buf, linfo->u.val_size, H5P_DEFAULT) < 0) {
|
||||
HDfree(buf);
|
||||
goto done;
|
||||
} /* end if */
|
||||
|
||||
HDfputs(buf, stdout);
|
||||
HDfree(buf);
|
||||
break;
|
||||
|
||||
case H5L_TYPE_EXTERNAL:
|
||||
{
|
||||
const char *filename;
|
||||
const char *path;
|
||||
|
||||
if((buf = HDmalloc(linfo->u.val_size)) == NULL)
|
||||
goto done;
|
||||
|
||||
if(H5Lget_val(group, name, buf, linfo->u.val_size, H5P_DEFAULT) < 0) {
|
||||
HDfree(buf);
|
||||
goto done;
|
||||
} /* end if */
|
||||
if(H5Lunpack_elink_val(buf, linfo->u.val_size, NULL, &filename, &path) < 0) {
|
||||
HDfree(buf);
|
||||
goto done;
|
||||
} /* end if */
|
||||
|
||||
HDfputs("file: ", stdout);
|
||||
HDfputs(filename, stdout);
|
||||
HDfputs(" path: ", stdout);
|
||||
HDfputs(path, stdout);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
HDfputs("cannot follow UD links", stdout);
|
||||
break;
|
||||
} /* end switch */
|
||||
HDfputc('\n', stdout);
|
||||
} /* end else */
|
||||
|
||||
done:
|
||||
/* Close the object. */
|
||||
if(sb.type >= 0 && obj >= 0 && dispatch_g[sb.type].close)
|
||||
(dispatch_g[sb.type].close)(obj);
|
||||
|
||||
if (fullname)
|
||||
if(fullname)
|
||||
free(fullname);
|
||||
return 0;
|
||||
} /* end list() */
|
||||
@ -2104,178 +2054,182 @@ leave(int ret)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
main (int argc, const char *argv[])
|
||||
main(int argc, const char *argv[])
|
||||
{
|
||||
hid_t file=-1, root=-1;
|
||||
char *fname=NULL, *oname=NULL, *x;
|
||||
hid_t file = -1, root = -1;
|
||||
char *fname = NULL, *oname = NULL, *x;
|
||||
const char *s = NULL;
|
||||
char *rest, *container=NULL;
|
||||
char *rest, *container = NULL;
|
||||
int argno;
|
||||
H5G_stat_t sb;
|
||||
iter_t iter;
|
||||
static char root_name[] = "/";
|
||||
char drivername[50];
|
||||
const char *preferred_driver=NULL;
|
||||
const char *preferred_driver = NULL;
|
||||
|
||||
/* Initialize h5tools lib */
|
||||
h5tools_init();
|
||||
|
||||
/* Build display table */
|
||||
/* Build object display table */
|
||||
DISPATCH(H5G_DATASET, "Dataset", H5Dopen2, H5Dclose, dataset_list1, dataset_list2);
|
||||
DISPATCH(H5G_GROUP, "Group", H5Gopen2, H5Gclose, NULL, group_list2);
|
||||
DISPATCH(H5G_TYPE, "Type", H5Topen2, H5Tclose, NULL, datatype_list2);
|
||||
DISPATCH(H5G_LINK, "-> ", slink_open, NULL, NULL, NULL);
|
||||
DISPATCH(H5G_UDLINK, "-> ", udlink_open, NULL, NULL, NULL);
|
||||
|
||||
#if 0
|
||||
/* Name of this program without the path */
|
||||
if ((progname=strrchr(argv[0], '/'))) progname++;
|
||||
else progname = argv[0];
|
||||
#endif
|
||||
|
||||
/* Default output width */
|
||||
width_g = get_width();
|
||||
|
||||
/* Switches come before non-switch arguments */
|
||||
for (argno=1; argno<argc && '-'==argv[argno][0]; argno++) {
|
||||
if (!strcmp(argv[argno], "--")) {
|
||||
for(argno = 1; argno < argc && '-' == argv[argno][0]; argno++) {
|
||||
if(!HDstrcmp(argv[argno], "--")) {
|
||||
/* Last switch */
|
||||
argno++;
|
||||
break;
|
||||
} else if (!strcmp(argv[argno], "--help")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--help")) {
|
||||
usage();
|
||||
leave(0);
|
||||
} else if (!strcmp(argv[argno], "--address")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--address")) {
|
||||
address_g = TRUE;
|
||||
} else if (!strcmp(argv[argno], "--data")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--data")) {
|
||||
data_g = TRUE;
|
||||
} else if (!strcmp(argv[argno], "--errors")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--errors")) {
|
||||
show_errors_g = TRUE;
|
||||
} else if (!strcmp(argv[argno], "--full")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--full")) {
|
||||
fullname_g = TRUE;
|
||||
} else if (!strcmp(argv[argno], "--group")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--group")) {
|
||||
grp_literal_g = TRUE;
|
||||
} else if (!strcmp(argv[argno], "--label")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--label")) {
|
||||
label_g = TRUE;
|
||||
} else if (!strcmp(argv[argno], "--recursive")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--recursive")) {
|
||||
recursive_g = TRUE;
|
||||
fullname_g = TRUE;
|
||||
} else if (!strcmp(argv[argno], "--simple")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--simple")) {
|
||||
simple_output_g = TRUE;
|
||||
} else if (!strcmp(argv[argno], "--string")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--string")) {
|
||||
string_g = TRUE;
|
||||
} else if (!strncmp(argv[argno], "--vfd=", 6)) {
|
||||
} else if(!HDstrncmp(argv[argno], "--vfd=", 6)) {
|
||||
preferred_driver = argv[argno]+6;
|
||||
} else if (!strncmp(argv[argno], "--width=", 8)) {
|
||||
width_g = (int)strtol(argv[argno]+8, &rest, 0);
|
||||
} else if(!HDstrncmp(argv[argno], "--width=", 8)) {
|
||||
width_g = (int)HDstrtol(argv[argno]+8, &rest, 0);
|
||||
|
||||
if (0 == width_g)
|
||||
if(0 == width_g)
|
||||
no_line_wrap_g = TRUE;
|
||||
else if (width_g<0 || *rest) {
|
||||
else if(width_g < 0 || *rest) {
|
||||
usage();
|
||||
leave(1);
|
||||
}
|
||||
} else if (!strcmp(argv[argno], "--width")) {
|
||||
if (argno+1>=argc) {
|
||||
} else if(!HDstrcmp(argv[argno], "--width")) {
|
||||
if((argno + 1) >= argc) {
|
||||
usage();
|
||||
leave(1);
|
||||
} else {
|
||||
s = argv[++argno];
|
||||
}
|
||||
width_g = (int)strtol(s, &rest, 0);
|
||||
if (width_g<=0 || *rest) {
|
||||
width_g = (int)HDstrtol(s, &rest, 0);
|
||||
if(width_g <= 0 || *rest) {
|
||||
usage();
|
||||
leave(1);
|
||||
}
|
||||
} else if (!strcmp(argv[argno], "--verbose")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--verbose")) {
|
||||
verbose_g++;
|
||||
} else if (!strcmp(argv[argno], "--version")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--version")) {
|
||||
print_version(progname);
|
||||
leave(0);
|
||||
} else if (!strcmp(argv[argno], "--hexdump")) {
|
||||
} else if(!HDstrcmp(argv[argno], "--hexdump")) {
|
||||
hexdump_g = TRUE;
|
||||
} else if (!strncmp(argv[argno], "-w", 2)) {
|
||||
if (argv[argno][2]) {
|
||||
s = argv[argno]+2;
|
||||
} else if (argno+1>=argc) {
|
||||
} else if(!HDstrncmp(argv[argno], "-w", 2)) {
|
||||
if(argv[argno][2]) {
|
||||
s = argv[argno] + 2;
|
||||
} else if((argno + 1) >= argc) {
|
||||
usage();
|
||||
leave(1);
|
||||
} else {
|
||||
s = argv[++argno];
|
||||
}
|
||||
width_g = (int)strtol(s, &rest, 0);
|
||||
width_g = (int)HDstrtol(s, &rest, 0);
|
||||
|
||||
if (0 == width_g)
|
||||
if(0 == width_g)
|
||||
no_line_wrap_g = TRUE;
|
||||
else if (width_g<0 || *rest) {
|
||||
else if(width_g < 0 || *rest) {
|
||||
usage();
|
||||
leave(1);
|
||||
}
|
||||
} else if ('-'!=argv[argno][1]) {
|
||||
} else if('-'!=argv[argno][1]) {
|
||||
/* Single-letter switches */
|
||||
for (s=argv[argno]+1; *s; s++) {
|
||||
switch (*s) {
|
||||
for(s = argv[argno] + 1; *s; s++) {
|
||||
switch(*s) {
|
||||
case '?':
|
||||
case 'h': /* --help */
|
||||
usage();
|
||||
leave(0);
|
||||
|
||||
case 'a': /* --address */
|
||||
address_g = TRUE;
|
||||
break;
|
||||
|
||||
case 'd': /* --data */
|
||||
data_g = TRUE;
|
||||
break;
|
||||
|
||||
case 'e': /* --errors */
|
||||
show_errors_g = TRUE;
|
||||
break;
|
||||
|
||||
case 'f': /* --full */
|
||||
fullname_g = TRUE;
|
||||
break;
|
||||
|
||||
case 'g': /* --group */
|
||||
grp_literal_g = TRUE;
|
||||
break;
|
||||
|
||||
case 'l': /* --label */
|
||||
label_g = TRUE;
|
||||
break;
|
||||
|
||||
case 'r': /* --recursive */
|
||||
recursive_g = TRUE;
|
||||
fullname_g = TRUE;
|
||||
break;
|
||||
|
||||
case 'S': /* --simple */
|
||||
simple_output_g = TRUE;
|
||||
break;
|
||||
|
||||
case 's': /* --string */
|
||||
string_g = TRUE;
|
||||
break;
|
||||
|
||||
case 'v': /* --verbose */
|
||||
verbose_g++;
|
||||
break;
|
||||
|
||||
case 'V': /* --version */
|
||||
print_version(progname);
|
||||
leave(0);
|
||||
|
||||
case 'x': /* --hexdump */
|
||||
hexdump_g = TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
usage();
|
||||
leave(1);
|
||||
}
|
||||
}
|
||||
} /* end switch */
|
||||
} /* end for */
|
||||
} else {
|
||||
usage();
|
||||
leave(1);
|
||||
}
|
||||
}
|
||||
} /* end for */
|
||||
|
||||
/* If no arguments remain then print a usage message (instead of doing
|
||||
* absolutely nothing ;-) */
|
||||
if (argno>=argc) {
|
||||
if(argno >= argc) {
|
||||
usage();
|
||||
leave(1);
|
||||
}
|
||||
} /* end if */
|
||||
|
||||
/* Turn off HDF5's automatic error printing unless you're debugging h5ls */
|
||||
if (!show_errors_g) H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
|
||||
if(!show_errors_g)
|
||||
H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
|
||||
|
||||
|
||||
/* Each remaining argument is an hdf5 file followed by an optional slash
|
||||
@ -2291,42 +2245,67 @@ main (int argc, const char *argv[])
|
||||
* then there must have been something wrong with the file (perhaps it
|
||||
* doesn't exist). */
|
||||
show_file_name_g = (argc-argno > 1); /*show file names if more than one*/
|
||||
while (argno<argc) {
|
||||
while(argno < argc) {
|
||||
H5O_info_t oi;
|
||||
H5L_info_t li;
|
||||
iter_t iter;
|
||||
|
||||
fname = HDstrdup(argv[argno++]);
|
||||
oname = NULL;
|
||||
file = -1;
|
||||
|
||||
while (fname && *fname) {
|
||||
while(fname && *fname) {
|
||||
file = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, preferred_driver, drivername, sizeof drivername);
|
||||
|
||||
if (file>=0) {
|
||||
if (verbose_g) {
|
||||
printf("Opened \"%s\" with %s driver.\n",
|
||||
fname, drivername);
|
||||
}
|
||||
if(file >= 0) {
|
||||
if(verbose_g)
|
||||
printf("Opened \"%s\" with %s driver.\n", fname, drivername);
|
||||
break; /*success*/
|
||||
}
|
||||
} /* end if */
|
||||
|
||||
/* Shorten the file name; lengthen the object name */
|
||||
x = oname;
|
||||
oname = strrchr(fname, '/');
|
||||
if (x) *x = '/';
|
||||
if (!oname) break;
|
||||
if(x)
|
||||
*x = '/';
|
||||
if(!oname)
|
||||
break;
|
||||
*oname = '\0';
|
||||
}
|
||||
if (file<0) {
|
||||
} /* end while */
|
||||
if(file < 0) {
|
||||
fprintf(stderr, "%s: unable to open file\n", argv[argno-1]);
|
||||
continue;
|
||||
}
|
||||
} /* end if */
|
||||
if(oname)
|
||||
oname++;
|
||||
if(!oname || !*oname)
|
||||
oname = root_name;
|
||||
|
||||
/* Check for root group as object name */
|
||||
if(HDstrcmp(oname, root_name)) {
|
||||
/* Check the type of link given */
|
||||
if(H5Lget_info(file, oname, &li, H5P_DEFAULT) < 0) {
|
||||
char *fullname = NULL;
|
||||
int n;
|
||||
|
||||
fullname = fix_name(oname, "/");
|
||||
if(fullname_g)
|
||||
n = display_string(stdout, fullname, TRUE);
|
||||
else
|
||||
n = display_string(stdout, oname, TRUE);
|
||||
printf("%*s \n", MAX(0, (24 - n)), "**NOT FOUND**");
|
||||
|
||||
HDfree(fullname);
|
||||
leave(1);
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
else
|
||||
li.type = H5L_TYPE_HARD;
|
||||
|
||||
/* Open the object and display it's information */
|
||||
if(H5Gget_objinfo(file, oname, TRUE, &sb) >= 0 && H5G_GROUP == sb.type && !grp_literal_g) {
|
||||
if(li.type == H5L_TYPE_HARD && H5Oget_info(file, oname, &oi, H5P_DEFAULT) >= 0 && H5O_TYPE_GROUP == oi.type && !grp_literal_g) {
|
||||
/* Specified name is a group. List the complete contents of the group. */
|
||||
sym_insert(&sb, oname);
|
||||
sym_insert(&oi, oname);
|
||||
iter.container = container = fix_name((show_file_name_g ? fname : ""), oname);
|
||||
|
||||
/* list root attributes */
|
||||
@ -2341,21 +2320,21 @@ main (int argc, const char *argv[])
|
||||
/* list */
|
||||
H5Literate(file, oname, H5_INDEX_NAME, H5_ITER_INC, NULL, list, &iter, H5P_DEFAULT);
|
||||
free(container);
|
||||
|
||||
} else if((root = H5Gopen2(file, "/", H5P_DEFAULT)) < 0) {
|
||||
leave(1); /*major problem!*/
|
||||
|
||||
} else {
|
||||
/* Specified name is a non-group object -- list that object. The
|
||||
* container for the object is everything up to the base name. */
|
||||
* container for the object is everything up to the base name.
|
||||
*/
|
||||
iter.container = show_file_name_g ? fname : "/";
|
||||
list(root, oname, NULL, &iter);
|
||||
list(root, oname, &li, &iter);
|
||||
if(H5Gclose(root) < 0)
|
||||
leave(1);
|
||||
}
|
||||
H5Fclose(file);
|
||||
free(fname);
|
||||
}
|
||||
} /* end while */
|
||||
|
||||
leave(0);
|
||||
}
|
||||
|
||||
|
@ -626,12 +626,12 @@ int do_copy_objects(hid_t fidin,
|
||||
*/
|
||||
if ( has_filter && apply_s == 0 )
|
||||
printf(" <warning: filter not applied to %s. dataset smaller than %d bytes>\n",
|
||||
travt->objs[i].name,
|
||||
(int)options->threshold);
|
||||
travt->objs[i].name,
|
||||
(int)options->threshold);
|
||||
|
||||
if ( has_filter && apply_f == 0 )
|
||||
printf(" <warning: could not apply the filter to %s>\n",
|
||||
travt->objs[i].name);
|
||||
travt->objs[i].name);
|
||||
|
||||
} /* verbose */
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
1197
tools/lib/h5diff.c
1197
tools/lib/h5diff.c
File diff suppressed because it is too large
Load Diff
@ -25,18 +25,18 @@
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
int m_quiet; /* quiet mide: no output at all */
|
||||
int m_report; /* report mode: print the data */
|
||||
int m_verbose; /* verbose mode: print the data, list of objcets, warnings */
|
||||
int d; /* delta, absolute value to compare */
|
||||
double delta; /* delta value */
|
||||
int p; /* relative error to compare*/
|
||||
double percent; /* relative error value */
|
||||
int n; /* count, compare up to count */
|
||||
hsize_t count; /* count value */
|
||||
int err_stat; /* an error ocurred (1, error, 0, no error) */
|
||||
int cmn_objs; /* do we have comparable objects */
|
||||
int not_cmp; /* are the objects comparable */
|
||||
int m_quiet; /* quiet mide: no output at all */
|
||||
int m_report; /* report mode: print the data */
|
||||
int m_verbose; /* verbose mode: print the data, list of objcets, warnings */
|
||||
int d; /* delta, absolute value to compare */
|
||||
double delta; /* delta value */
|
||||
int p; /* relative error to compare*/
|
||||
double percent; /* relative error value */
|
||||
int n; /* count, compare up to count */
|
||||
hsize_t count; /* count value */
|
||||
int err_stat; /* an error ocurred (1, error, 0, no error) */
|
||||
int cmn_objs; /* do we have comparable objects */
|
||||
int not_cmp; /* are the objects comparable */
|
||||
} diff_opt_t;
|
||||
|
||||
|
||||
@ -89,7 +89,7 @@ hsize_t diff( hid_t file1_id,
|
||||
hid_t file2_id,
|
||||
const char *path2,
|
||||
diff_opt_t *options,
|
||||
H5G_obj_t type );
|
||||
h5trav_type_t type );
|
||||
|
||||
hsize_t diff_compare( hid_t file1_id,
|
||||
const char *file1_name,
|
||||
@ -177,161 +177,160 @@ hsize_t diff_datum(void *_mem1,
|
||||
|
||||
|
||||
hsize_t diff_float(unsigned char *mem1,
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
hsize_t diff_double(unsigned char *mem1,
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
hsize_t diff_schar(unsigned char *mem1,
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
hsize_t diff_uchar(unsigned char *mem1,
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
hsize_t diff_short(unsigned char *mem1,
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
hsize_t diff_ushort(unsigned char *mem1,
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
hsize_t diff_int(unsigned char *mem1,
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
hsize_t diff_uint(unsigned char *mem1,
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
hsize_t diff_long(unsigned char *mem1,
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
hsize_t diff_ulong(unsigned char *mem1,
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
hsize_t diff_llong(unsigned char *mem1,
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
hsize_t diff_ullong(unsigned char *mem1,
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
|
||||
unsigned char *mem2,
|
||||
hsize_t nelmts,
|
||||
hsize_t hyper_start,
|
||||
int rank,
|
||||
hsize_t *dims,
|
||||
hsize_t *acc,
|
||||
hsize_t *pos,
|
||||
diff_opt_t *options,
|
||||
const char *obj1,
|
||||
const char *obj2,
|
||||
int *ph);
|
||||
|
||||
#endif /* H5DIFF_H__ */
|
||||
|
||||
|
@ -2178,189 +2178,165 @@ hsize_t diff_region(hid_t obj1_id,
|
||||
diff_opt_t *options)
|
||||
|
||||
{
|
||||
hssize_t nblocks1, npoints1;
|
||||
hssize_t nblocks2, npoints2;
|
||||
H5G_stat_t sb1;
|
||||
H5G_stat_t sb2;
|
||||
hsize_t alloc_size;
|
||||
hsize_t *ptdata1;
|
||||
hsize_t *ptdata2;
|
||||
int ndims1;
|
||||
int ndims2;
|
||||
int i, j;
|
||||
haddr_t objno1, objno2; /* compact form of object's location */
|
||||
hsize_t nfound_b=0; /* block differences found */
|
||||
hsize_t nfound_p=0; /* point differences found */
|
||||
hssize_t nblocks1, npoints1;
|
||||
hssize_t nblocks2, npoints2;
|
||||
hsize_t alloc_size;
|
||||
hsize_t *ptdata1;
|
||||
hsize_t *ptdata2;
|
||||
int ndims1;
|
||||
int ndims2;
|
||||
int i, j;
|
||||
hsize_t nfound_b = 0; /* block differences found */
|
||||
hsize_t nfound_p = 0; /* point differences found */
|
||||
|
||||
ndims1 = H5Sget_simple_extent_ndims(region1_id);
|
||||
ndims2 = H5Sget_simple_extent_ndims(region2_id);
|
||||
ndims1 = H5Sget_simple_extent_ndims(region1_id);
|
||||
ndims2 = H5Sget_simple_extent_ndims(region2_id);
|
||||
|
||||
H5Gget_objinfo(obj1_id, ".", FALSE, &sb1);
|
||||
H5Gget_objinfo(obj2_id, ".", FALSE, &sb2);
|
||||
/*
|
||||
* These two functions fail if the region does not have blocks or points,
|
||||
* respectively. They do not currently know how to translate from one to
|
||||
* the other.
|
||||
*/
|
||||
H5E_BEGIN_TRY {
|
||||
nblocks1 = H5Sget_select_hyper_nblocks(region1_id);
|
||||
nblocks2 = H5Sget_select_hyper_nblocks(region2_id);
|
||||
|
||||
objno1 = (haddr_t)sb1.objno[0] | ((haddr_t)sb1.objno[1] << (8 * sizeof(long)));
|
||||
objno2 = (haddr_t)sb2.objno[0] | ((haddr_t)sb2.objno[1] << (8 * sizeof(long)));
|
||||
npoints1 = H5Sget_select_elem_npoints(region1_id);
|
||||
npoints2 = H5Sget_select_elem_npoints(region2_id);
|
||||
} H5E_END_TRY;
|
||||
|
||||
/*
|
||||
* These two functions fail if the region does not have blocks or points,
|
||||
* respectively. They do not currently know how to translate from one to
|
||||
* the other.
|
||||
*/
|
||||
H5E_BEGIN_TRY {
|
||||
nblocks1 = H5Sget_select_hyper_nblocks(region1_id);
|
||||
nblocks2 = H5Sget_select_hyper_nblocks(region2_id);
|
||||
|
||||
npoints1 = H5Sget_select_elem_npoints(region1_id);
|
||||
npoints2 = H5Sget_select_elem_npoints(region2_id);
|
||||
} H5E_END_TRY;
|
||||
|
||||
if (nblocks1!=nblocks2 || npoints1!=npoints2 || ndims1!=ndims2)
|
||||
{
|
||||
options->not_cmp=1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* compare block information
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (nblocks1 > 0)
|
||||
{
|
||||
|
||||
alloc_size = nblocks1 * ndims1 * 2 * sizeof(ptdata1[0]);
|
||||
assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
|
||||
|
||||
ptdata1 = malloc((size_t)alloc_size);
|
||||
H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t);
|
||||
H5Sget_select_hyper_blocklist(region1_id, (hsize_t)0, (hsize_t)nblocks1, ptdata1);
|
||||
|
||||
ptdata2 = malloc((size_t)alloc_size);
|
||||
H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t);
|
||||
H5Sget_select_hyper_blocklist(region2_id, (hsize_t)0, (hsize_t)nblocks2, ptdata2);
|
||||
|
||||
for (i = 0; i < nblocks1; i++)
|
||||
{
|
||||
/* start coordinates and opposite corner */
|
||||
for (j = 0; j < ndims1; j++)
|
||||
{
|
||||
hsize_t start1, start2, end1, end2;
|
||||
start1 = ptdata1[i * 2 * ndims1 + j];
|
||||
start2 = ptdata2[i * 2 * ndims1 + j];
|
||||
end1 = ptdata1[i * 2 * ndims1 + j + ndims1];
|
||||
end2 = ptdata2[i * 2 * ndims1 + j + ndims1];
|
||||
if (start1 != start2 || end1 != end2)
|
||||
{
|
||||
nfound_b++;
|
||||
if(nblocks1 != nblocks2 || npoints1 != npoints2 || ndims1 != ndims2) {
|
||||
options->not_cmp = 1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* compare block information
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if(nblocks1 > 0) {
|
||||
alloc_size = nblocks1 * ndims1 * 2 * sizeof(ptdata1[0]);
|
||||
assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
|
||||
|
||||
ptdata1 = malloc((size_t)alloc_size);
|
||||
H5_CHECK_OVERFLOW(nblocks1, hssize_t, hsize_t);
|
||||
H5Sget_select_hyper_blocklist(region1_id, (hsize_t)0, (hsize_t)nblocks1, ptdata1);
|
||||
|
||||
ptdata2 = malloc((size_t)alloc_size);
|
||||
H5_CHECK_OVERFLOW(nblocks2, hssize_t, hsize_t);
|
||||
H5Sget_select_hyper_blocklist(region2_id, (hsize_t)0, (hsize_t)nblocks2, ptdata2);
|
||||
|
||||
for (i = 0; i < nblocks1; i++) {
|
||||
/* start coordinates and opposite corner */
|
||||
for (j = 0; j < ndims1; j++) {
|
||||
hsize_t start1, start2, end1, end2;
|
||||
|
||||
start1 = ptdata1[i * 2 * ndims1 + j];
|
||||
start2 = ptdata2[i * 2 * ndims1 + j];
|
||||
end1 = ptdata1[i * 2 * ndims1 + j + ndims1];
|
||||
end2 = ptdata2[i * 2 * ndims1 + j + ndims1];
|
||||
if (start1 != start2 || end1 != end2)
|
||||
nfound_b++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* print differences if found */
|
||||
if (nfound_b && options->m_verbose)
|
||||
{
|
||||
parallel_print("Referenced dataset %lu %lu\n",
|
||||
(unsigned long)objno1,(unsigned long)objno2);
|
||||
parallel_print("------------------------------------------------------------\n");
|
||||
/* print differences if found */
|
||||
if (nfound_b && options->m_verbose) {
|
||||
H5O_info_t oi1, oi2;
|
||||
|
||||
parallel_print("Region blocks\n");
|
||||
for (i = 0; i < nblocks1; i++)
|
||||
{
|
||||
parallel_print("block #%d", i);
|
||||
print_region_block(i, ptdata1, ndims1);
|
||||
print_region_block(i, ptdata2, ndims1);
|
||||
parallel_print("\n");
|
||||
H5Oget_info(obj1_id, ".", &oi1, H5P_DEFAULT);
|
||||
H5Oget_info(obj2_id, ".", &oi2, H5P_DEFAULT);
|
||||
|
||||
}
|
||||
}
|
||||
parallel_print("Referenced dataset %lu %lu\n",
|
||||
(unsigned long)oi1.addr, (unsigned long)oi2.addr);
|
||||
parallel_print("------------------------------------------------------------\n");
|
||||
|
||||
HDfree(ptdata1);
|
||||
HDfree(ptdata2);
|
||||
}
|
||||
parallel_print("Region blocks\n");
|
||||
for (i = 0; i < nblocks1; i++) {
|
||||
parallel_print("block #%d", i);
|
||||
print_region_block(i, ptdata1, ndims1);
|
||||
print_region_block(i, ptdata2, ndims1);
|
||||
parallel_print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* compare point information
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if (npoints1 > 0)
|
||||
{
|
||||
alloc_size = npoints1 * ndims1 * sizeof(ptdata1[0]);
|
||||
assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
|
||||
|
||||
ptdata1 = malloc((size_t)alloc_size);
|
||||
H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t);
|
||||
H5Sget_select_elem_pointlist(region1_id, (hsize_t)0, (hsize_t)npoints1, ptdata1);
|
||||
|
||||
ptdata2 = malloc((size_t)alloc_size);
|
||||
H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t);
|
||||
H5Sget_select_elem_pointlist(region2_id, (hsize_t)0, (hsize_t)npoints2, ptdata2);
|
||||
|
||||
for (i = 0; i < npoints1; i++)
|
||||
{
|
||||
hsize_t pt1, pt2;
|
||||
|
||||
for (j = 0; j < ndims1; j++)
|
||||
{
|
||||
pt1 = ptdata1[i * ndims1 + j];
|
||||
pt2 = ptdata2[i * ndims1 + j];
|
||||
if (pt1 != pt2)
|
||||
nfound_p++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nfound_p && options->m_verbose)
|
||||
{
|
||||
parallel_print("Region points\n");
|
||||
for (i = 0; i < npoints1; i++)
|
||||
{
|
||||
hsize_t pt1, pt2;
|
||||
int diff_data = 0;
|
||||
for (j = 0; j < ndims1; j++)
|
||||
{
|
||||
pt1 = ptdata1[i * ndims1 + j];
|
||||
pt2 = ptdata2[i * ndims1 + j];
|
||||
if (pt1 != pt2)
|
||||
{
|
||||
diff_data = 1;
|
||||
break;
|
||||
}
|
||||
HDfree(ptdata1);
|
||||
HDfree(ptdata2);
|
||||
}
|
||||
if (diff_data)
|
||||
{
|
||||
parallel_print("point #%d", i);
|
||||
print_points(i, ptdata1, ndims1);
|
||||
print_points(i, ptdata2, ndims1);
|
||||
parallel_print("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* compare point information
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if(npoints1 > 0) {
|
||||
alloc_size = npoints1 * ndims1 * sizeof(ptdata1[0]);
|
||||
assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
|
||||
|
||||
ptdata1 = malloc((size_t)alloc_size);
|
||||
H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t);
|
||||
H5Sget_select_elem_pointlist(region1_id, (hsize_t)0, (hsize_t)npoints1, ptdata1);
|
||||
|
||||
ptdata2 = malloc((size_t)alloc_size);
|
||||
H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t);
|
||||
H5Sget_select_elem_pointlist(region2_id, (hsize_t)0, (hsize_t)npoints2, ptdata2);
|
||||
|
||||
for(i = 0; i < npoints1; i++) {
|
||||
hsize_t pt1, pt2;
|
||||
|
||||
for(j = 0; j < ndims1; j++) {
|
||||
pt1 = ptdata1[i * ndims1 + j];
|
||||
pt2 = ptdata2[i * ndims1 + j];
|
||||
if(pt1 != pt2)
|
||||
nfound_p++;
|
||||
}
|
||||
}
|
||||
|
||||
if(nfound_p && options->m_verbose) {
|
||||
parallel_print("Region points\n");
|
||||
for(i = 0; i < npoints1; i++) {
|
||||
hsize_t pt1, pt2;
|
||||
int diff_data = 0;
|
||||
|
||||
for(j = 0; j < ndims1; j++) {
|
||||
pt1 = ptdata1[i * ndims1 + j];
|
||||
pt2 = ptdata2[i * ndims1 + j];
|
||||
if(pt1 != pt2) {
|
||||
diff_data = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(diff_data) {
|
||||
parallel_print("point #%d", i);
|
||||
print_points(i, ptdata1, ndims1);
|
||||
print_points(i, ptdata2, ndims1);
|
||||
parallel_print("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if defined (H5DIFF_DEBUG)
|
||||
for (i = 0; i < npoints1; i++)
|
||||
{
|
||||
int j;
|
||||
for (i = 0; i < npoints1; i++) {
|
||||
int j;
|
||||
|
||||
parallel_print("%sPt%lu: " ,
|
||||
i ? "," : "",
|
||||
(unsigned long)i);
|
||||
parallel_print("%sPt%lu: " , i ? "," : "", (unsigned long)i);
|
||||
|
||||
for (j = 0; j < ndims1; j++)
|
||||
parallel_print("%s%lu", j ? "," : "(",
|
||||
(unsigned long)(ptdata1[i * ndims1 + j]));
|
||||
for (j = 0; j < ndims1; j++)
|
||||
parallel_print("%s%lu", j ? "," : "(",
|
||||
(unsigned long)(ptdata1[i * ndims1 + j]));
|
||||
|
||||
parallel_print(")");
|
||||
}
|
||||
parallel_print(")");
|
||||
}
|
||||
#endif
|
||||
|
||||
HDfree(ptdata1);
|
||||
HDfree(ptdata2);
|
||||
}
|
||||
HDfree(ptdata1);
|
||||
HDfree(ptdata2);
|
||||
}
|
||||
|
||||
nfound_b = nfound_b/ndims1;
|
||||
nfound_p = nfound_p/ndims1;
|
||||
return (nfound_p + nfound_b);
|
||||
nfound_b = nfound_b/ndims1;
|
||||
nfound_p = nfound_p/ndims1;
|
||||
return (nfound_p + nfound_b);
|
||||
}
|
||||
|
||||
|
||||
|
@ -128,12 +128,12 @@ void
|
||||
h5tools_close(void)
|
||||
{
|
||||
if (h5tools_init_g) {
|
||||
if (rawdatastream && rawdatastream != stdout) {
|
||||
if (fclose(rawdatastream))
|
||||
perror("closing rawdatastream");
|
||||
else
|
||||
rawdatastream = NULL;
|
||||
}
|
||||
if (rawdatastream && rawdatastream != stdout) {
|
||||
if (fclose(rawdatastream))
|
||||
perror("closing rawdatastream");
|
||||
else
|
||||
rawdatastream = NULL;
|
||||
}
|
||||
|
||||
/* Clean up the reference path table, if it's been used */
|
||||
term_ref_path_table();
|
||||
@ -141,7 +141,7 @@ h5tools_close(void)
|
||||
/* Shut down the library */
|
||||
H5close();
|
||||
|
||||
h5tools_init_g = 0;
|
||||
h5tools_init_g = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -554,152 +554,150 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
|
||||
*to the ctx->size_last_dim. */
|
||||
|
||||
/* binary dump */
|
||||
if (bin_output)
|
||||
{
|
||||
do_bin_output(stream,nelmts,type,_mem);
|
||||
bin_output=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Setup */
|
||||
memset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
size = H5Tget_size(type);
|
||||
if(bin_output) {
|
||||
do_bin_output(stream, nelmts, type, _mem);
|
||||
bin_output = 0;
|
||||
} /* end if */
|
||||
else {
|
||||
/* Setup */
|
||||
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
|
||||
size = H5Tget_size(type);
|
||||
|
||||
if (info->line_ncols > 0)
|
||||
ncols = info->line_ncols;
|
||||
if(info->line_ncols > 0)
|
||||
ncols = info->line_ncols;
|
||||
|
||||
|
||||
/* pass to the prefix in h5tools_simple_prefix the total position
|
||||
instead of the current stripmine position i; this is necessary
|
||||
to print the array indices */
|
||||
curr_pos = ctx->sm_pos;
|
||||
|
||||
h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
|
||||
|
||||
for (i = 0; i < nelmts; i++, ctx->cur_elmt++, elmt_counter++) {
|
||||
/* Render the element */
|
||||
h5tools_str_reset(&buffer);
|
||||
h5tools_str_sprint(&buffer, info, container, type, mem + i * size, ctx);
|
||||
|
||||
if (i + 1 < nelmts || (flags & END_OF_DATA) == 0)
|
||||
h5tools_str_append(&buffer, "%s", OPT(info->elmt_suf1, ","));
|
||||
|
||||
s = h5tools_str_fmt(&buffer, 0, "%s");
|
||||
|
||||
/*
|
||||
* If the element would split on multiple lines if printed at our
|
||||
* current location...
|
||||
/* pass to the prefix in h5tools_simple_prefix the total position
|
||||
* instead of the current stripmine position i; this is necessary
|
||||
* to print the array indices
|
||||
*/
|
||||
if (info->line_multi_new == 1 &&
|
||||
(ctx->cur_column + h5tools_ncols(s) +
|
||||
strlen(OPT(info->elmt_suf2, " ")) +
|
||||
strlen(OPT(info->line_suf, ""))) > ncols) {
|
||||
if (ctx->prev_multiline) {
|
||||
/*
|
||||
* ... and the previous element also occupied more than one
|
||||
* line, then start this element at the beginning of a line.
|
||||
*/
|
||||
ctx->need_prefix = TRUE;
|
||||
} else if ((ctx->prev_prefix_len + h5tools_ncols(s) +
|
||||
strlen(OPT(info->elmt_suf2, " ")) +
|
||||
strlen(OPT(info->line_suf, ""))) <= ncols) {
|
||||
/*
|
||||
* ...but *could* fit on one line otherwise, then we
|
||||
* should end the current line and start this element on its
|
||||
* own line.
|
||||
*/
|
||||
ctx->need_prefix = TRUE;
|
||||
}
|
||||
}
|
||||
curr_pos = ctx->sm_pos;
|
||||
|
||||
/*
|
||||
* We need to break after each row of a dimension---> we should
|
||||
* break at the end of the each last dimension well that is the
|
||||
* way the dumper did it before
|
||||
*/
|
||||
if (info->arr_linebreak && ctx->cur_elmt) {
|
||||
if (ctx->size_last_dim && (ctx->cur_elmt % ctx->size_last_dim) == 0)
|
||||
ctx->need_prefix = TRUE;
|
||||
h5tools_simple_prefix(stream, info, ctx, curr_pos, 0);
|
||||
|
||||
if ((hsize_t)elmt_counter == ctx->size_last_dim) {
|
||||
ctx->need_prefix = TRUE;
|
||||
elmt_counter = 0;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < nelmts; i++, ctx->cur_elmt++, elmt_counter++) {
|
||||
/* Render the element */
|
||||
h5tools_str_reset(&buffer);
|
||||
h5tools_str_sprint(&buffer, info, container, type, mem + i * size, ctx);
|
||||
|
||||
/*
|
||||
* If the previous element occupied multiple lines and this element
|
||||
* is too long to fit on a line then start this element at the
|
||||
* beginning of the line.
|
||||
*/
|
||||
if (info->line_multi_new == 1 && ctx->prev_multiline &&
|
||||
(ctx->cur_column + h5tools_ncols(s) +
|
||||
strlen(OPT(info->elmt_suf2, " ")) +
|
||||
strlen(OPT(info->line_suf, ""))) > ncols)
|
||||
ctx->need_prefix = TRUE;
|
||||
if (i + 1 < nelmts || (flags & END_OF_DATA) == 0)
|
||||
h5tools_str_append(&buffer, "%s", OPT(info->elmt_suf1, ","));
|
||||
|
||||
/*
|
||||
* If too many elements have already been printed then we need to
|
||||
* start a new line.
|
||||
*/
|
||||
if (info->line_per_line > 0 && ctx->cur_elmt >= info->line_per_line)
|
||||
ctx->need_prefix = TRUE;
|
||||
|
||||
/*
|
||||
* Each OPTIONAL_LINE_BREAK embedded in the rendered string can cause
|
||||
* the data to split across multiple lines. We display the sections
|
||||
* one-at a time.
|
||||
*/
|
||||
for (secnum = 0, multiline = 0;
|
||||
(section = strtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK));
|
||||
secnum++) {
|
||||
/*
|
||||
* If the current section plus possible suffix and end-of-line
|
||||
* information would cause the output to wrap then we need to
|
||||
* start a new line.
|
||||
*/
|
||||
s = h5tools_str_fmt(&buffer, 0, "%s");
|
||||
|
||||
/*
|
||||
* Added the info->skip_first because the dumper does not want
|
||||
* this check to happen for the first line
|
||||
* If the element would split on multiple lines if printed at our
|
||||
* current location...
|
||||
*/
|
||||
if ((!info->skip_first || i) &&
|
||||
(ctx->cur_column + strlen(section) +
|
||||
if (info->line_multi_new == 1 &&
|
||||
(ctx->cur_column + h5tools_ncols(s) +
|
||||
strlen(OPT(info->elmt_suf2, " ")) +
|
||||
strlen(OPT(info->line_suf, ""))) > ncols) {
|
||||
if (ctx->prev_multiline) {
|
||||
/*
|
||||
* ... and the previous element also occupied more than one
|
||||
* line, then start this element at the beginning of a line.
|
||||
*/
|
||||
ctx->need_prefix = TRUE;
|
||||
} else if ((ctx->prev_prefix_len + h5tools_ncols(s) +
|
||||
strlen(OPT(info->elmt_suf2, " ")) +
|
||||
strlen(OPT(info->line_suf, ""))) <= ncols) {
|
||||
/*
|
||||
* ...but *could* fit on one line otherwise, then we
|
||||
* should end the current line and start this element on its
|
||||
* own line.
|
||||
*/
|
||||
ctx->need_prefix = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We need to break after each row of a dimension---> we should
|
||||
* break at the end of the each last dimension well that is the
|
||||
* way the dumper did it before
|
||||
*/
|
||||
if (info->arr_linebreak && ctx->cur_elmt) {
|
||||
if (ctx->size_last_dim && (ctx->cur_elmt % ctx->size_last_dim) == 0)
|
||||
ctx->need_prefix = TRUE;
|
||||
|
||||
if ((hsize_t)elmt_counter == ctx->size_last_dim) {
|
||||
ctx->need_prefix = TRUE;
|
||||
elmt_counter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If the previous element occupied multiple lines and this element
|
||||
* is too long to fit on a line then start this element at the
|
||||
* beginning of the line.
|
||||
*/
|
||||
if (info->line_multi_new == 1 && ctx->prev_multiline &&
|
||||
(ctx->cur_column + h5tools_ncols(s) +
|
||||
strlen(OPT(info->elmt_suf2, " ")) +
|
||||
strlen(OPT(info->line_suf, ""))) > ncols)
|
||||
ctx->need_prefix = 1;
|
||||
ctx->need_prefix = TRUE;
|
||||
|
||||
/*
|
||||
* Print the prefix or separate the beginning of this element
|
||||
* from the previous element.
|
||||
* If too many elements have already been printed then we need to
|
||||
* start a new line.
|
||||
*/
|
||||
if (ctx->need_prefix) {
|
||||
if (secnum)
|
||||
multiline++;
|
||||
if (info->line_per_line > 0 && ctx->cur_elmt >= info->line_per_line)
|
||||
ctx->need_prefix = TRUE;
|
||||
|
||||
/* pass to the prefix in h5tools_simple_prefix the total position
|
||||
instead of the current stripmine position i; this is necessary
|
||||
to print the array indices */
|
||||
curr_pos = ctx->sm_pos + i;
|
||||
/*
|
||||
* Each OPTIONAL_LINE_BREAK embedded in the rendered string can cause
|
||||
* the data to split across multiple lines. We display the sections
|
||||
* one-at a time.
|
||||
*/
|
||||
for (secnum = 0, multiline = 0;
|
||||
(section = strtok(secnum ? NULL : s, OPTIONAL_LINE_BREAK));
|
||||
secnum++) {
|
||||
/*
|
||||
* If the current section plus possible suffix and end-of-line
|
||||
* information would cause the output to wrap then we need to
|
||||
* start a new line.
|
||||
*/
|
||||
|
||||
h5tools_simple_prefix(stream, info, ctx, curr_pos, secnum);
|
||||
} else if ((i || ctx->continuation) && secnum == 0) {
|
||||
fputs(OPT(info->elmt_suf2, " "), stream);
|
||||
ctx->cur_column += strlen(OPT(info->elmt_suf2, " "));
|
||||
/*
|
||||
* Added the info->skip_first because the dumper does not want
|
||||
* this check to happen for the first line
|
||||
*/
|
||||
if ((!info->skip_first || i) &&
|
||||
(ctx->cur_column + strlen(section) +
|
||||
strlen(OPT(info->elmt_suf2, " ")) +
|
||||
strlen(OPT(info->line_suf, ""))) > ncols)
|
||||
ctx->need_prefix = 1;
|
||||
|
||||
/*
|
||||
* Print the prefix or separate the beginning of this element
|
||||
* from the previous element.
|
||||
*/
|
||||
if (ctx->need_prefix) {
|
||||
if (secnum)
|
||||
multiline++;
|
||||
|
||||
/* pass to the prefix in h5tools_simple_prefix the total
|
||||
* position instead of the current stripmine position i;
|
||||
* this is necessary to print the array indices
|
||||
*/
|
||||
curr_pos = ctx->sm_pos + i;
|
||||
|
||||
h5tools_simple_prefix(stream, info, ctx, curr_pos, secnum);
|
||||
} else if ((i || ctx->continuation) && secnum == 0) {
|
||||
fputs(OPT(info->elmt_suf2, " "), stream);
|
||||
ctx->cur_column += strlen(OPT(info->elmt_suf2, " "));
|
||||
}
|
||||
|
||||
/* Print the section */
|
||||
fputs(section, stream);
|
||||
ctx->cur_column += strlen(section);
|
||||
}
|
||||
|
||||
/* Print the section */
|
||||
fputs(section, stream);
|
||||
ctx->cur_column += strlen(section);
|
||||
ctx->prev_multiline = multiline;
|
||||
}
|
||||
|
||||
ctx->prev_multiline = multiline;
|
||||
}
|
||||
|
||||
h5tools_str_close(&buffer);
|
||||
|
||||
}/* else bin */
|
||||
|
||||
h5tools_str_close(&buffer);
|
||||
}/* else bin */
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,49 +49,8 @@ extern int d_status;
|
||||
|
||||
static int ref_path_table_put(const char *, haddr_t objno);
|
||||
static hbool_t ref_path_table_find(haddr_t objno);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: init_ref_path_table
|
||||
*
|
||||
* Purpose: Enter the root group ("/") into the path table
|
||||
*
|
||||
* Return: Non-negative on success, negative on failure
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
init_ref_path_table(hid_t fid)
|
||||
{
|
||||
H5G_stat_t sb;
|
||||
haddr_t objno; /* Compact form of object's location */
|
||||
char *root_path;
|
||||
|
||||
/* Set file ID for later queries (XXX: this should be fixed) */
|
||||
thefile = fid;
|
||||
|
||||
/* Create skip list to store reference path information */
|
||||
if((ref_path_table = H5SL_create(H5SL_TYPE_HADDR, 0.5, (size_t)16))==NULL)
|
||||
return (-1);
|
||||
|
||||
if((root_path = HDstrdup("/")) == NULL)
|
||||
return (-1);
|
||||
|
||||
if(H5Gget_objinfo(fid, "/", TRUE, &sb)<0) {
|
||||
/* fatal error? */
|
||||
HDfree(root_path);
|
||||
return (-1);
|
||||
}
|
||||
objno = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
|
||||
/* Insert into table (takes ownership of path) */
|
||||
ref_path_table_put(root_path, objno);
|
||||
|
||||
return(0);
|
||||
}
|
||||
static herr_t fill_ref_path_table_cb(hid_t group, const char *obj_name,
|
||||
const H5L_info_t *linfo, void *op_data);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: free_ref_path_info
|
||||
@ -158,35 +117,31 @@ term_ref_path_table(void)
|
||||
haddr_t
|
||||
ref_path_table_lookup(const char *thepath)
|
||||
{
|
||||
H5G_stat_t sb;
|
||||
haddr_t objno; /* Compact form of object's location */
|
||||
H5O_info_t oi;
|
||||
|
||||
/* Check for external link first, so we don't return the OID of an object in another file */
|
||||
if(H5Gget_objinfo(thefile, thepath, FALSE, &sb)<0)
|
||||
return HADDR_UNDEF;
|
||||
if(sb.type == H5G_LINK) {
|
||||
/* Get object ID for object at path */
|
||||
/* (If the object is not a soft link, we've already retrieved the
|
||||
* correct information and don't have to perform this call. -QAK
|
||||
*/
|
||||
if(H5Gget_objinfo(thefile, thepath, TRUE, &sb)<0)
|
||||
/* fatal error ? */
|
||||
/* Allow lookups on the root group, even though it doesn't have any link info */
|
||||
if(HDstrcmp(thepath, "/")) {
|
||||
H5L_info_t li;
|
||||
|
||||
/* Check for external link first, so we don't return the OID of an object in another file */
|
||||
if(H5Lget_info(thefile, thepath, &li, H5P_DEFAULT) < 0)
|
||||
return HADDR_UNDEF;
|
||||
} else if(sb.type == H5G_UDLINK)
|
||||
{
|
||||
/* UD links can't be followed, so they always "dangle" like
|
||||
* soft links.
|
||||
*/
|
||||
return HADDR_UNDEF;
|
||||
} /* end if */
|
||||
objno = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
|
||||
/* UD links can't be followed, so they always "dangle" like soft links. */
|
||||
if(li.type >= H5L_TYPE_UD_MIN)
|
||||
return HADDR_UNDEF;
|
||||
} /* end if */
|
||||
|
||||
/* Get the object info now */
|
||||
/* (returns failure for dangling soft links) */
|
||||
if(H5Oget_info(thefile, thepath, &oi, H5P_DEFAULT) < 0)
|
||||
return HADDR_UNDEF;
|
||||
|
||||
/* All existing objects in the file had better be in the table */
|
||||
HDassert(ref_path_table_find(objno));
|
||||
HDassert(ref_path_table_find(oi.addr));
|
||||
|
||||
/* Return OID */
|
||||
return(objno);
|
||||
return(oi.addr);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -324,6 +279,65 @@ lookup_ref_path(haddr_t ref)
|
||||
return(node ? node->path : NULL);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: fill_ref_path_table_cb
|
||||
*
|
||||
* Purpose: Called by interator to create references for
|
||||
* all objects and enter them in the table.
|
||||
*
|
||||
* Return: Error status.
|
||||
*
|
||||
* Programmer: REMcG
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
fill_ref_path_table_cb(hid_t group, const char *obj_name, const H5L_info_t *linfo,
|
||||
void *op_data)
|
||||
{
|
||||
if(linfo->type == H5L_TYPE_HARD) {
|
||||
H5O_info_t oinfo;
|
||||
|
||||
H5Oget_info(group, obj_name, &oinfo, H5P_DEFAULT);
|
||||
|
||||
/* Check if the object is already in the path table */
|
||||
if(!ref_path_table_find(oinfo.addr)) {
|
||||
const char *obj_prefix = (const char *)op_data;
|
||||
size_t tmp_len;
|
||||
char *thepath;
|
||||
|
||||
/* Compute length for this object's path */
|
||||
tmp_len = HDstrlen(obj_prefix) + HDstrlen(obj_name) + 2;
|
||||
|
||||
/* Allocate room for the path for this object */
|
||||
if((thepath = (char *)HDmalloc(tmp_len)) == NULL)
|
||||
return FAIL;
|
||||
|
||||
/* Build the name for this object */
|
||||
HDstrcpy(thepath, obj_prefix);
|
||||
HDstrcat(thepath, "/");
|
||||
HDstrcat(thepath, obj_name);
|
||||
|
||||
/* Insert the object into the path table (takes ownership of the path) */
|
||||
ref_path_table_put(thepath, oinfo.addr);
|
||||
|
||||
if(oinfo.type == H5O_TYPE_GROUP) {
|
||||
/* Iterate over objects in this group, using this group's
|
||||
* name as their prefix
|
||||
*/
|
||||
if(H5Literate(group, obj_name, H5_INDEX_NAME, H5_ITER_INC, NULL, fill_ref_path_table_cb, thepath, H5P_DEFAULT) < 0) {
|
||||
error_msg(progname, "unable to dump group \"%s\"\n", thepath);
|
||||
d_status = EXIT_FAILURE;
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: fill_ref_path_table
|
||||
*
|
||||
@ -339,46 +353,32 @@ lookup_ref_path(haddr_t ref)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
fill_ref_path_table(hid_t group, const char *obj_name, const H5L_info_t UNUSED *linfo,
|
||||
void *op_data)
|
||||
fill_ref_path_table(hid_t fid)
|
||||
{
|
||||
const char *obj_prefix = (const char *)op_data;
|
||||
H5G_stat_t statbuf;
|
||||
haddr_t objno; /* Compact form of object's location */
|
||||
H5O_info_t oinfo;
|
||||
char *root_path;
|
||||
|
||||
H5Gget_objinfo(group, obj_name, FALSE, &statbuf);
|
||||
objno = (haddr_t)statbuf.objno[0] | ((haddr_t)statbuf.objno[1] << (8 * sizeof(long)));
|
||||
/* Set file ID for later queries (XXX: this should be fixed) */
|
||||
thefile = fid;
|
||||
|
||||
/* Check if the object is in the path table */
|
||||
if (!ref_path_table_find(objno)) {
|
||||
size_t tmp_len;
|
||||
char *thepath;
|
||||
/* Create skip list to store reference path information */
|
||||
if((ref_path_table = H5SL_create(H5SL_TYPE_HADDR, 0.5, (size_t)16))==NULL)
|
||||
return (-1);
|
||||
|
||||
/* Compute length for this object's path */
|
||||
tmp_len = HDstrlen(obj_prefix) + HDstrlen(obj_name) + 2;
|
||||
/* Build the name for root group */
|
||||
root_path = HDstrdup("/");
|
||||
|
||||
/* Allocate room for the path for this object */
|
||||
if ((thepath = (char *) HDmalloc(tmp_len)) == NULL)
|
||||
return FAIL;
|
||||
/* Get info for root group */
|
||||
H5Oget_info(fid, root_path, &oinfo, H5P_DEFAULT);
|
||||
|
||||
/* Build the name for this object */
|
||||
HDstrcpy(thepath, obj_prefix);
|
||||
HDstrcat(thepath, "/");
|
||||
HDstrcat(thepath, obj_name);
|
||||
/* Insert the root group into the path table (takes ownership of path) */
|
||||
ref_path_table_put(root_path, oinfo.addr);
|
||||
|
||||
/* Insert the object into the path table */
|
||||
ref_path_table_put(thepath, objno);
|
||||
|
||||
if(statbuf.type == H5G_GROUP) {
|
||||
/* Iterate over objects in this group, using this group's
|
||||
* name as their prefix
|
||||
*/
|
||||
if(H5Literate(group, obj_name, H5_INDEX_NAME, H5_ITER_INC, NULL, fill_ref_path_table, thepath, H5P_DEFAULT) < 0) {
|
||||
error_msg(progname, "unable to dump group \"%s\"\n", obj_name);
|
||||
d_status = EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Iterate over objects in this file */
|
||||
if(H5Literate(fid, root_path, H5_INDEX_NAME, H5_ITER_INC, NULL, fill_ref_path_table_cb, (void *)"", H5P_DEFAULT) < 0) {
|
||||
error_msg(progname, "unable to dump root group\n");
|
||||
d_status = EXIT_FAILURE;
|
||||
} /* end if */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -22,14 +22,13 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int init_ref_path_table(hid_t fid);
|
||||
herr_t fill_ref_path_table(hid_t fid);
|
||||
const char *lookup_ref_path(haddr_t ref);
|
||||
herr_t fill_ref_path_table(hid_t, const char *, const H5L_info_t *, void *);
|
||||
int get_next_xid(void);
|
||||
haddr_t get_fake_xid (void);
|
||||
haddr_t ref_path_table_lookup(const char *);
|
||||
haddr_t ref_path_table_gen_fake(const char *);
|
||||
int term_ref_path_table(void);
|
||||
haddr_t get_fake_xid(void);
|
||||
haddr_t ref_path_table_lookup(const char *);
|
||||
haddr_t ref_path_table_gen_fake(const char *);
|
||||
int term_ref_path_table(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -308,12 +308,12 @@ h5tools_str_fmt(h5tools_str_t *str/*in,out*/, size_t start, const char *fmt)
|
||||
*/
|
||||
char *
|
||||
h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info,
|
||||
hsize_t elmtno, int ndims, hsize_t min_idx[],
|
||||
hsize_t elmtno, unsigned ndims, hsize_t min_idx[],
|
||||
hsize_t max_idx[], h5tools_context_t *ctx)
|
||||
{
|
||||
hsize_t p_prod[H5S_MAX_RANK];
|
||||
size_t i = 0;
|
||||
hsize_t curr_pos=elmtno;
|
||||
hsize_t curr_pos = elmtno;
|
||||
|
||||
h5tools_str_reset(str);
|
||||
|
||||
@ -325,10 +325,9 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info,
|
||||
for (i = ndims - 1, p_prod[ndims - 1] = 1; i > 0; --i)
|
||||
p_prod[i - 1] = (max_idx[i] - min_idx[i]) * p_prod[i];
|
||||
|
||||
for ( i = 0; i < (size_t)ndims; i++)
|
||||
{
|
||||
ctx->pos[i] = curr_pos/ctx->acc[i];
|
||||
curr_pos -= ctx->acc[i]*ctx->pos[i];
|
||||
for ( i = 0; i < (size_t)ndims; i++) {
|
||||
ctx->pos[i] = curr_pos/ctx->acc[i];
|
||||
curr_pos -= ctx->acc[i]*ctx->pos[i];
|
||||
}
|
||||
assert( curr_pos == 0 );
|
||||
|
||||
@ -580,31 +579,22 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
|
||||
char *cp_vp = (char *)vp;
|
||||
hid_t memb, obj, region;
|
||||
unsigned nmembs;
|
||||
int otype;
|
||||
static char fmt_llong[8], fmt_ullong[8];
|
||||
H5T_str_t pad;
|
||||
H5G_stat_t sb;
|
||||
|
||||
/*
|
||||
* some tempvars to store the value before we append it to the string to
|
||||
* get rid of the memory alignment problem
|
||||
*/
|
||||
double tempdouble;
|
||||
float tempfloat;
|
||||
unsigned long_long tempullong;
|
||||
long_long templlong;
|
||||
unsigned long tempulong;
|
||||
long templong;
|
||||
unsigned int tempuint;
|
||||
int tempint;
|
||||
unsigned short tempushort;
|
||||
short tempshort;
|
||||
#if H5_SIZEOF_LONG_DOUBLE !=0
|
||||
long double templdouble;
|
||||
#endif
|
||||
|
||||
/* Build default formats for long long types */
|
||||
if (!fmt_llong[0]) {
|
||||
if(!fmt_llong[0]) {
|
||||
sprintf(fmt_llong, "%%%sd", H5_PRINTF_LL_WIDTH);
|
||||
sprintf(fmt_ullong, "%%%su", H5_PRINTF_LL_WIDTH);
|
||||
}
|
||||
@ -612,29 +602,37 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
|
||||
/* Append value depending on data type */
|
||||
start = h5tools_str_len(str);
|
||||
|
||||
if (info->raw) {
|
||||
if(info->raw) {
|
||||
size_t i;
|
||||
|
||||
n = H5Tget_size(type);
|
||||
if (1==n) {
|
||||
h5tools_str_append(str, OPT(info->fmt_raw, "0x%02x"), ucp_vp[0]);
|
||||
} else {
|
||||
for (i = 0; i < n; i++) {
|
||||
if (i) h5tools_str_append(str, ":");
|
||||
h5tools_str_append(str, OPT(info->fmt_raw, "%02x"), ucp_vp[i]);
|
||||
for(i = 0; i < n; i++) {
|
||||
if(i)
|
||||
h5tools_str_append(str, ":");
|
||||
h5tools_str_append(str, OPT(info->fmt_raw, "%02x"), ucp_vp[i]);
|
||||
}
|
||||
}
|
||||
} else if (H5Tequal(type, H5T_NATIVE_FLOAT)) {
|
||||
memcpy(&tempfloat, vp, sizeof(float));
|
||||
float tempfloat;
|
||||
|
||||
HDmemcpy(&tempfloat, vp, sizeof(float));
|
||||
h5tools_str_append(str, OPT(info->fmt_float, "%g"), tempfloat);
|
||||
} else if (H5Tequal(type, H5T_NATIVE_DOUBLE)) {
|
||||
memcpy(&tempdouble, vp, sizeof(double));
|
||||
h5tools_str_append(str, OPT(info->fmt_double, "%g"), tempdouble);
|
||||
double tempdouble;
|
||||
|
||||
HDmemcpy(&tempdouble, vp, sizeof(double));
|
||||
h5tools_str_append(str, OPT(info->fmt_double, "%g"), tempdouble);
|
||||
#if H5_SIZEOF_LONG_DOUBLE !=0
|
||||
} else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) {
|
||||
memcpy(&templdouble, vp, sizeof(long double));
|
||||
h5tools_str_append(str, "%Lf", templdouble);
|
||||
long double templdouble;
|
||||
|
||||
HDmemcpy(&templdouble, vp, sizeof(long double));
|
||||
h5tools_str_append(str, "%Lf", templdouble);
|
||||
#endif
|
||||
} else if (info->ascii && (H5Tequal(type, H5T_NATIVE_SCHAR) ||
|
||||
} else if (info->ascii && (H5Tequal(type, H5T_NATIVE_SCHAR) ||
|
||||
H5Tequal(type, H5T_NATIVE_UCHAR))) {
|
||||
h5tools_print_char(str, info, (char)(*ucp_vp));
|
||||
} else if (H5T_STRING == H5Tget_class(type)) {
|
||||
@ -713,32 +711,36 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
|
||||
h5tools_str_append(str, "\"\"");
|
||||
} /* end else */
|
||||
} else if (H5Tequal(type, H5T_NATIVE_INT)) {
|
||||
memcpy(&tempint, vp, sizeof(int));
|
||||
HDmemcpy(&tempint, vp, sizeof(int));
|
||||
h5tools_str_append(str, OPT(info->fmt_int, "%d"), tempint);
|
||||
} else if (H5Tequal(type, H5T_NATIVE_UINT)) {
|
||||
memcpy(&tempuint, vp, sizeof(unsigned int));
|
||||
HDmemcpy(&tempuint, vp, sizeof(unsigned int));
|
||||
h5tools_str_append(str, OPT(info->fmt_uint, "%u"), tempuint);
|
||||
} else if (H5Tequal(type, H5T_NATIVE_SCHAR)) {
|
||||
h5tools_str_append(str, OPT(info->fmt_schar, "%d"), *cp_vp);
|
||||
} else if (H5Tequal(type, H5T_NATIVE_UCHAR)) {
|
||||
h5tools_str_append(str, OPT(info->fmt_uchar, "%u"), *ucp_vp);
|
||||
} else if (H5Tequal(type, H5T_NATIVE_SHORT)) {
|
||||
memcpy(&tempshort, vp, sizeof(short));
|
||||
short tempshort;
|
||||
|
||||
HDmemcpy(&tempshort, vp, sizeof(short));
|
||||
h5tools_str_append(str, OPT(info->fmt_short, "%d"), tempshort);
|
||||
} else if (H5Tequal(type, H5T_NATIVE_USHORT)) {
|
||||
memcpy(&tempushort, vp, sizeof(unsigned short));
|
||||
unsigned short tempushort;
|
||||
|
||||
HDmemcpy(&tempushort, vp, sizeof(unsigned short));
|
||||
h5tools_str_append(str, OPT(info->fmt_ushort, "%u"), tempushort);
|
||||
} else if (H5Tequal(type, H5T_NATIVE_LONG)) {
|
||||
memcpy(&templong, vp, sizeof(long));
|
||||
HDmemcpy(&templong, vp, sizeof(long));
|
||||
h5tools_str_append(str, OPT(info->fmt_long, "%ld"), templong);
|
||||
} else if (H5Tequal(type, H5T_NATIVE_ULONG)) {
|
||||
memcpy(&tempulong, vp, sizeof(unsigned long));
|
||||
HDmemcpy(&tempulong, vp, sizeof(unsigned long));
|
||||
h5tools_str_append(str, OPT(info->fmt_ulong, "%lu"), tempulong);
|
||||
} else if (H5Tequal(type, H5T_NATIVE_LLONG)) {
|
||||
memcpy(&templlong, vp, sizeof(long_long));
|
||||
HDmemcpy(&templlong, vp, sizeof(long_long));
|
||||
h5tools_str_append(str, OPT(info->fmt_llong, fmt_llong), templlong);
|
||||
} else if (H5Tequal(type, H5T_NATIVE_ULLONG)) {
|
||||
memcpy(&tempullong, vp, sizeof(unsigned long_long));
|
||||
HDmemcpy(&tempullong, vp, sizeof(unsigned long_long));
|
||||
h5tools_str_append(str, OPT(info->fmt_ullong, fmt_ullong), tempullong);
|
||||
} else if (H5Tequal(type, H5T_NATIVE_HSSIZE)) {
|
||||
if (sizeof(hssize_t) == sizeof(int)) {
|
||||
@ -849,7 +851,6 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
|
||||
|
||||
obj = H5Rdereference(container, H5R_DATASET_REGION, vp);
|
||||
region = H5Rget_region(container, H5R_DATASET_REGION, vp);
|
||||
H5Gget_objinfo(obj, ".", FALSE, &sb);
|
||||
|
||||
/* get name of the dataset the region reference points to using H5Rget_name */
|
||||
H5Rget_name(obj, H5R_DATASET_REGION, vp, (char*)ref_name, 1024);
|
||||
@ -867,47 +868,46 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
|
||||
if (h5tools_is_zero(vp, H5Tget_size(type))) {
|
||||
h5tools_str_append(str, "NULL");
|
||||
} else {
|
||||
haddr_t objno; /* Compact form of object's location */
|
||||
H5O_info_t oi;
|
||||
const char *path;
|
||||
|
||||
otype = H5Rget_obj_type(container, H5R_OBJECT, vp);
|
||||
obj = H5Rdereference(container, H5R_OBJECT, vp);
|
||||
H5Gget_objinfo(obj, ".", FALSE, &sb);
|
||||
H5Oget_info(obj, ".", &oi, H5P_DEFAULT);
|
||||
|
||||
/* Print object type and close object */
|
||||
switch (otype) {
|
||||
case H5G_GROUP:
|
||||
switch(oi.type) {
|
||||
case H5O_TYPE_GROUP:
|
||||
h5tools_str_append(str, H5_TOOLS_GROUP);
|
||||
H5Gclose(obj);
|
||||
break;
|
||||
case H5G_DATASET:
|
||||
|
||||
case H5O_TYPE_DATASET:
|
||||
h5tools_str_append(str, H5_TOOLS_DATASET);
|
||||
H5Dclose(obj);
|
||||
break;
|
||||
case H5G_TYPE:
|
||||
|
||||
case H5O_TYPE_NAMED_DATATYPE:
|
||||
h5tools_str_append(str, H5_TOOLS_DATATYPE);
|
||||
H5Tclose(obj);
|
||||
break;
|
||||
|
||||
default:
|
||||
h5tools_str_append(str, "%u-", otype);
|
||||
h5tools_str_append(str, "%u-", (unsigned)oi.type);
|
||||
break;
|
||||
}
|
||||
} /* end switch */
|
||||
H5Oclose(obj);
|
||||
|
||||
/* Print OID */
|
||||
objno = (haddr_t)sb.objno[0] | ((haddr_t)sb.objno[1] << (8 * sizeof(long)));
|
||||
if (info->obj_hidefileno)
|
||||
h5tools_str_append(str, info->obj_format, objno);
|
||||
if(info->obj_hidefileno)
|
||||
h5tools_str_append(str, info->obj_format, oi.addr);
|
||||
else
|
||||
h5tools_str_append(str, info->obj_format, sb.fileno[0], objno);
|
||||
h5tools_str_append(str, info->obj_format, oi.fileno, oi.addr);
|
||||
|
||||
/* Print name */
|
||||
path = lookup_ref_path(*(haddr_t *)vp);
|
||||
if (path) {
|
||||
h5tools_str_append(str, " ");
|
||||
h5tools_str_append(str, path);
|
||||
h5tools_str_append(str, " ");
|
||||
}
|
||||
}
|
||||
h5tools_str_append(str, " ");
|
||||
h5tools_str_append(str, path);
|
||||
h5tools_str_append(str, " ");
|
||||
} /* end if */
|
||||
} /* end else */
|
||||
} else if (H5Tget_class(type) == H5T_ARRAY) {
|
||||
int k, ndims;
|
||||
hsize_t i, dims[H5S_MAX_RANK],temp_nelmts;
|
||||
@ -929,25 +929,23 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
|
||||
/* Print the opening bracket */
|
||||
h5tools_str_append(str, "%s", OPT(info->arr_pre, "["));
|
||||
|
||||
for (i = 0; i < nelmts; i++) {
|
||||
if (i)
|
||||
for(i = 0; i < nelmts; i++) {
|
||||
if(i)
|
||||
h5tools_str_append(str, "%s",
|
||||
OPT(info->arr_sep, "," OPTIONAL_LINE_BREAK));
|
||||
|
||||
if (info->arr_linebreak && i && i % dims[ndims - 1] == 0) {
|
||||
if(info->arr_linebreak && i && i % dims[ndims - 1] == 0) {
|
||||
int x;
|
||||
|
||||
h5tools_str_append(str, "%s", "\n");
|
||||
|
||||
/*need to indent some more here*/
|
||||
if (ctx->indent_level >= 0 )
|
||||
{
|
||||
if (!info->pindex)
|
||||
h5tools_str_append(str, "%s", OPT(info->line_pre, ""));
|
||||
}
|
||||
/* need to indent some more here*/
|
||||
if(ctx->indent_level >= 0)
|
||||
if(!info->pindex)
|
||||
h5tools_str_append(str, "%s", OPT(info->line_pre, ""));
|
||||
|
||||
for (x = 0; x < ctx->indent_level + 1; x++)
|
||||
h5tools_str_append(str,"%s",OPT(info->line_indent,""));
|
||||
for(x = 0; x < ctx->indent_level + 1; x++)
|
||||
h5tools_str_append(str, "%s", OPT(info->line_indent, ""));
|
||||
} /* end if */
|
||||
else if(i && info->arr_sep)
|
||||
h5tools_str_append(str, " ");
|
||||
@ -961,7 +959,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
|
||||
} /* end for */
|
||||
|
||||
/* Print the closing bracket */
|
||||
h5tools_str_append(str, "%s", OPT(info->arr_suf, "]"));
|
||||
h5tools_str_append(str, "%s", OPT(info->arr_suf, "]"));
|
||||
H5Tclose(memb);
|
||||
} else if (H5Tget_class(type) == H5T_VLEN) {
|
||||
unsigned int i;
|
||||
|
@ -33,7 +33,7 @@ extern char *h5tools_str_reset(h5tools_str_t *str);
|
||||
extern char *h5tools_str_trunc(h5tools_str_t *str, size_t size);
|
||||
extern char *h5tools_str_fmt(h5tools_str_t *str, size_t start, const char *fmt);
|
||||
extern char *h5tools_str_prefix(h5tools_str_t *str, const h5tool_format_t *info,
|
||||
hsize_t elmtno, int ndims, hsize_t min_idx[],
|
||||
hsize_t elmtno, unsigned ndims, hsize_t min_idx[],
|
||||
hsize_t max_idx[], h5tools_context_t *ctx);
|
||||
extern int h5tools_str_dump_region(h5tools_str_t *, hid_t, const h5tool_format_t *);
|
||||
extern char *h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info,
|
||||
|
@ -483,26 +483,23 @@ build_obj_path_name(const char *prefix, const char *name)
|
||||
static herr_t
|
||||
find_objs_cb(hid_t group, const char *name, const H5L_info_t UNUSED *linfo, void *op_data)
|
||||
{
|
||||
H5G_stat_t statbuf;
|
||||
H5O_info_t oinfo;
|
||||
find_objs_t *info = (find_objs_t*)op_data;
|
||||
herr_t ret_value = 0;
|
||||
|
||||
if(H5Gget_objinfo(group, name, FALSE, &statbuf) < 0)
|
||||
if(H5Oget_info(group, name, &oinfo, H5P_DEFAULT) < 0)
|
||||
; /* keep going */
|
||||
else {
|
||||
haddr_t objno; /* Compact form of object's location */
|
||||
|
||||
objno = (haddr_t)statbuf.objno[0] | ((haddr_t)statbuf.objno[1] << (8 * sizeof(long)));
|
||||
switch (statbuf.type) {
|
||||
switch(oinfo.type) {
|
||||
char *tmp;
|
||||
size_t tmp_len;
|
||||
|
||||
case H5G_GROUP:
|
||||
if (search_obj(info->group_table, objno) == NULL) {
|
||||
case H5O_TYPE_GROUP:
|
||||
if(search_obj(info->group_table, oinfo.addr) == NULL) {
|
||||
char *old_prefix;
|
||||
|
||||
tmp = build_obj_path_name(info->prefix, name);
|
||||
add_obj(info->group_table, objno, tmp, TRUE);
|
||||
add_obj(info->group_table, oinfo.addr, tmp, TRUE);
|
||||
|
||||
old_prefix = info->prefix;
|
||||
tmp_len = HDstrlen(tmp);
|
||||
@ -516,44 +513,42 @@ find_objs_cb(hid_t group, const char *name, const H5L_info_t UNUSED *linfo, void
|
||||
} /* end if */
|
||||
break;
|
||||
|
||||
case H5G_DATASET:
|
||||
if (search_obj(info->dset_table, objno) == NULL) {
|
||||
case H5O_TYPE_DATASET:
|
||||
if(search_obj(info->dset_table, oinfo.addr) == NULL) {
|
||||
hid_t dset;
|
||||
|
||||
tmp = build_obj_path_name(info->prefix, name);
|
||||
add_obj(info->dset_table, objno, tmp, TRUE);
|
||||
add_obj(info->dset_table, oinfo.addr, tmp, TRUE);
|
||||
|
||||
if ((dset = H5Dopen (group, name)) >= 0) {
|
||||
if((dset = H5Dopen (group, name)) >= 0) {
|
||||
hid_t type;
|
||||
|
||||
type = H5Dget_type(dset);
|
||||
|
||||
if (H5Tcommitted(type) > 0) {
|
||||
H5Gget_objinfo(type, ".", TRUE, &statbuf);
|
||||
objno = (haddr_t)statbuf.objno[0] | ((haddr_t)statbuf.objno[1] << (8 * sizeof(long)));
|
||||
|
||||
if (search_obj(info->type_table, objno) == NULL) {
|
||||
if(H5Tcommitted(type) > 0) {
|
||||
H5Oget_info(type, ".", &oinfo, H5P_DEFAULT);
|
||||
if (search_obj(info->type_table, oinfo.addr) == NULL) {
|
||||
char *type_name = HDstrdup(tmp);
|
||||
|
||||
add_obj(info->type_table, objno, type_name, FALSE);
|
||||
add_obj(info->type_table, oinfo.addr, type_name, FALSE);
|
||||
} /* end if */
|
||||
}
|
||||
} /* end if */
|
||||
|
||||
H5Tclose(type);
|
||||
H5Dclose(dset);
|
||||
} else {
|
||||
} /* end if */
|
||||
else
|
||||
ret_value = FAIL;
|
||||
}
|
||||
} /* end if */
|
||||
break;
|
||||
|
||||
case H5G_TYPE:
|
||||
case H5O_TYPE_NAMED_DATATYPE:
|
||||
{
|
||||
obj_t *found_obj;
|
||||
|
||||
tmp = build_obj_path_name(info->prefix, name);
|
||||
if ((found_obj = search_obj(info->type_table, objno)) == NULL)
|
||||
add_obj(info->type_table, objno, tmp, TRUE);
|
||||
if((found_obj = search_obj(info->type_table, oinfo.addr)) == NULL)
|
||||
add_obj(info->type_table, oinfo.addr, tmp, TRUE);
|
||||
else {
|
||||
/* Use latest version of name */
|
||||
HDfree(found_obj->objname);
|
||||
@ -594,6 +589,8 @@ herr_t
|
||||
init_objs(hid_t fid, find_objs_t *info, table_t **group_table,
|
||||
table_t **dset_table, table_t **type_table)
|
||||
{
|
||||
H5O_info_t oinfo;
|
||||
|
||||
/* Initialize the tables */
|
||||
init_table(group_table);
|
||||
init_table(dset_table);
|
||||
@ -605,25 +602,15 @@ init_objs(hid_t fid, find_objs_t *info, table_t **group_table,
|
||||
info->type_table = *type_table;
|
||||
info->dset_table = *dset_table;
|
||||
|
||||
{
|
||||
/* add the root group as an object, it may have hard links to it */
|
||||
|
||||
H5G_stat_t statbuf;
|
||||
haddr_t objno; /* compact form of object's location */
|
||||
char* tmp;
|
||||
|
||||
if(H5Gget_objinfo(fid, "/", FALSE, &statbuf) < 0)
|
||||
return FAIL;
|
||||
else
|
||||
{
|
||||
objno = (haddr_t)statbuf.objno[0] | ((haddr_t)statbuf.objno[1] << (8 * sizeof(long)));
|
||||
/* call with an empty string, it appends group separator */
|
||||
tmp = build_obj_path_name(info->prefix, "");
|
||||
add_obj(info->group_table, objno, tmp, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/* add the root group as an object, it may have hard links to it */
|
||||
if(H5Oget_info(fid, "/", &oinfo, H5P_DEFAULT) < 0)
|
||||
return FAIL;
|
||||
else {
|
||||
/* call with an empty string, it appends '/' group separator */
|
||||
char *tmp = build_obj_path_name(info->prefix, "");
|
||||
|
||||
add_obj(info->group_table, oinfo.addr, tmp, TRUE);
|
||||
} /* end else */
|
||||
|
||||
/* Find all shared objects */
|
||||
return(H5Literate(fid, "/", H5_INDEX_NAME, H5_ITER_INC, NULL, find_objs_cb, (void *)info, H5P_DEFAULT));
|
||||
|
@ -171,11 +171,13 @@ traverse_cb(hid_t loc_id, const char *link_name, const H5L_info_t *linfo,
|
||||
is_group = (oinfo.type == H5O_TYPE_GROUP) ? TRUE : FALSE;
|
||||
|
||||
/* Make 'visit object' callback */
|
||||
(*udata->visitor->visit_obj)(link_path, &oinfo, already_visited, udata->visitor->udata);
|
||||
if(udata->visitor->visit_obj)
|
||||
(*udata->visitor->visit_obj)(link_path, &oinfo, already_visited, udata->visitor->udata);
|
||||
} /* end if */
|
||||
else {
|
||||
/* Make 'visit link' callback */
|
||||
(*udata->visitor->visit_lnk)(link_path, linfo, udata->visitor->udata);
|
||||
if(udata->visitor->visit_lnk)
|
||||
(*udata->visitor->visit_lnk)(link_path, linfo, udata->visitor->udata);
|
||||
} /* end else */
|
||||
|
||||
/* Check for group that we haven't visited yet & recurse */
|
||||
@ -267,7 +269,7 @@ traverse(hid_t file_id, const trav_visitor_t *visitor)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static void
|
||||
trav_info_add(trav_info_t *info, const char *path, H5G_obj_t obj_type)
|
||||
trav_info_add(trav_info_t *info, const char *path, h5trav_type_t obj_type)
|
||||
{
|
||||
size_t idx; /* Index of address to use */
|
||||
|
||||
@ -302,8 +304,8 @@ trav_info_visit_obj(const char *path, const H5O_info_t *oinfo,
|
||||
hbool_t UNUSED already_visited, void *udata)
|
||||
{
|
||||
/* Add the object to the 'info' struct */
|
||||
/* (object types map directly to "group" types) */
|
||||
trav_info_add((trav_info_t *)udata, path, (H5G_obj_t)oinfo->type);
|
||||
/* (object types map directly to "traversal" types) */
|
||||
trav_info_add((trav_info_t *)udata, path, (h5trav_type_t)oinfo->type);
|
||||
|
||||
return(0);
|
||||
} /* end trav_info_visit_obj() */
|
||||
@ -326,7 +328,7 @@ static int
|
||||
trav_info_visit_lnk(const char *path, const H5L_info_t *linfo, void *udata)
|
||||
{
|
||||
/* Add the link to the 'info' struct */
|
||||
trav_info_add((trav_info_t *)udata, path, ((linfo->type == H5L_TYPE_SOFT) ? H5G_LINK : H5G_UDLINK));
|
||||
trav_info_add((trav_info_t *)udata, path, ((linfo->type == H5L_TYPE_SOFT) ? H5TRAV_TYPE_LINK : H5TRAV_TYPE_UDLINK));
|
||||
|
||||
return(0);
|
||||
} /* end trav_info_visit_lnk() */
|
||||
@ -647,7 +649,7 @@ trav_table_add(trav_table_t *table,
|
||||
table->objs[new].objno = oinfo ? oinfo->addr : HADDR_UNDEF;
|
||||
table->objs[new].flags[0] = table->objs[new].flags[1] = 0;
|
||||
table->objs[new].name = (char *)HDstrdup(path);
|
||||
table->objs[new].type = oinfo ? (H5G_obj_t)oinfo->type : H5G_LINK;
|
||||
table->objs[new].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK;
|
||||
table->objs[new].nlinks = 0;
|
||||
table->objs[new].sizelinks = 0;
|
||||
table->objs[new].links = NULL;
|
||||
@ -707,7 +709,7 @@ trav_table_addlink(trav_table_t *table,
|
||||
|
||||
void trav_table_addflags(unsigned *flags,
|
||||
char *name,
|
||||
H5G_obj_t type,
|
||||
h5trav_type_t type,
|
||||
trav_table_t *table)
|
||||
{
|
||||
unsigned int new;
|
||||
@ -715,7 +717,7 @@ void trav_table_addflags(unsigned *flags,
|
||||
if(table->nobjs == table->size) {
|
||||
table->size = MAX(1, table->size * 2);
|
||||
table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t));
|
||||
}
|
||||
} /* end if */
|
||||
|
||||
new = table->nobjs++;
|
||||
table->objs[new].objno = 0;
|
||||
|
@ -19,22 +19,32 @@
|
||||
#include "hdf5.h"
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* public struct to store name and type of an object
|
||||
* public enum to specify type of an object
|
||||
* the TYPE can be:
|
||||
* H5G_UNKNOWN = -1,
|
||||
* H5G_GROUP, Object is a group
|
||||
* H5G_DATASET, Object is a dataset
|
||||
* H5G_TYPE, Object is a named data type
|
||||
* H5G_LINK, Object is a symbolic link
|
||||
* H5TRAV_TYPE_UNKNOWN = -1,
|
||||
* H5TRAV_TYPE_GROUP, Object is a group
|
||||
* H5TRAV_TYPE_DATASET, Object is a dataset
|
||||
* H5TRAV_TYPE_TYPE, Object is a named datatype
|
||||
* H5TRAV_TYPE_LINK, Object is a symbolic link
|
||||
* H5TRAV_TYPE_UDLINK, Object is a user-defined link
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
typedef enum {
|
||||
H5TRAV_TYPE_UNKNOWN = -1, /* Unknown object type */
|
||||
H5TRAV_TYPE_GROUP, /* Object is a group */
|
||||
H5TRAV_TYPE_DATASET, /* Object is a dataset */
|
||||
H5TRAV_TYPE_NAMED_DATATYPE, /* Object is a named datatype */
|
||||
H5TRAV_TYPE_LINK, /* Object is a symbolic link */
|
||||
H5TRAV_TYPE_UDLINK /* Object is a user-defined link */
|
||||
} h5trav_type_t;
|
||||
|
||||
typedef H5G_obj_t H5G_obj_t1;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* public struct to store name and type of an object
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
typedef struct trav_path_t {
|
||||
char *path;
|
||||
H5G_obj_t type;
|
||||
h5trav_type_t type;
|
||||
} trav_path_t;
|
||||
|
||||
typedef struct trav_info_t {
|
||||
@ -59,10 +69,10 @@ typedef struct trav_link_t {
|
||||
*/
|
||||
|
||||
typedef struct trav_obj_t {
|
||||
haddr_t objno; /* object number from H5Gget_objinfo */
|
||||
haddr_t objno; /* object address */
|
||||
unsigned flags[2]; /* h5diff.object is present or not in both files*/
|
||||
char *name; /* name */
|
||||
H5G_obj_t type; /* type of object */
|
||||
h5trav_type_t type; /* type of object */
|
||||
trav_link_t *links; /* array of possible link names */
|
||||
size_t sizelinks; /* size of links array */
|
||||
size_t nlinks; /* number of links */
|
||||
@ -135,9 +145,8 @@ void trav_table_free(trav_table_t *table);
|
||||
|
||||
void trav_table_addflags(unsigned *flags,
|
||||
char *objname,
|
||||
H5G_obj_t type,
|
||||
h5trav_type_t type,
|
||||
trav_table_t *table);
|
||||
|
||||
#endif /* H5TRAV_H__ */
|
||||
|
||||
|
||||
|
@ -16,12 +16,7 @@
|
||||
#ifndef _PH5DIFF_H__
|
||||
#define _PH5DIFF_H__
|
||||
|
||||
/* use a larger output buffer for Tflops which does not support vsnprintf. */
|
||||
#ifdef __PUMAGON__
|
||||
#define PRINT_DATA_MAX_SIZE 512
|
||||
#else
|
||||
#define PRINT_DATA_MAX_SIZE 512
|
||||
#endif
|
||||
#define OUTBUFF_SIZE (PRINT_DATA_MAX_SIZE*4)
|
||||
/* Send from manager to workers */
|
||||
#define MPI_TAG_ARGS 1
|
||||
@ -41,7 +36,7 @@ extern int g_nTasks;
|
||||
extern unsigned char g_Parallel;
|
||||
extern char outBuff[];
|
||||
extern int outBuffOffset;
|
||||
extern FILE* overflow_file;
|
||||
extern FILE * overflow_file;
|
||||
|
||||
struct diff_args
|
||||
{
|
||||
@ -60,5 +55,5 @@ struct diffs_found
|
||||
#include <mpi.h>
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _PH5DIFF_H__ */
|
||||
|
||||
|
@ -11,7 +11,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/A/B1/simple Dataset {6/6}
|
||||
Location: 1:90216
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/A/B2 Group
|
||||
@ -20,7 +19,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/A/B2/simple2 Dataset {6/6}
|
||||
Location: 1:94456
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/C Group
|
||||
@ -32,7 +30,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/C/D/simple Dataset {6/6}
|
||||
Location: 1:97664
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/E Group
|
||||
@ -47,20 +44,17 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/E/F/grp_dsets/chunk Dataset {6/6}
|
||||
Location: 1:102744
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/E/F/grp_dsets/compact Dataset {6/6}
|
||||
Location: 1:103200
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/E/F/grp_dsets/compound Dataset {2/2}
|
||||
Location: 1:103336
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: struct {
|
||||
"str1" +0 20-byte null-terminated ASCII string
|
||||
@ -69,7 +63,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/E/F/grp_dsets/compressed Dataset {6/6}
|
||||
Location: 1:103552
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Filter-0: deflate-1 OPT {1}
|
||||
@ -77,14 +70,12 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/E/F/grp_dsets/named_vl Dataset {2/2}
|
||||
Location: 1:103768
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: shared-1:103720 variable length of
|
||||
32-bit little-endian integer
|
||||
/E/F/grp_dsets/nested_vl Dataset {2/2}
|
||||
Location: 1:112240
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: variable length of
|
||||
variable length of
|
||||
@ -92,7 +83,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/E/F/grp_dsets/simple Dataset {6/6}
|
||||
Location: 1:112384
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/E/F/grp_dsets/vl Type
|
||||
@ -115,20 +105,17 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/G/H/grp_nested/grp_dsets/chunk Dataset {6/6}
|
||||
Location: 1:118088
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/G/H/grp_nested/grp_dsets/compact Dataset {6/6}
|
||||
Location: 1:120688
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/G/H/grp_nested/grp_dsets/compound Dataset {2/2}
|
||||
Location: 1:120824
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: struct {
|
||||
"str1" +0 20-byte null-terminated ASCII string
|
||||
@ -137,7 +124,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/G/H/grp_nested/grp_dsets/compressed Dataset {6/6}
|
||||
Location: 1:123136
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Filter-0: deflate-1 OPT {1}
|
||||
@ -145,14 +131,12 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/G/H/grp_nested/grp_dsets/named_vl Dataset {2/2}
|
||||
Location: 1:127448
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: shared-1:123304 variable length of
|
||||
32-bit little-endian integer
|
||||
/G/H/grp_nested/grp_dsets/nested_vl Dataset {2/2}
|
||||
Location: 1:127576
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: variable length of
|
||||
variable length of
|
||||
@ -160,7 +144,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/G/H/grp_nested/grp_dsets/simple Dataset {6/6}
|
||||
Location: 1:127720
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/G/H/grp_nested/grp_dsets/vl Type
|
||||
@ -171,20 +154,17 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/chunk Dataset {6/6}
|
||||
Location: 1:6216
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/compact Dataset {6/6}
|
||||
Location: 1:6344
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/compound Dataset {2/2}
|
||||
Location: 1:8528
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: struct {
|
||||
"str1" +0 20-byte null-terminated ASCII string
|
||||
@ -193,7 +173,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/compressed Dataset {6/6}
|
||||
Location: 1:12888
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Filter-0: deflate-1 OPT {1}
|
||||
@ -204,20 +183,17 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_dsets/chunk Dataset {6/6}
|
||||
Location: 1:35896
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_dsets/compact Dataset {6/6}
|
||||
Location: 1:36352
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_dsets/compound Dataset {2/2}
|
||||
Location: 1:36488
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: struct {
|
||||
"str1" +0 20-byte null-terminated ASCII string
|
||||
@ -226,7 +202,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_dsets/compressed Dataset {6/6}
|
||||
Location: 1:36704
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Filter-0: deflate-1 OPT {1}
|
||||
@ -234,14 +209,12 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_dsets/named_vl Dataset {2/2}
|
||||
Location: 1:36920
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: shared-1:36872 variable length of
|
||||
32-bit little-endian integer
|
||||
/grp_dsets/nested_vl Dataset {2/2}
|
||||
Location: 1:45392
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: variable length of
|
||||
variable length of
|
||||
@ -249,13 +222,11 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_dsets/simple Dataset {6/6}
|
||||
Location: 1:45536
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_dsets/simple_group Dataset {6/6}
|
||||
Location: 1:61744
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_dsets/vl Type
|
||||
@ -275,20 +246,17 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_nested/grp_dsets/chunk Dataset {6/6}
|
||||
Location: 1:49256
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_nested/grp_dsets/compact Dataset {6/6}
|
||||
Location: 1:51856
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_nested/grp_dsets/compound Dataset {2/2}
|
||||
Location: 1:51992
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: struct {
|
||||
"str1" +0 20-byte null-terminated ASCII string
|
||||
@ -297,7 +265,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_nested/grp_dsets/compressed Dataset {6/6}
|
||||
Location: 1:54304
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Filter-0: deflate-1 OPT {1}
|
||||
@ -305,14 +272,12 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_nested/grp_dsets/named_vl Dataset {2/2}
|
||||
Location: 1:58616
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: shared-1:54472 variable length of
|
||||
32-bit little-endian integer
|
||||
/grp_nested/grp_dsets/nested_vl Dataset {2/2}
|
||||
Location: 1:58744
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: variable length of
|
||||
variable length of
|
||||
@ -320,7 +285,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_nested/grp_dsets/simple Dataset {6/6}
|
||||
Location: 1:58888
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_nested/grp_dsets/vl Type
|
||||
@ -334,20 +298,17 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_rename/chunk Dataset {6/6}
|
||||
Location: 1:65088
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_rename/compact Dataset {6/6}
|
||||
Location: 1:65544
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_rename/compound Dataset {2/2}
|
||||
Location: 1:65680
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: struct {
|
||||
"str1" +0 20-byte null-terminated ASCII string
|
||||
@ -356,7 +317,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_rename/compressed Dataset {6/6}
|
||||
Location: 1:65896
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Filter-0: deflate-1 OPT {1}
|
||||
@ -367,20 +327,17 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_rename/grp_dsets/chunk Dataset {6/6}
|
||||
Location: 1:78072
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_rename/grp_dsets/compact Dataset {6/6}
|
||||
Location: 1:78528
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_rename/grp_dsets/compound Dataset {2/2}
|
||||
Location: 1:78664
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: struct {
|
||||
"str1" +0 20-byte null-terminated ASCII string
|
||||
@ -389,7 +346,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_rename/grp_dsets/compressed Dataset {6/6}
|
||||
Location: 1:78880
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Chunks: {2} 8 bytes
|
||||
Storage: <details removed for portability>
|
||||
Filter-0: deflate-1 OPT {1}
|
||||
@ -397,14 +353,12 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_rename/grp_dsets/named_vl Dataset {2/2}
|
||||
Location: 1:79096
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: shared-1:79048 variable length of
|
||||
32-bit little-endian integer
|
||||
/grp_rename/grp_dsets/nested_vl Dataset {2/2}
|
||||
Location: 1:87568
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: variable length of
|
||||
variable length of
|
||||
@ -412,7 +366,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_rename/grp_dsets/simple Dataset {6/6}
|
||||
Location: 1:87712
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_rename/grp_dsets/vl Type
|
||||
@ -423,14 +376,12 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_rename/named_vl Dataset {2/2}
|
||||
Location: 1:66112
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: shared-1:66064 variable length of
|
||||
32-bit little-endian integer
|
||||
/grp_rename/nested_vl Dataset {2/2}
|
||||
Location: 1:74584
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: variable length of
|
||||
variable length of
|
||||
@ -438,7 +389,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/grp_rename/simple Dataset {6/6}
|
||||
Location: 1:74728
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/grp_rename/vl Type
|
||||
@ -449,14 +399,12 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/named_vl Dataset {2/2}
|
||||
Location: 1:13104
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: shared-1:13056 variable length of
|
||||
32-bit little-endian integer
|
||||
/nested_vl Dataset {2/2}
|
||||
Location: 1:27392
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: variable length of
|
||||
variable length of
|
||||
@ -464,7 +412,6 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/rename Dataset {2/2}
|
||||
Location: 1:31760
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: struct {
|
||||
"str1" +0 20-byte null-terminated ASCII string
|
||||
@ -473,12 +420,10 @@ Opened "../testfiles/h5copytst.out.h5" with sec2 driver.
|
||||
/simple Dataset {6/6}
|
||||
Location: 1:800
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
/simple_top Dataset {6/6}
|
||||
Location: 1:29584
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: <details removed for portability>
|
||||
Type: 32-bit little-endian integer
|
||||
|
@ -68,7 +68,7 @@ GROUP "/" {
|
||||
LINKCLASS 64
|
||||
TARGETFILE "somefile"
|
||||
TARGETPATH "somepath"
|
||||
}
|
||||
}
|
||||
GROUP "g1.2.1" {
|
||||
SOFTLINK "slink" {
|
||||
LINKTARGET "somevalue"
|
||||
|
@ -52,7 +52,7 @@ GROUP "/" {
|
||||
LINKCLASS 64
|
||||
TARGETFILE "somefile"
|
||||
TARGETPATH "somepath"
|
||||
}
|
||||
}
|
||||
GROUP "g1.2.1" {
|
||||
SOFTLINK "slink" {
|
||||
LINKTARGET "somevalue"
|
||||
|
@ -127,10 +127,10 @@ Expected output for 'h5dump --xml -A tall.h5'
|
||||
</hdf5:Dataset>
|
||||
</hdf5:Group>
|
||||
<hdf5:Group Name="g1.2" OBJ-XID="xid_3568" H5Path="/g1/g1.2" Parents="xid_800" H5ParentPaths="/g1" >
|
||||
<hdf5:ExternalLink LinkName="extlink" OBJ-XID="xid_18446744073709551614" H5SourcePath="/g1/g1.2/extlink" TargetFilename="somefile" TargetPath="somepath" Parents="xid_3568" H5ParentPaths="/g1/g1.2" />
|
||||
<hdf5:Group Name="g1.2.1" OBJ-XID="xid_4272" H5Path="/g1/g1.2/g1.2.1" Parents="xid_3568" H5ParentPaths="/g1/g1.2" >
|
||||
<hdf5:SoftLink LinkName="slink" OBJ-XID="xid_18446744073709551614" H5SourcePath="/g1/g1.2/g1.2.1/slink" TargetPath="somevalue" Parents="xid_4272" H5ParentPaths="/g1/g1.2/g1.2.1" />
|
||||
<hdf5:SoftLink LinkName="slink" OBJ-XID="xid_18446744073709551613" H5SourcePath="/g1/g1.2/g1.2.1/slink" TargetPath="somevalue" Parents="xid_4272" H5ParentPaths="/g1/g1.2/g1.2.1" />
|
||||
</hdf5:Group>
|
||||
<hdf5:ExternalLink LinkName="extlink" OBJ-XID="xid_18446744073709551613" H5SourcePath="/g1/g1.2/extlink" TargetFilename="somefile" TargetPath="somepath" Parents="xid_3568" H5ParentPaths="/g1/g1.2" />
|
||||
</hdf5:Group>
|
||||
</hdf5:Group>
|
||||
<hdf5:Group Name="g2" OBJ-XID="xid_1832" H5Path="/g2" Parents="xid_96" H5ParentPaths="/" >
|
||||
|
@ -48,7 +48,7 @@ GROUP "/" {
|
||||
LINKCLASS 64
|
||||
TARGETFILE "somefile"
|
||||
TARGETPATH "somepath"
|
||||
}
|
||||
}
|
||||
GROUP "g1.2.1" {
|
||||
SOFTLINK "slink" {
|
||||
LINKTARGET "somevalue"
|
||||
|
@ -140,10 +140,10 @@ Expected output for 'h5dump --xml tall.h5'
|
||||
</hdf5:Dataset>
|
||||
</hdf5:Group>
|
||||
<hdf5:Group Name="g1.2" OBJ-XID="xid_3568" H5Path="/g1/g1.2" Parents="xid_800" H5ParentPaths="/g1" >
|
||||
<hdf5:ExternalLink LinkName="extlink" OBJ-XID="xid_18446744073709551614" H5SourcePath="/g1/g1.2/extlink" TargetFilename="somefile" TargetPath="somepath" Parents="xid_3568" H5ParentPaths="/g1/g1.2" />
|
||||
<hdf5:Group Name="g1.2.1" OBJ-XID="xid_4272" H5Path="/g1/g1.2/g1.2.1" Parents="xid_3568" H5ParentPaths="/g1/g1.2" >
|
||||
<hdf5:SoftLink LinkName="slink" OBJ-XID="xid_18446744073709551614" H5SourcePath="/g1/g1.2/g1.2.1/slink" TargetPath="somevalue" Parents="xid_4272" H5ParentPaths="/g1/g1.2/g1.2.1" />
|
||||
<hdf5:SoftLink LinkName="slink" OBJ-XID="xid_18446744073709551613" H5SourcePath="/g1/g1.2/g1.2.1/slink" TargetPath="somevalue" Parents="xid_4272" H5ParentPaths="/g1/g1.2/g1.2.1" />
|
||||
</hdf5:Group>
|
||||
<hdf5:ExternalLink LinkName="extlink" OBJ-XID="xid_18446744073709551613" H5SourcePath="/g1/g1.2/extlink" TargetFilename="somefile" TargetPath="somepath" Parents="xid_3568" H5ParentPaths="/g1/g1.2" />
|
||||
</hdf5:Group>
|
||||
</hdf5:Group>
|
||||
<hdf5:Group Name="g2" OBJ-XID="xid_1832" H5Path="/g2" Parents="xid_96" H5ParentPaths="/" >
|
||||
|
@ -308,7 +308,6 @@ dset Dataset {2/2}
|
||||
(2,2,1) 18, 19, 20, 21, 22, 23, 24
|
||||
Location: 1:976
|
||||
Links: 1
|
||||
Modified: XXXX-XX-XX XX:XX:XX XXX
|
||||
Storage: 8 logical bytes, 0 allocated bytes
|
||||
Type: 32-bit little-endian integer
|
||||
g1 Group
|
||||
|
@ -24,57 +24,6 @@ Expected output for 'h5dump --xml tcompound.h5'
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:NamedDataType Name="type1" OBJ-XID="xid_1424" H5Path="/type1" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="int_name">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="float_name">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:NamedDataType Name="type2" OBJ-XID="xid_2792" H5Path="/type2" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="int_array">
|
||||
<hdf5:DataType>
|
||||
<hdf5:ArrayType Ndims="1">
|
||||
<hdf5:ArrayDimension DimSize="4"/>
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:ArrayType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="float_array">
|
||||
<hdf5:DataType>
|
||||
<hdf5:ArrayType Ndims="2">
|
||||
<hdf5:ArrayDimension DimSize="5"/>
|
||||
<hdf5:ArrayDimension DimSize="6"/>
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:ArrayType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:Dataset Name="dset1" OBJ-XID="xid_744" H5Path= "/dset1" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ContiguousLayout/>
|
||||
@ -122,26 +71,6 @@ Expected output for 'h5dump --xml tcompound.h5'
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
<hdf5:Group Name="group1" OBJ-XID="xid_2104" H5Path="/group1" Parents="xid_696" H5ParentPaths="/" >
|
||||
<hdf5:NamedDataType Name="type3" OBJ-XID="xid_5592" H5Path="/group1/type3" Parents="xid_2104" H5ParentPaths="/group1">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="int">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="float">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:Dataset Name="dset2" OBJ-XID="xid_2152" H5Path= "/group1/dset2" Parents="xid_2104" H5ParentPaths="/group1">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ContiguousLayout/>
|
||||
@ -298,6 +227,26 @@ Expected output for 'h5dump --xml tcompound.h5'
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
<hdf5:NamedDataType Name="type3" OBJ-XID="xid_5592" H5Path="/group1/type3" Parents="xid_2104" H5ParentPaths="/group1">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="int">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="float">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
</hdf5:Group>
|
||||
<hdf5:Group Name="group2" OBJ-XID="xid_6584" H5Path="/group2" Parents="xid_696" H5ParentPaths="/" >
|
||||
<hdf5:Dataset Name="dset5" OBJ-XID="xid_7040" H5Path= "/group2/dset5" Parents="xid_6584" H5ParentPaths="/group2">
|
||||
@ -323,5 +272,56 @@ Expected output for 'h5dump --xml tcompound.h5'
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
</hdf5:Group>
|
||||
<hdf5:NamedDataType Name="type1" OBJ-XID="xid_1424" H5Path="/type1" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="int_name">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="float_name">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:NamedDataType Name="type2" OBJ-XID="xid_2792" H5Path="/type2" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="int_array">
|
||||
<hdf5:DataType>
|
||||
<hdf5:ArrayType Ndims="1">
|
||||
<hdf5:ArrayDimension DimSize="4"/>
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:ArrayType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="float_array">
|
||||
<hdf5:DataType>
|
||||
<hdf5:ArrayType Ndims="2">
|
||||
<hdf5:ArrayDimension DimSize="5"/>
|
||||
<hdf5:ArrayDimension DimSize="6"/>
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:ArrayType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
</hdf5:RootGroup>
|
||||
</hdf5:HDF5-File>
|
||||
|
@ -24,57 +24,6 @@ Expected output for 'h5dump --xml tcompound2.h5'
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:NamedDataType Name="type1" OBJ-XID="xid_3280" H5Path="/type1" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="int_name">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="float_name">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:NamedDataType Name="type2" OBJ-XID="xid_6544" H5Path="/type2" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="int_array">
|
||||
<hdf5:DataType>
|
||||
<hdf5:ArrayType Ndims="1">
|
||||
<hdf5:ArrayDimension DimSize="4"/>
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:ArrayType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="float_array">
|
||||
<hdf5:DataType>
|
||||
<hdf5:ArrayType Ndims="2">
|
||||
<hdf5:ArrayDimension DimSize="5"/>
|
||||
<hdf5:ArrayDimension DimSize="6"/>
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:ArrayType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:Dataset Name="dset1" OBJ-XID="xid_744" H5Path= "/dset1" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ChunkedLayout Ndims="1">
|
||||
@ -126,26 +75,6 @@ Expected output for 'h5dump --xml tcompound2.h5'
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
<hdf5:Group Name="group1" OBJ-XID="xid_3960" H5Path="/group1" Parents="xid_696" H5ParentPaths="/" >
|
||||
<hdf5:NamedDataType Name="type3" OBJ-XID="xid_6624" H5Path="/group1/type3" Parents="xid_3960" H5ParentPaths="/group1">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="int">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="float">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:Dataset Name="dset2" OBJ-XID="xid_4008" H5Path= "/group1/dset2" Parents="xid_3960" H5ParentPaths="/group1">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ChunkedLayout Ndims="1">
|
||||
@ -198,6 +127,26 @@ Expected output for 'h5dump --xml tcompound2.h5'
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
<hdf5:NamedDataType Name="type3" OBJ-XID="xid_6624" H5Path="/group1/type3" Parents="xid_3960" H5ParentPaths="/group1">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="int">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="float">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
</hdf5:Group>
|
||||
<hdf5:Group Name="group2" OBJ-XID="xid_9512" H5Path="/group2" Parents="xid_696" H5ParentPaths="/" >
|
||||
<hdf5:Dataset Name="dset5" OBJ-XID="xid_9968" H5Path= "/group2/dset5" Parents="xid_9512" H5ParentPaths="/group2">
|
||||
@ -227,5 +176,56 @@ Expected output for 'h5dump --xml tcompound2.h5'
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
</hdf5:Group>
|
||||
<hdf5:NamedDataType Name="type1" OBJ-XID="xid_3280" H5Path="/type1" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="int_name">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="float_name">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:NamedDataType Name="type2" OBJ-XID="xid_6544" H5Path="/type2" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="int_array">
|
||||
<hdf5:DataType>
|
||||
<hdf5:ArrayType Ndims="1">
|
||||
<hdf5:ArrayDimension DimSize="4"/>
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:ArrayType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="float_array">
|
||||
<hdf5:DataType>
|
||||
<hdf5:ArrayType Ndims="2">
|
||||
<hdf5:ArrayDimension DimSize="5"/>
|
||||
<hdf5:ArrayDimension DimSize="6"/>
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:ArrayType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
</hdf5:RootGroup>
|
||||
</hdf5:HDF5-File>
|
||||
|
@ -4,13 +4,6 @@ Expected output for 'h5dump --xml tnamed_dtype_attr.h5'
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/DTDs/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/DTDs/HDF5File http://hdfgroup.org/DTDs/HDF5-File.xsd">
|
||||
<hdf5:RootGroup OBJ-XID="xid_96" H5Path="/">
|
||||
<hdf5:NamedDataType Name="Datatype" OBJ-XID="xid_792" H5Path="/Datatype" Parents="xid_96" H5ParentPaths="/">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="LE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:Dataset Name="Dataset" OBJ-XID="xid_1264" H5Path= "/Dataset" Parents="xid_96" H5ParentPaths="/">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ContiguousLayout/>
|
||||
@ -39,6 +32,13 @@ Expected output for 'h5dump --xml tnamed_dtype_attr.h5'
|
||||
<hdf5:NoData/>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
<hdf5:NamedDataType Name="Datatype" OBJ-XID="xid_792" H5Path="/Datatype" Parents="xid_96" H5ParentPaths="/">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="LE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:Group Name="g1" OBJ-XID="xid_1536" H5Path="/g1" Parents="xid_96" H5ParentPaths="/" >
|
||||
<hdf5:Attribute Name="Attribute">
|
||||
<hdf5:Dataspace>
|
||||
|
@ -25,7 +25,7 @@ usage: h5dump [OPTIONS] file
|
||||
with -o (output file) and -d (dataset). B can be:
|
||||
MEMORY for a memory type, FILE for the file type,
|
||||
LE or BE for pre-existing little or big endian types
|
||||
-t P, --datatype=P Print the specified named data type
|
||||
-t P, --datatype=P Print the specified named datatype
|
||||
-w N, --width=N Set the number of columns of output
|
||||
-x, --xml Output in XML using Schema
|
||||
-u, --use-dtd Output in XML using DTD
|
||||
|
@ -35,33 +35,6 @@ Expected output for 'h5dump --xml tobjref.h5'
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
<hdf5:Group Name="Group1" OBJ-XID="xid_1320" H5Path="/Group1" Parents="xid_696" H5ParentPaths="/" >
|
||||
<hdf5:NamedDataType Name="Datatype1" OBJ-XID="xid_2268" H5Path="/Group1/Datatype1" Parents="xid_1320" H5ParentPaths="/Group1">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="a">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="b">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="c">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_1696" H5Path= "/Group1/Dataset1" Parents="xid_1320" H5ParentPaths="/Group1">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ContiguousLayout/>
|
||||
@ -112,6 +85,33 @@ Expected output for 'h5dump --xml tobjref.h5'
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
<hdf5:NamedDataType Name="Datatype1" OBJ-XID="xid_2268" H5Path="/Group1/Datatype1" Parents="xid_1320" H5ParentPaths="/Group1">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="a">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="b">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="c">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:FloatType ByteOrder="BE" Size="4" SignBitLocation="31" ExponentBits="8" ExponentLocation="23" MantissaBits="23" MantissaLocation="0" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
</hdf5:Group>
|
||||
</hdf5:RootGroup>
|
||||
</hdf5:HDF5-File>
|
||||
|
@ -4,35 +4,6 @@ Expected output for 'h5dump --xml tref.h5'
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<hdf5:HDF5-File xmlns:hdf5="http://hdfgroup.org/DTDs/HDF5-File" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hdfgroup.org/DTDs/HDF5File http://hdfgroup.org/DTDs/HDF5-File.xsd">
|
||||
<hdf5:RootGroup OBJ-XID="xid_696" H5Path="/">
|
||||
<hdf5:Dataset Name="ZZZDataset3" OBJ-XID="xid_2612" H5Path= "/ZZZDataset3" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ContiguousLayout/>
|
||||
</hdf5:StorageLayout>
|
||||
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
|
||||
<hdf5:FillValue>
|
||||
<hdf5:NoFill/>
|
||||
</hdf5:FillValue>
|
||||
</hdf5:FillValueInfo>
|
||||
<hdf5:Dataspace>
|
||||
<hdf5:SimpleDataspace Ndims="1">
|
||||
<hdf5:Dimension DimSize="3" MaxDimSize="3"/>
|
||||
</hdf5:SimpleDataspace>
|
||||
</hdf5:Dataspace>
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:ReferenceType>
|
||||
<hdf5:ObjectReferenceType />
|
||||
</hdf5:ReferenceType>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
<hdf5:Data>
|
||||
<hdf5:DataFromFile>
|
||||
"/Group1/Dataset1"
|
||||
"/Group1/Dataset2"
|
||||
"/Group1"
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
<hdf5:Group Name="Group1" OBJ-XID="xid_1344" H5Path="/Group1" Parents="xid_696" H5ParentPaths="/" >
|
||||
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_1720" H5Path= "/Group1/Dataset1" Parents="xid_1344" H5ParentPaths="/Group1">
|
||||
<hdf5:StorageLayout>
|
||||
@ -85,5 +56,34 @@ Expected output for 'h5dump --xml tref.h5'
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
</hdf5:Group>
|
||||
<hdf5:Dataset Name="ZZZDataset3" OBJ-XID="xid_2612" H5Path= "/ZZZDataset3" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ContiguousLayout/>
|
||||
</hdf5:StorageLayout>
|
||||
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
|
||||
<hdf5:FillValue>
|
||||
<hdf5:NoFill/>
|
||||
</hdf5:FillValue>
|
||||
</hdf5:FillValueInfo>
|
||||
<hdf5:Dataspace>
|
||||
<hdf5:SimpleDataspace Ndims="1">
|
||||
<hdf5:Dimension DimSize="3" MaxDimSize="3"/>
|
||||
</hdf5:SimpleDataspace>
|
||||
</hdf5:Dataspace>
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:ReferenceType>
|
||||
<hdf5:ObjectReferenceType />
|
||||
</hdf5:ReferenceType>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
<hdf5:Data>
|
||||
<hdf5:DataFromFile>
|
||||
"/Group1/Dataset1"
|
||||
"/Group1/Dataset2"
|
||||
"/Group1"
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
</hdf5:RootGroup>
|
||||
</hdf5:HDF5-File>
|
||||
|
@ -307,6 +307,295 @@ Expected output for 'h5dump --xml tsaf.h5'
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
<hdf5:Group Name=".attributes" OBJ-XID="xid_5072" H5Path="/.attributes" Parents="xid_696" H5ParentPaths="/" >
|
||||
<hdf5:Group Name="database" OBJ-XID="xid_5728" H5Path="/.attributes/database" Parents="xid_5072" H5ParentPaths="/.attributes" >
|
||||
<hdf5:Dataset Name=".SAF_DbProps" OBJ-XID="xid_6104" H5Path= "/.attributes/database/.SAF_DbProps" Parents="xid_5728" H5ParentPaths="/.attributes/database">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ContiguousLayout/>
|
||||
</hdf5:StorageLayout>
|
||||
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
|
||||
<hdf5:FillValue>
|
||||
<hdf5:NoFill/>
|
||||
</hdf5:FillValue>
|
||||
</hdf5:FillValueInfo>
|
||||
<hdf5:Dataspace>
|
||||
<hdf5:SimpleDataspace Ndims="1">
|
||||
<hdf5:Dimension DimSize="1" MaxDimSize="1"/>
|
||||
</hdf5:SimpleDataspace>
|
||||
</hdf5:Dataspace>
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="magic">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="SFileDir">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="1024" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="ImportFile">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="1024" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="parallel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="safapi">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="vmajor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vminor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="rel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="annot">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="10" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="saflib">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="vmajor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vminor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="rel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="annot">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="10" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vbt">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="vmajor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vminor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="rel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="annot">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="10" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="dsl">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="vmajor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vminor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="rel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="annot">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="10" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="hdf5">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="vmajor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vminor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="rel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="annot">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="10" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="mpi">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="vmajor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vminor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="rel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="annot">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="10" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="DoToc">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="ReadOnly">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="Clobber">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="OSModes">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
<!-- Note: format of compound data not specified -->
|
||||
<hdf5:Data>
|
||||
<hdf5:DataFromFile>
|
||||
-604320037 "." "don't import" 1 0 0 0 "none" 0 1 0 "devel" 1 3 0 "" 0 0 0 "none" 1 2 1 "" 1 2 0 "" 1 0 1 0
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
</hdf5:Group>
|
||||
</hdf5:Group>
|
||||
<hdf5:Dataset Name="Blob" OBJ-XID="xid_17612" H5Path= "/Blob" Parents="xid_696" H5ParentPaths="/">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ChunkedLayout Ndims="1">
|
||||
@ -2628,294 +2917,5 @@ Expected output for 'h5dump --xml tsaf.h5'
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
<hdf5:Group Name=".attributes" OBJ-XID="xid_5072" H5Path="/.attributes" Parents="xid_696" H5ParentPaths="/" >
|
||||
<hdf5:Group Name="database" OBJ-XID="xid_5728" H5Path="/.attributes/database" Parents="xid_5072" H5ParentPaths="/.attributes" >
|
||||
<hdf5:Dataset Name=".SAF_DbProps" OBJ-XID="xid_6104" H5Path= "/.attributes/database/.SAF_DbProps" Parents="xid_5728" H5ParentPaths="/.attributes/database">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ContiguousLayout/>
|
||||
</hdf5:StorageLayout>
|
||||
<hdf5:FillValueInfo FillTime="FillIfSet" AllocationTime="Late">
|
||||
<hdf5:FillValue>
|
||||
<hdf5:NoFill/>
|
||||
</hdf5:FillValue>
|
||||
</hdf5:FillValueInfo>
|
||||
<hdf5:Dataspace>
|
||||
<hdf5:SimpleDataspace Ndims="1">
|
||||
<hdf5:Dimension DimSize="1" MaxDimSize="1"/>
|
||||
</hdf5:SimpleDataspace>
|
||||
</hdf5:Dataspace>
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="magic">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="SFileDir">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="1024" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="ImportFile">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="1024" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="parallel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="safapi">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="vmajor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vminor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="rel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="annot">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="10" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="saflib">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="vmajor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vminor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="rel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="annot">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="10" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vbt">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="vmajor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vminor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="rel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="annot">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="10" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="dsl">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="vmajor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vminor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="rel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="annot">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="10" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="hdf5">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="vmajor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vminor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="rel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="annot">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="10" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="mpi">
|
||||
<hdf5:DataType>
|
||||
<hdf5:CompoundType>
|
||||
<hdf5:Field FieldName="vmajor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="vminor">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="rel">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="annot">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="10" StrPad="H5T_STR_NULLTERM"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="DoToc">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="ReadOnly">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="Clobber">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
<hdf5:Field FieldName="OSModes">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:IntegerType ByteOrder="BE" Sign="true" Size="4" />
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:Field>
|
||||
</hdf5:CompoundType>
|
||||
</hdf5:DataType>
|
||||
<!-- Note: format of compound data not specified -->
|
||||
<hdf5:Data>
|
||||
<hdf5:DataFromFile>
|
||||
-604320037 "." "don't import" 1 0 0 0 "none" 0 1 0 "devel" 1 3 0 "" 0 0 0 "none" 1 2 1 "" 1 2 0 "" 1 0 1 0
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
</hdf5:Group>
|
||||
</hdf5:Group>
|
||||
</hdf5:RootGroup>
|
||||
</hdf5:HDF5-File>
|
||||
|
@ -15,13 +15,6 @@ Expected output for 'h5dump --xml tvlstr.h5'
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Attribute>
|
||||
<hdf5:NamedDataType Name="vl_string_type" OBJ-XID="xid_1576" H5Path="/vl_string_type" Parents="xid_928" H5ParentPaths="/">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="H5T_VARIABLE" StrPad="H5T_STR_NULLPAD"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
<hdf5:Dataset Name="Dataset1" OBJ-XID="xid_976" H5Path= "/Dataset1" Parents="xid_928" H5ParentPaths="/">
|
||||
<hdf5:StorageLayout>
|
||||
<hdf5:ContiguousLayout/>
|
||||
@ -53,5 +46,12 @@ Expected output for 'h5dump --xml tvlstr.h5'
|
||||
</hdf5:DataFromFile>
|
||||
</hdf5:Data>
|
||||
</hdf5:Dataset>
|
||||
<hdf5:NamedDataType Name="vl_string_type" OBJ-XID="xid_1576" H5Path="/vl_string_type" Parents="xid_928" H5ParentPaths="/">
|
||||
<hdf5:DataType>
|
||||
<hdf5:AtomicType>
|
||||
<hdf5:StringType Cset="H5T_CSET_ASCII" StrSize="H5T_VARIABLE" StrPad="H5T_STR_NULLPAD"/>
|
||||
</hdf5:AtomicType>
|
||||
</hdf5:DataType>
|
||||
</hdf5:NamedDataType>
|
||||
</hdf5:RootGroup>
|
||||
</hdf5:HDF5-File>
|
||||
|
Loading…
x
Reference in New Issue
Block a user