mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-24 17:51:25 +08:00
[svn-r7059] Purpose:
Refactoring Description: Track changes to H5Fget_obj_<foo> API functions. Platforms tested: FreeBSD 4.8 (sleipnir) h5committest
This commit is contained in:
parent
b6fca58d92
commit
1aeaa7fbb1
@ -70,8 +70,9 @@ Release 1.4.x versions of this document; they are not reported here.
|
|||||||
<tr>
|
<tr>
|
||||||
<td align="left" valign="top"><code>H5Fget_obj_ids</code></td>
|
<td align="left" valign="top"><code>H5Fget_obj_ids</code></td>
|
||||||
<td align="left" valign="top">
|
<td align="left" valign="top">
|
||||||
<em>herr_t </em><code>H5Fget_obj_ids</code> (<em>hid_t</em> <code>file_id</code>,
|
<em>int </em><code>H5Fget_obj_ids</code> (<em>hid_t</em> <code>file_id</code>,
|
||||||
<em>unsigned int</em> <code>types</code>, <em>hid_t *</em><code>obj_id_list</code>)
|
<em>unsigned int</em> <code>types</code>,
|
||||||
|
<em>int</em> <code>max_objs</code>, <em>hid_t *</em><code>obj_id_list</code>)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -529,9 +529,8 @@ facilitate moving easily between them.</i>
|
|||||||
<dl>
|
<dl>
|
||||||
<dt><strong>Name:</strong> <a name="File-GetObjCount">H5Fget_obj_count</a>
|
<dt><strong>Name:</strong> <a name="File-GetObjCount">H5Fget_obj_count</a>
|
||||||
<dt><strong>Signature:</strong>
|
<dt><strong>Signature:</strong>
|
||||||
<dd><em>herr_t </em><code>H5Fget_obj_count</code>(<em>hid_t</em> <code>file_id</code>,
|
<dd><em>int </em><code>H5Fget_obj_count</code>(<em>hid_t</em> <code>file_id</code>,
|
||||||
<em>unsigned int</em> <code>types</code>,
|
<em>unsigned int</em> <code>types</code>
|
||||||
<em>unsigned int *</em><code>obj_id_count</code>
|
|
||||||
)
|
)
|
||||||
<dt><strong>Purpose:</strong>
|
<dt><strong>Purpose:</strong>
|
||||||
<dd>Returns the number of open object identifiers for an open file.
|
<dd>Returns the number of open object identifiers for an open file.
|
||||||
@ -565,13 +564,18 @@ facilitate moving easily between them.</i>
|
|||||||
<code>H5F_OBJ_DATATYPE </code>
|
<code>H5F_OBJ_DATATYPE </code>
|
||||||
</td><td valign=top>
|
</td><td valign=top>
|
||||||
Named datatypes only
|
Named datatypes only
|
||||||
|
</td></tr><tr><td valign=top>
|
||||||
|
<code>H5F_OBJ_ATTR </code>
|
||||||
|
</td><td valign=top>
|
||||||
|
Attributes only
|
||||||
</td></tr><tr><td valign=top>
|
</td></tr><tr><td valign=top>
|
||||||
<code>H5F_OBJ_ALL</code>
|
<code>H5F_OBJ_ALL</code>
|
||||||
</td><td valign=top>
|
</td><td valign=top>
|
||||||
All of the above
|
All of the above
|
||||||
<br>
|
<br>
|
||||||
(I.e., <code>H5F_OBJ_FILE</code> | <code>H5F_OBJ_DATASET</code> |
|
(I.e., <code>H5F_OBJ_FILE</code> | <code>H5F_OBJ_DATASET</code> |
|
||||||
<code>H5F_OBJ_GROUP</code> | <code>H5F_OBJ_DATATYPE</code> )
|
<code>H5F_OBJ_GROUP</code> | <code>H5F_OBJ_DATATYPE</code>
|
||||||
|
| <code>H5F_OBJ_ATTR</code> )
|
||||||
</td></tr>
|
</td></tr>
|
||||||
</table>
|
</table>
|
||||||
</center>
|
</center>
|
||||||
@ -586,11 +590,9 @@ facilitate moving easily between them.</i>
|
|||||||
<code>H5F_OBJ_ALL</code> for all currently-open HDF5 files.
|
<code>H5F_OBJ_ALL</code> for all currently-open HDF5 files.
|
||||||
<dt><em>unsigned int</em> <code>types</code>
|
<dt><em>unsigned int</em> <code>types</code>
|
||||||
<dd>IN: Type of object for which identifiers are to be returned.
|
<dd>IN: Type of object for which identifiers are to be returned.
|
||||||
<dt><em>unsigned int *</em><code>obj_id_count</code>
|
|
||||||
<dd>OUT: Pointer to the returned list of open object identifiers.
|
|
||||||
</dl>
|
</dl>
|
||||||
<dt><strong>Returns:</strong>
|
<dt><strong>Returns:</strong>
|
||||||
<dd>Returns a file access property list identifier if successful;
|
<dd>Returns a the number of open objects if successful;
|
||||||
otherwise returns a negative value.
|
otherwise returns a negative value.
|
||||||
<dt><strong>Non-C API(s):</strong>
|
<dt><strong>Non-C API(s):</strong>
|
||||||
<dd><a href="fortran/h5f_FORTRAN.html#h5fget_obj_count_f"
|
<dd><a href="fortran/h5f_FORTRAN.html#h5fget_obj_count_f"
|
||||||
@ -606,8 +608,9 @@ facilitate moving easily between them.</i>
|
|||||||
<dl>
|
<dl>
|
||||||
<dt><strong>Name:</strong> <a name="File-GetObjIDs">H5Fget_obj_ids</a>
|
<dt><strong>Name:</strong> <a name="File-GetObjIDs">H5Fget_obj_ids</a>
|
||||||
<dt><strong>Signature:</strong>
|
<dt><strong>Signature:</strong>
|
||||||
<dd><em>herr_t </em><code>H5Fget_obj_ids</code>(<em>hid_t</em> <code>file_id</code>,
|
<dd><em>int </em><code>H5Fget_obj_ids</code>(<em>hid_t</em> <code>file_id</code>,
|
||||||
<em>unsigned int</em> <code>types</code>,
|
<em>unsigned int</em> <code>types</code>,
|
||||||
|
<em>int</em> <code>max_objs</code>,
|
||||||
<em>hid_t *</em><code>obj_id_list</code>
|
<em>hid_t *</em><code>obj_id_list</code>
|
||||||
)
|
)
|
||||||
<dt><strong>Purpose:</strong>
|
<dt><strong>Purpose:</strong>
|
||||||
@ -625,6 +628,9 @@ facilitate moving easily between them.</i>
|
|||||||
The types of object identifiers to be retrieved are specified
|
The types of object identifiers to be retrieved are specified
|
||||||
in <code>types</code> using the codes listed for the same
|
in <code>types</code> using the codes listed for the same
|
||||||
parameter in <a href="#File-GetObjCount"><code>H5Fget_obj_count</code></a>
|
parameter in <a href="#File-GetObjCount"><code>H5Fget_obj_count</code></a>
|
||||||
|
<p>
|
||||||
|
To retrieve identifiers for all open objects, pass a negative value
|
||||||
|
for the <code>max_objs</code>.
|
||||||
<dt><strong>Parameters:</strong>
|
<dt><strong>Parameters:</strong>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><em>hid_t</em> <code>file_id</code>
|
<dt><em>hid_t</em> <code>file_id</code>
|
||||||
@ -632,11 +638,13 @@ facilitate moving easily between them.</i>
|
|||||||
<code>H5F_OBJ_ALL</code> for all currently-open HDF5 files.
|
<code>H5F_OBJ_ALL</code> for all currently-open HDF5 files.
|
||||||
<dt><em>unsigned int</em> <code>types</code>
|
<dt><em>unsigned int</em> <code>types</code>
|
||||||
<dd>IN: Type of object for which identifiers are to be returned.
|
<dd>IN: Type of object for which identifiers are to be returned.
|
||||||
|
<dt><em>int</em> <code>max_objs</code>
|
||||||
|
<dd>IN: Maximum number of object identifiers to place into <code>obj_id_list</code>.
|
||||||
<dt><em>hid_t *</em><code>obj_id_list</code>
|
<dt><em>hid_t *</em><code>obj_id_list</code>
|
||||||
<dd>OUT: Pointer to the returned list of open object identifiers.
|
<dd>OUT: Pointer to the returned list of open object identifiers.
|
||||||
</dl>
|
</dl>
|
||||||
<dt><strong>Returns:</strong>
|
<dt><strong>Returns:</strong>
|
||||||
<dd>Returns a non-negative value if successful;
|
<dd>Returns number of objects placed into <code>obj_id_list</code> if successful;
|
||||||
otherwise returns a negative value.
|
otherwise returns a negative value.
|
||||||
<dt><strong>Non-C API(s):</strong>
|
<dt><strong>Non-C API(s):</strong>
|
||||||
<dd><a href="fortran/h5f_FORTRAN.html#h5fget_obj_ids_f"
|
<dd><a href="fortran/h5f_FORTRAN.html#h5fget_obj_ids_f"
|
||||||
|
@ -300,7 +300,7 @@ FORTRAN File API -- h5f
|
|||||||
|
|
||||||
<dt><strong>FORTRAN interface:</strong>   <strong>h5fget_obj_ids_f</strong>
|
<dt><strong>FORTRAN interface:</strong>   <strong>h5fget_obj_ids_f</strong>
|
||||||
<pre>
|
<pre>
|
||||||
SUBROUTINE h5fget_obj_ids_f(file_id, obj_type, obj_ids, hdferr)
|
SUBROUTINE h5fget_obj_ids_f(file_id, obj_type, max_objs, obj_ids, hdferr)
|
||||||
|
|
||||||
IMPLICIT NONE
|
IMPLICIT NONE
|
||||||
INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
|
INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
|
||||||
@ -310,6 +310,7 @@ FORTRAN File API -- h5f
|
|||||||
! H5F_OBJ_DATASET_F
|
! H5F_OBJ_DATASET_F
|
||||||
! H5F_OBJ_DATATYPE_F
|
! H5F_OBJ_DATATYPE_F
|
||||||
! H5F_OBJ_ALL_F
|
! H5F_OBJ_ALL_F
|
||||||
|
INTEGER, INTENT(IN) :: max_objs ! Maximum # of object IDs to retrieve
|
||||||
INTEGER(HID_T), DIMENSION(*), INTENT(OUT) :: obj_ids
|
INTEGER(HID_T), DIMENSION(*), INTENT(OUT) :: obj_ids
|
||||||
! array of requested object identifiers
|
! array of requested object identifiers
|
||||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||||
|
@ -417,12 +417,12 @@ nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, int_f * obj_count)
|
|||||||
int ret_value = 0;
|
int ret_value = 0;
|
||||||
hid_t c_file_id;
|
hid_t c_file_id;
|
||||||
unsigned c_obj_type;
|
unsigned c_obj_type;
|
||||||
unsigned c_obj_count;
|
int c_obj_count;
|
||||||
|
|
||||||
|
|
||||||
c_file_id = (hid_t)*file_id;
|
c_file_id = (hid_t)*file_id;
|
||||||
c_obj_type = (unsigned) *obj_type;
|
c_obj_type = (unsigned) *obj_type;
|
||||||
if ( H5Fget_obj_count(c_file_id, c_obj_type, &c_obj_count) < 0 ) ret_value = -1;
|
if ( (c_obj_count=H5Fget_obj_count(c_file_id, c_obj_type)) < 0 ) ret_value = -1;
|
||||||
*obj_count = (int_f)c_obj_count;
|
*obj_count = (int_f)c_obj_count;
|
||||||
return ret_value;
|
return ret_value;
|
||||||
}
|
}
|
||||||
@ -439,14 +439,16 @@ nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, int_f * obj_count)
|
|||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
int_f
|
int_f
|
||||||
nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, hid_t_f *obj_ids)
|
nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, int_f *max_objs, hid_t_f *obj_ids)
|
||||||
{
|
{
|
||||||
int ret_value = 0;
|
int ret_value = 0;
|
||||||
hid_t c_file_id;
|
hid_t c_file_id;
|
||||||
unsigned c_obj_type;
|
unsigned c_obj_type;
|
||||||
|
int c_max_objs;
|
||||||
|
|
||||||
c_file_id = (hid_t)*file_id;
|
c_file_id = (hid_t)*file_id;
|
||||||
c_obj_type = (unsigned) *obj_type;
|
c_obj_type = (unsigned) *obj_type;
|
||||||
if ( H5Fget_obj_ids(c_file_id, c_obj_type, (hid_t *)obj_ids) < 0 ) ret_value = -1;
|
c_max_objs = (int)*max_objs;
|
||||||
|
if ( H5Fget_obj_ids(c_file_id, c_obj_type, c_max_objs, (hid_t *)obj_ids) < 0 ) ret_value = -1;
|
||||||
return ret_value;
|
return ret_value;
|
||||||
}
|
}
|
||||||
|
@ -771,7 +771,7 @@
|
|||||||
! Comment:
|
! Comment:
|
||||||
!----------------------------------------------------------------------
|
!----------------------------------------------------------------------
|
||||||
|
|
||||||
SUBROUTINE h5fget_obj_ids_f(file_id, obj_type, obj_ids, hdferr)
|
SUBROUTINE h5fget_obj_ids_f(file_id, obj_type, max_objs, obj_ids, hdferr)
|
||||||
!
|
!
|
||||||
!This definition is needed for Windows DLLs
|
!This definition is needed for Windows DLLs
|
||||||
!DEC$if defined(BUILD_HDF5_DLL)
|
!DEC$if defined(BUILD_HDF5_DLL)
|
||||||
@ -782,23 +782,25 @@
|
|||||||
IMPLICIT NONE
|
IMPLICIT NONE
|
||||||
INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
|
INTEGER(HID_T), INTENT(IN) :: file_id ! File identifier
|
||||||
INTEGER, INTENT(IN) :: obj_type ! Object type
|
INTEGER, INTENT(IN) :: obj_type ! Object type
|
||||||
|
INTEGER, INTENT(IN) :: max_objs ! Maximum # of objects to retrieve
|
||||||
INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids
|
INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids
|
||||||
! Array of open objects iidentifiers
|
! Array of open objects iidentifiers
|
||||||
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
INTEGER, INTENT(OUT) :: hdferr ! Error code
|
||||||
|
|
||||||
INTERFACE
|
INTERFACE
|
||||||
INTEGER FUNCTION h5fget_obj_ids_c(file_id, obj_type, obj_ids)
|
INTEGER FUNCTION h5fget_obj_ids_c(file_id, obj_type, max_objs, obj_ids)
|
||||||
USE H5GLOBAL
|
USE H5GLOBAL
|
||||||
!DEC$ IF DEFINED(HDF5F90_WINDOWS)
|
!DEC$ IF DEFINED(HDF5F90_WINDOWS)
|
||||||
!MS$ATTRIBUTES C,reference,alias:'_H5FGET_OBJ_IDS_C':: h5fget_obj_ids_c
|
!MS$ATTRIBUTES C,reference,alias:'_H5FGET_OBJ_IDS_C':: h5fget_obj_ids_c
|
||||||
!DEC$ ENDIF
|
!DEC$ ENDIF
|
||||||
INTEGER(HID_T), INTENT(IN) :: file_id
|
INTEGER(HID_T), INTENT(IN) :: file_id
|
||||||
INTEGER, INTENT(IN) :: obj_type
|
INTEGER, INTENT(IN) :: obj_type
|
||||||
|
INTEGER, INTENT(IN) :: max_objs
|
||||||
INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids
|
INTEGER(HID_T), DIMENSION(*), INTENT(INOUT) :: obj_ids
|
||||||
END FUNCTION h5fget_obj_ids_c
|
END FUNCTION h5fget_obj_ids_c
|
||||||
END INTERFACE
|
END INTERFACE
|
||||||
|
|
||||||
hdferr = h5fget_obj_ids_c(file_id, obj_type, obj_ids)
|
hdferr = h5fget_obj_ids_c(file_id, obj_type, max_objs, obj_ids)
|
||||||
|
|
||||||
END SUBROUTINE h5fget_obj_ids_f
|
END SUBROUTINE h5fget_obj_ids_f
|
||||||
END MODULE H5F
|
END MODULE H5F
|
||||||
|
@ -77,7 +77,7 @@ H5_DLL int_f nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id);
|
|||||||
|
|
||||||
H5_DLL int_f nh5fget_obj_count_c (hid_t_f *file_id, int_f *obj_type, int_f *obj_count);
|
H5_DLL int_f nh5fget_obj_count_c (hid_t_f *file_id, int_f *obj_type, int_f *obj_count);
|
||||||
|
|
||||||
H5_DLL int_f nh5fget_obj_ids_c (hid_t_f *file_id, int_f *obj_type, int_f *obj_ids);
|
H5_DLL int_f nh5fget_obj_ids_c (hid_t_f *file_id, int_f *obj_type, int_f *max_objs, int_f *obj_ids);
|
||||||
H5_DLL int_f nh5fflush_c (hid_t_f *obj_id, int_f *scope);
|
H5_DLL int_f nh5fflush_c (hid_t_f *obj_id, int_f *scope);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -638,7 +638,7 @@
|
|||||||
write(*,*) "Wrong number of open objects reported, error"
|
write(*,*) "Wrong number of open objects reported, error"
|
||||||
endif
|
endif
|
||||||
allocate(obj_ids(obj_countf), stat = error)
|
allocate(obj_ids(obj_countf), stat = error)
|
||||||
CALL h5fget_obj_ids_f(fid, H5F_OBJ_FILE_F, obj_ids, error)
|
CALL h5fget_obj_ids_f(fid, H5F_OBJ_FILE_F, -1, obj_ids, error)
|
||||||
CALL check("h5fget_obj_ids_f",error,total_error)
|
CALL check("h5fget_obj_ids_f",error,total_error)
|
||||||
if(error .eq. 0) then
|
if(error .eq. 0) then
|
||||||
do i = 1, obj_countf
|
do i = 1, obj_countf
|
||||||
|
80
test/tfile.c
80
test/tfile.c
@ -713,7 +713,7 @@ static void
|
|||||||
create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
|
create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
|
||||||
hid_t *ret_gid2, hid_t *ret_gid3)
|
hid_t *ret_gid2, hid_t *ret_gid3)
|
||||||
{
|
{
|
||||||
unsigned oid_count;
|
int oid_count;
|
||||||
herr_t ret;
|
herr_t ret;
|
||||||
|
|
||||||
/* Check reference counts of file IDs and opened object IDs.
|
/* Check reference counts of file IDs and opened object IDs.
|
||||||
@ -721,22 +721,20 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
|
|||||||
* is changed, remember to check this part and update the macros.
|
* is changed, remember to check this part and update the macros.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
ret = H5Fget_obj_count(fid1, H5F_OBJ_ALL, &oid_count);
|
oid_count = H5Fget_obj_count(fid1, H5F_OBJ_ALL);
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_2, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_2, "H5Fget_obj_count");
|
||||||
|
|
||||||
ret = H5Fget_obj_count(fid1, H5F_OBJ_DATASET|H5F_OBJ_GROUP|
|
oid_count = H5Fget_obj_count(fid1, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR);
|
||||||
H5F_OBJ_DATATYPE, &oid_count);
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
|
||||||
|
|
||||||
ret = H5Fget_obj_count(fid2, H5F_OBJ_ALL, &oid_count);
|
oid_count = H5Fget_obj_count(fid2, H5F_OBJ_ALL);
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_2, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_2, "H5Fget_obj_count");
|
||||||
|
|
||||||
ret = H5Fget_obj_count(fid2, H5F_OBJ_DATASET|H5F_OBJ_GROUP|
|
oid_count = H5Fget_obj_count(fid2, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR);
|
||||||
H5F_OBJ_DATATYPE, &oid_count);
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -779,14 +777,17 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
|
|||||||
{
|
{
|
||||||
hid_t gid1, gid2, gid3;
|
hid_t gid1, gid2, gid3;
|
||||||
gid1 = H5Gcreate(fid2, "/group", 0);
|
gid1 = H5Gcreate(fid2, "/group", 0);
|
||||||
|
CHECK(gid1, FAIL, "H5Gcreate");
|
||||||
if(ret_gid1 != NULL)
|
if(ret_gid1 != NULL)
|
||||||
*ret_gid1 = gid1;
|
*ret_gid1 = gid1;
|
||||||
|
|
||||||
gid2 = H5Gopen(fid2, "/group");
|
gid2 = H5Gopen(fid2, "/group");
|
||||||
|
CHECK(gid2, FAIL, "H5Gopen");
|
||||||
if(ret_gid2 != NULL)
|
if(ret_gid2 != NULL)
|
||||||
*ret_gid2 = gid2;
|
*ret_gid2 = gid2;
|
||||||
|
|
||||||
gid3 = H5Gopen(fid2, "/group");
|
gid3 = H5Gopen(fid2, "/group");
|
||||||
|
CHECK(gid3, FAIL, "H5Gopen");
|
||||||
if(ret_gid3 != NULL)
|
if(ret_gid3 != NULL)
|
||||||
*ret_gid3 = gid3;
|
*ret_gid3 = gid3;
|
||||||
}
|
}
|
||||||
@ -796,22 +797,20 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
|
|||||||
* is changed, remember to check this part and update the macros.
|
* is changed, remember to check this part and update the macros.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
ret = H5Fget_obj_count(fid1, H5F_OBJ_ALL, &oid_count);
|
oid_count = H5Fget_obj_count(fid1, H5F_OBJ_ALL);
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_6, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_6, "H5Fget_obj_count");
|
||||||
|
|
||||||
ret = H5Fget_obj_count(fid1, H5F_OBJ_DATASET|H5F_OBJ_GROUP|
|
oid_count = H5Fget_obj_count(fid1, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR);
|
||||||
H5F_OBJ_DATATYPE, &oid_count);
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
|
||||||
|
|
||||||
ret = H5Fget_obj_count(fid2, H5F_OBJ_ALL, &oid_count);
|
oid_count = H5Fget_obj_count(fid2, H5F_OBJ_ALL);
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_6, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_6, "H5Fget_obj_count");
|
||||||
|
|
||||||
ret = H5Fget_obj_count(fid2, H5F_OBJ_DATASET|H5F_OBJ_GROUP|
|
oid_count = H5Fget_obj_count(fid2, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR);
|
||||||
H5F_OBJ_DATATYPE, &oid_count);
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -826,7 +825,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
|
|||||||
hid_t gid2, hid_t gid3)
|
hid_t gid2, hid_t gid3)
|
||||||
{
|
{
|
||||||
hid_t fid3, fid4;
|
hid_t fid3, fid4;
|
||||||
unsigned oid_count;
|
int oid_count;
|
||||||
herr_t ret;
|
herr_t ret;
|
||||||
|
|
||||||
/* Create two new files */
|
/* Create two new files */
|
||||||
@ -836,38 +835,43 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
|
|||||||
CHECK(fid4, FAIL, "H5Fcreate");
|
CHECK(fid4, FAIL, "H5Fcreate");
|
||||||
|
|
||||||
/* test object count of all files IDs open */
|
/* test object count of all files IDs open */
|
||||||
ret = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_FILE, &oid_count);
|
oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_FILE);
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
|
||||||
|
|
||||||
/* test object count of all dataset open */
|
/* test object count of all datasets open */
|
||||||
ret = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_DATASET, &oid_count);
|
oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_DATASET);
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_1, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_1, "H5Fget_obj_count");
|
||||||
|
|
||||||
/* test object count of all group open */
|
/* test object count of all groups open */
|
||||||
ret = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_GROUP, &oid_count);
|
oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_GROUP);
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_3, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_3, "H5Fget_obj_count");
|
||||||
|
|
||||||
/* test object count of all datatype open */
|
/* test object count of all named datatypes open */
|
||||||
ret = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_DATATYPE, &oid_count);
|
oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_DATATYPE);
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
|
VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
|
||||||
|
|
||||||
|
/* test object count of all attributes open */
|
||||||
|
oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ATTR);
|
||||||
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
|
||||||
|
|
||||||
/* test object count of all objects currently open */
|
/* test object count of all objects currently open */
|
||||||
ret = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL, &oid_count);
|
oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL);
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_count");
|
CHECK(oid_count, FAIL, "H5Fget_obj_count");
|
||||||
VERIFY(oid_count, OBJ_ID_COUNT_8, "H5Fget_obj_count");
|
VERIFY(oid_count, OBJ_ID_COUNT_8, "H5Fget_obj_count");
|
||||||
|
|
||||||
{
|
{
|
||||||
hid_t *oid_list;
|
hid_t *oid_list;
|
||||||
unsigned i;
|
int i;
|
||||||
H5I_type_t id_type;
|
H5I_type_t id_type;
|
||||||
|
|
||||||
oid_list = (hid_t*)calloc(oid_count, sizeof(hid_t));
|
oid_list = (hid_t*)calloc((size_t)oid_count, sizeof(hid_t));
|
||||||
if(oid_list != NULL) {
|
if(oid_list != NULL) {
|
||||||
ret = H5Fget_obj_ids(H5F_OBJ_ALL, H5F_OBJ_ALL, oid_list);
|
ret = H5Fget_obj_ids(H5F_OBJ_ALL, H5F_OBJ_ALL, oid_count, oid_list);
|
||||||
CHECK(ret, FAIL, "H5Fget_obj_ids");
|
CHECK(ret, FAIL, "H5Fget_obj_ids");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user