Last modified: 14 October 2014
Name: H5Tcopy
Signature:
  hid_t `H5Tcopy`( hid_t `dtype_id` )

Purpose:
  Copies an existing datatype.

Description:
  `H5Tcopy` copies an existing datatype. The returned type is always transient and unlocked.

  The `dtype_id` argument can be either a datatype identifier, a predefined datatype (defined in `H5Tpublic.h`), or a dataset identifier. If `dtype_id` is a dataset identifier instead of a datatype identifier, then this function returns a transient, modifiable datatype which is a copy of the dataset's datatype.

  The datatype identifier returned should be released with `H5Tclose` or resource leaks will occur.

Parameters:

  hid_t `dtype_id` | IN: Identifier of datatype to copy. Can be a datatype identifier, a predefined datatype (defined in `H5Tpublic.h`), or a dataset identifier.

Returns:
  Returns a datatype identifier if successful; otherwise returns a negative value

See Also:
  If `dtype_id` is to be a variable-length string datatype, see “Creating variable-length string datatypes.”

Fortran90 Interface: h5tcopy_f

      SUBROUTINE h5tcopy_f(type_id, new_type_id, hdferr)
        IMPLICIT NONE
        INTEGER(HID_T), INTENT(IN) :: type_id      ! Datatype identifier
        INTEGER(HID_T), INTENT(OUT) :: new_type_id ! Identifier of datatype's copy
        INTEGER, INTENT(OUT) :: hdferr             ! Error code
                                                   ! 0 on success and -1 on failure
      END SUBROUTINE h5tcopy_f

See Also:
  “Using Identifiers”