H5Rget_name
(
hid_t loc_id
,
H5R_type_t ref_type
,
void *ref
,
char *name
,
size_t size
)
H5Rget_name
retrieves a name for the object identified
by ref
.
loc_id
is the identifier for the dataset containing the
reference or for the group containing that dataset.
H5R_type_t
is the reference type of ref
.
Valid values include the following:
H5R_OBJECT | Object reference | |
H5R_DATASET_REGION | Dataset region reference |
ref
is the reference for which the target object’s
name is sought.
If ref
is an object reference, name
will be returned with the name of the referenced object.
If ref
is a dataset region reference,
name
will contain the name of the object containing
the referenced region.
Up to size
characters of the name are returned in
name
; additional characters, if any, are not returned
to the user application.
If the length of the name, which determines the required
value of size
, is unknown, a preliminary
H5Rget_name
call can be made.
The return value of this call will be the size of the
object name.
That value can then be assigned to size
for a second H5Rget_name
call,
which will retrieve the actual name.
If there is no name associated with the object identifier
or if the name is NULL
, H5Rget_name
returns 0
(zero).
Note that an object in an HDF5 file may have multiple paths if there are multiple links pointing to it. This function may return any one of these paths.
hid_t loc_id |
IN: Identifier for the dataset containing the reference or for the group that dataset is in. |
H5R_type_t ref_type |
IN: Type of reference. |
void *ref |
IN: An object or dataset region reference. |
char *name |
OUT: A name associated with the referenced object or dataset region. |
size_t size |
IN: The size of the name buffer. |
0
(zero) if no name is associated with the identifier.
Otherwise returns a negative value.
To get name of an object reference
SUBROUTINE h5rget_name_object_f(loc_id, ref, name, hdferr, size) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing the reference ! or for the group that dataset is in. TYPE(hobj_ref_t_f), INTENT(IN) :: ref ! Object reference INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, ! returning 0 (zero) if no name is associated with the ! identifier CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the referenced object or ! dataset region. INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference END SUBROUTINE h5rget_name_object_f
SUBROUTINE h5rget_name_region_f(loc_id, ref, name, hdferr, size) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: loc_id ! Identifier for the dataset containing ! the reference ! or for the group that dataset is in. TYPE(hdset_reg_ref_t_f), INTENT(IN) :: ref ! Object reference INTEGER(SIZE_T), OPTIONAL, INTENT(OUT) :: size ! The size of the name buffer, ! returning 0 (zero) if no name is ! associated with the identifier. CHARACTER(LEN=*), INTENT(OUT) :: name ! A name associated with the ! referenced object or dataset region. INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure END SUBROUTINE h5rget_name_region_f
Release | C |
1.8.0 | Function introduced in this release. |